2015-01-29 21:56:53 +08:00
|
|
|
#ifndef SYSTEMTRAYICON_H
|
|
|
|
#define SYSTEMTRAYICON_H
|
|
|
|
|
|
|
|
#include "systemtrayicon_private.h"
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
class QSystemTrayIcon;
|
|
|
|
class QMenu;
|
|
|
|
|
|
|
|
class SystemTrayIcon : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
SystemTrayIcon();
|
2015-02-07 02:38:08 +08:00
|
|
|
~SystemTrayIcon();
|
2015-01-29 21:56:53 +08:00
|
|
|
void setContextMenu(QMenu* menu);
|
|
|
|
void show();
|
|
|
|
void hide();
|
|
|
|
void setVisible(bool);
|
2015-03-11 19:01:10 +08:00
|
|
|
void setIcon(QIcon &icon);
|
2015-01-29 21:56:53 +08:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void activated(QSystemTrayIcon::ActivationReason);
|
|
|
|
|
2015-01-30 00:33:17 +08:00
|
|
|
private:
|
|
|
|
QString extractIconToFile(QIcon icon, QString name="icon");
|
|
|
|
|
2015-01-29 21:56:53 +08:00
|
|
|
private:
|
|
|
|
SystrayBackendType backendType;
|
|
|
|
QSystemTrayIcon* qtIcon;
|
|
|
|
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
|
|
|
|
AppIndicator *unityIndicator;
|
|
|
|
GtkWidget *unityMenu;
|
|
|
|
#endif
|
2015-02-22 05:55:54 +08:00
|
|
|
#ifdef ENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND
|
|
|
|
StatusNotifier* statusNotifier;
|
2015-02-22 07:47:18 +08:00
|
|
|
GtkWidget* snMenu;
|
2015-02-22 05:55:54 +08:00
|
|
|
#endif
|
2015-02-25 06:27:08 +08:00
|
|
|
#ifdef ENABLE_SYSTRAY_GTK_BACKEND
|
|
|
|
GtkStatusIcon* gtkIcon;
|
|
|
|
GtkWidget* gtkMenu;
|
|
|
|
#endif
|
2015-01-29 21:56:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SYSTEMTRAYICON_H
|