added manpage
[qbat.git] / powermanager.h
blobb4122b7b825c2c8e7b488b4fcb6a332d93c4bb0b
1 //
2 // C++ Interface: cpowermanager
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 <QDir>
13 #include <QMenu>
14 #include <QSettings>
15 #include <QSystemTrayIcon>
16 #include "common.h"
18 namespace qbat {
19 class CBatteryIcon;
21 class CPowerManager : public QObject {
22 Q_OBJECT
23 private:
24 int m_Timer;
25 QDir m_SysfsDir;
27 Settings m_Settings;
28 QSettings m_SettingsFile;
30 QMenu m_ContextMenu;
32 QHash<QString, CBatteryIcon *> m_BatteryIcons;
33 QSystemTrayIcon m_DefaultTrayIcon;
35 void timerEvent(QTimerEvent * event);
37 inline void readSettings();
38 inline void writeSettings();
39 public:
40 CPowerManager(QObject * parent = 0);
41 ~CPowerManager();
42 private slots:
43 void updateData();
44 void restartTimer();
45 public slots:
46 void showSettings();
47 void showAbout();
51 #endif