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();
|
|
|
|
void setContextMenu(QMenu* menu);
|
|
|
|
void show();
|
|
|
|
void hide();
|
|
|
|
void setVisible(bool);
|
|
|
|
void setIcon(QIcon&& icon);
|
|
|
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SYSTEMTRAYICON_H
|