added WIP support for energy units and current units
[qbat.git] / batteryicon.h
blob6bec571dd4dec089533150451a877446eca4ade6
1 //
2 // C++ Interface: batteryicon
3 //
4 // Author: Oliver Groß <z.o.gross@gmx.de>, (C) 2008
5 //
6 // Copyright: See COPYING file that comes with this distribution
7 //
8 #ifndef QBAT_BATTERYICON_H
9 #define QBAT_BATTERYICON_H
11 #include <QSystemTrayIcon>
13 namespace qbat {
14 struct Settings;
16 class CBatteryIcon : public QSystemTrayIcon {
17 Q_OBJECT
18 private:
19 QString m_BatteryName;
20 QPixmap m_Icon;
21 Settings * m_Settings;
23 qint8 m_RelativeCharge;
25 int m_ChargeFull;
26 int m_ChargeFullDesign;
27 int m_ChargeNow;
28 int m_CurrentNow;
29 int m_Status;
31 bool m_energyUnits;
33 void updateIcon();
34 void updateToolTip();
35 public:
36 CBatteryIcon(QString batteryName, Settings * settings, QMenu * contextMenu, QObject * parent = 0);
37 ~CBatteryIcon();
39 QString batteryName() const { return m_BatteryName; }
41 void updateData(int chargeFull, int chargeFullDesign, int chargeNow, int currentNow, int status, bool energyUnits);
45 #endif