22 #ifndef STATUSBARBATTERY_H
23 #define STATUSBARBATTERY_H
26 #include <cjson/json.h>
28 #include <QGraphicsObject>
42 void paint(QPainter* painter,
const QStyleOptionGraphicsItem* option, QWidget* widget);
47 void slotPowerdConnectionStateChanged(
bool connected);
48 void slotBatteryLevelUpdated(
int percentage);
49 void slotChargingStateUpdated(
bool charging);
53 void setBatteryLevelText(
int percent);
55 bool m_powerdConnected;
60 static const int kNumChargeSources = 2;
61 static const char* m_chargeSource[kNumChargeSources];
63 static const int kNumBatteryStates = 13;
64 static const int m_chargeLevels[kNumBatteryStates];
65 QPixmap m_pixmap[kNumBatteryStates];
66 QPixmap m_chargingPixmap[kNumBatteryStates];
67 QPixmap m_errorPixmap;
73 QString m_batteryText;
74 bool m_showBatteryText;
75 static bool s_playSoundWhenCharged;