-
Notifications
You must be signed in to change notification settings - Fork 0
/
qbatttray_t.h
65 lines (53 loc) · 1.67 KB
/
qbatttray_t.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef QBATTTRAY_T_H
#define QBATTTRAY_T_H
#include <QObject>
#include <QString>
#include <QSystemTrayIcon>
#include <QIcon>
#include <qbatticon_t.h>
struct _BatteryIcon_T {
quint8 min;
QIcon icon;
} ;
#define ICON_ROOT_PATH ":/icons/"
// icon names
namespace qBatIcons {
static const QString noBattery = "battery-missing.png";
namespace battery {
static const QString icon_100 = "battery-100.png";
static const QString icon_080 = "battery-080.png";
static const QString icon_060 = "battery-060.png";
static const QString icon_040 = "battery-040.png";
static const QString icon_020 = "battery-caution.png";
static const QString icon_010 = "battery-low.png";
}
namespace charging {
static const QString icon_100 = "battery-charging.png";
static const QString icon_080 = "battery-charging-080.png";
static const QString icon_060 = "battery-charging-060.png";
static const QString icon_040 = "battery-charging-040.png";
static const QString icon_020 = "battery-charging-caution.png";
static const QString icon_010 = "battery-charging-low.png";
}
}
typedef QList <QBattIcon_T> IconsList_T;
class QBattTray_T : public QObject {
Q_OBJECT
public:
explicit QBattTray_T (QObject *parent = 0);
~QBattTray_T();
void setIcon (const QBattIcon_T &icon);
QSystemTrayIcon* getSystemTray ();
private:
QSystemTrayIcon *trayIcon;
int currentLowerLimit;
QBattIcon_T *iconNoBattery;
IconsList_T iconsBattery;
IconsList_T iconsBatteryCharging;
IconsList_T *iconsSet;
signals:
public slots:
void batteryLevelChanged (int percent);
void batteryStatusChanged (bool charging);
};
#endif // QBATTTRAY_T_H