kdeui
ksystemtray.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KSYSTEMTRAY_H
00019 #define KSYSTEMTRAY_H
00020
00021 #include <kglobal.h>
00022 #include <qlabel.h>
00023
00024 class KActionCollection;
00025 class KPopupMenu;
00026 class KSystemTrayPrivate;
00027
00063 class KDEUI_EXPORT KSystemTray : public QLabel
00064 {
00065 Q_OBJECT
00066 public:
00067
00081 KSystemTray( QWidget* parent = 0, const char* name = 0 );
00082
00083
00084
00085
00086 ~KSystemTray();
00087
00092 KPopupMenu* contextMenu() const;
00093
00099 KActionCollection* actionCollection();
00100
00104 virtual void setPixmap( const QPixmap& icon );
00105
00110 virtual void setCaption( const QString& title );
00111
00120 static QPixmap loadIcon( const QString &icon, KInstance *instance=KGlobal::instance() );
00121
00122 signals:
00128 void quitSelected();
00129
00130 public slots:
00131
00139 void toggleActive();
00144 void setActive();
00149 void setInactive();
00150
00151 protected:
00152
00159 void mousePressEvent( QMouseEvent * );
00160
00167 void mouseReleaseEvent( QMouseEvent * );
00168
00169
00170
00175 virtual void contextMenuAboutToShow( KPopupMenu* menu );
00176
00180 void showEvent( QShowEvent * );
00181
00185 void enterEvent( QEvent* );
00186
00187 private slots:
00188 void minimizeRestoreAction();
00189 void maybeQuit();
00190
00191 private:
00192 void activateOrHide();
00193 void minimizeRestore( bool restore );
00194 KPopupMenu* menu;
00195
00196 int minimizeRestoreId;
00197 uint hasQuit :1;
00198 protected:
00199 virtual void virtual_hook( int id, void* data );
00200 private:
00201 KSystemTrayPrivate* d;
00202 };
00203
00204
00205 #endif