fixed gentoo support
[qbat.git] / powermanager.h
blobc525c6012334d647a287a543f8d7d350619db0bf
1 //
2 // C++ Interface: powermanager
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_POWERMANAGER_H
9 #define QBAT_POWERMANAGER_H
11 #include <QHash>
12 #include <QMenu>
13 #include <QSettings>
14 #include <QSystemTrayIcon>
15 #include "common.h"
17 namespace qbat {
18 class CBatteryIcon;
20 class CPowerManager : public QObject {
21 Q_OBJECT
22 private:
23 int m_Timer;
24 int m_DataTimer;
26 bool m_ACPlug;
27 bool m_CriticalHandled;
29 Settings m_Settings;
30 QSettings m_SettingsFile;
32 QMenu m_ContextMenu;
34 QHash<QString, CBatteryIcon *> m_BatteryIcons;
35 CBatteryIcon * m_DefaultIcon;
37 inline void readSettings();
38 inline void writeSettings();
40 void timerEvent(QTimerEvent * event);
41 public:
42 CPowerManager(QObject * parent = 0);
43 ~CPowerManager();
44 private:
45 void updateSupplies();
46 void updateMergedData();
47 void checkCritical();
48 private slots:
49 void updateBatteryData();
50 void restartTimer();
51 public slots:
52 void showSettings();
53 void showAbout();
57 #endif