KDEUI
ksystemtrayicon.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 <kdeui_export.h>
00022 #include <kglobal.h>
00023
00024 #include <QtGui/QSystemTrayIcon>
00025
00026 class KActionCollection;
00027 class KSystemTrayIconPrivate;
00028 class QAction;
00029
00053 class KDEUI_EXPORT KSystemTrayIcon : public QSystemTrayIcon
00054 {
00055 Q_OBJECT
00056 public:
00057
00071 explicit KSystemTrayIcon( QWidget* parent = 0 );
00072
00077 explicit KSystemTrayIcon( const QString& icon, QWidget* parent = 0 );
00078
00083 explicit KSystemTrayIcon( const QIcon& icon, QWidget* parent = 0 );
00084
00088 ~KSystemTrayIcon();
00089
00094 KActionCollection* actionCollection();
00095
00099 QWidget *parentWidget() const;
00100
00107 bool parentWidgetTrayClose() const;
00108
00115 static QIcon loadIcon(const QString &icon, const KComponentData &componentData = KGlobal::mainComponent());
00116
00127 void setContextMenuTitle(QAction *action);
00128
00133 QAction *contextMenuTitle() const;
00134
00135 Q_SIGNALS:
00140 void quitSelected();
00141
00142 public Q_SLOTS:
00143 void toggleActive();
00144
00145 private Q_SLOTS:
00146 void contextMenuAboutToShow();
00147 void minimizeRestoreAction();
00148 void maybeQuit();
00149 void activateOrHide( QSystemTrayIcon::ActivationReason reasonCalled );
00150
00151 private:
00152 void init( QWidget* );
00153 void minimizeRestore( bool restore );
00154
00155 KSystemTrayIconPrivate* const d;
00156 };
00157
00158 #endif
00159