00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __MINIPAGERBUTTON_H
00025 #define __MINIPAGERBUTTON_H
00026
00027 #include <tqbutton.h>
00028
00029 #include "taskmanager.h"
00030 #include "kickertip.h"
00031
00032 class KPixmap;
00033 class KWinModule;
00034 class KMiniPager;
00035 class KSharedPixmap;
00036 class TQLineEdit;
00037
00038 class KMiniPagerButton : public TQButton, public KickerTip::Client
00039 {
00040 Q_OBJECT
00041 public:
00042 KMiniPagerButton(int desk, bool useViewports, const TQPoint& viewport,
00043 KMiniPager *parent=0, const char *name=0);
00044 ~KMiniPagerButton();
00045
00046 int desktop() { return m_desktop; }
00047
00048 TQString desktopName() { return m_desktopName; }
00049 void setDesktopName( TQString name ) { m_desktopName = name; }
00050
00051 void rename();
00052 void backgroundChanged();
00053 void windowsChanged();
00054
00055 bool shouldPaintWindow( KWin::WindowInfo *info ) const;
00056
00057 signals:
00058 void buttonSelected( int desk );
00059 void showMenu( const TQPoint&, int );
00060
00061 protected:
00062 void drawButton(TQPainter *);
00063 void enterEvent(TQEvent*);
00064 void leaveEvent(TQEvent*);
00065 void resizeEvent(TQResizeEvent *ev);
00066 void mousePressEvent(TQMouseEvent *);
00067 void mouseReleaseEvent(TQMouseEvent *);
00068 void mouseMoveEvent(TQMouseEvent *);
00069 void dragEnterEvent(TQDragEnterEvent* e);
00070 void dragLeaveEvent(TQDragLeaveEvent* e);
00071 void enabledChange( bool oldEnabled );
00072 void dropEvent(TQDropEvent* e);
00073
00074 bool eventFilter(TQObject*, TQEvent*);
00075 void updateKickerTip(KickerTip::Data &data);
00076
00077 private slots:
00078 void slotToggled(bool);
00079 void slotClicked();
00080 void slotDragSwitch();
00081
00082 void backgroundLoaded( bool loaded );
00083
00084 private:
00085 void loadBgPixmap();
00086 TQRect mapGeometryToViewport(const KWin::WindowInfo&) const;
00087 TQPoint mapPointToViewport(const TQPoint&) const;
00088
00089 KMiniPager* m_pager;
00090 int m_desktop;
00091 bool m_useViewports;
00092 TQString m_desktopName;
00093 TQPoint m_viewport;
00094
00095 TQTimer m_updateCompressor;
00096 TQTimer m_dragSwitchTimer;
00097 Task::Ptr m_dragging;
00098
00099 TQLineEdit* m_lineEdit;
00100
00101 KSharedPixmap *m_sharedPixmap;
00102 KPixmap *m_bgPixmap;
00103 static KSharedPixmap *s_commonSharedPixmap;
00104 static KPixmap *s_commonBgPixmap;
00105 bool m_isCommon;
00106
00107 Task::Ptr m_currentWindow;
00108 bool m_inside;
00109 };
00110
00111 #endif