00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KONQ_FILETIP_H
00023 #define KONQ_FILETIP_H
00024
00025 #include <tqframe.h>
00026 #include <tqpixmap.h>
00027 #include <tdeio/previewjob.h>
00028
00029 #include <libkonq_export.h>
00030
00031 class KFileItem;
00032 class TQLabel;
00033 class TQScrollView;
00034 class TQTimer;
00035
00036
00037
00038 class LIBKONQ_EXPORT KonqFileTip : public TQFrame
00039 {
00040 Q_OBJECT
00041
00042 public:
00043 KonqFileTip( TQScrollView *parent );
00044 ~KonqFileTip();
00045
00046 void setPreview(bool on);
00047
00053 void setOptions( bool on, bool preview, int num );
00054
00060 void setItem( KFileItem *item, const TQRect &rect = TQRect(),
00061 const TQPixmap *pixmap = 0 );
00062
00063 virtual bool eventFilter( TQObject *, TQEvent *e );
00064
00065 protected:
00066 virtual void drawContents( TQPainter *p );
00067 virtual void resizeEvent( TQResizeEvent * );
00068
00069 private slots:
00070 void gotPreview( const KFileItem*, const TQPixmap& );
00071 void gotPreviewResult();
00072
00073 void startDelayed();
00074 void showTip();
00075 void hideTip();
00076
00077 private:
00078 void setFilter( bool enable );
00079
00080 void reposition();
00081
00082 TQLabel* m_iconLabel;
00083 TQLabel* m_textLabel;
00084 bool m_on : 1;
00085 bool m_preview : 1;
00086 bool m_filter : 1;
00087 TQPixmap m_corners[4];
00088 int m_corner;
00089 int m_num;
00090 TQScrollView* m_view;
00091 KFileItem* m_item;
00092 TDEIO::PreviewJob* m_previewJob;
00093 TQRect m_rect;
00094 TQTimer* m_timer;
00095 };
00096
00097 #endif