klaptopdaemon
battery.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __BATTERYCONFIG_H__
00027 #define __BATTERYCONFIG_H__
00028
00029 #include <kcmodule.h>
00030
00031 #include <qpixmap.h>
00032 #include <q3ptrlist.h>
00033
00034 #include <QLabel>
00035 #include <QTimerEvent>
00036
00037 class QWidget;
00038 class QSpinBox;
00039 class KConfig;
00040 class QCheckBox;
00041 class KIconLoader;
00042 class KIconButton;
00043 class QPushButton;
00044 class QLabel;
00045
00046
00047 class BatteryConfig : public KCModule
00048 {
00049 Q_OBJECT
00050 public:
00051 BatteryConfig( const KComponentData &inst,QWidget *parent=0);
00052 ~BatteryConfig( );
00053
00054 void save( void );
00055 void load();
00056 void defaults();
00057
00058 virtual QString quickHelp() const;
00059
00060 private slots:
00061
00062 void configChanged();
00063 void slotStartMonitor();
00064 void iconChanged();
00065 void BatteryStateUpdate();
00066
00067 private:
00068 void timerEvent(QTimerEvent *);
00069 void ConvertIcon(int percent, QPixmap &pm, QPixmap &result);
00070 KConfig *config;
00071
00072 QSpinBox* editPoll;
00073 QCheckBox* runMonitor;
00074 QCheckBox* notifyMe;
00075 QCheckBox* blankSaver;
00076 bool enablemonitor;
00077 bool enablequitmenu;
00078 bool useblanksaver;
00079 bool notifyme;
00080
00081 KIconLoader *iconloader;
00082
00083 KIconButton *buttonNoBattery;
00084 KIconButton *buttonNoCharge;
00085 KIconButton *buttonCharge;
00086 QString nobattery, nochargebattery, chargebattery;
00087 QPushButton *startMonitor;
00088 bool apm;
00089 int poll_time;
00090
00091 Q3PtrList<QLabel> batt_label_1, batt_label_2, batt_label_3;
00092 QPixmap battery_pm, battery_nopm;
00093
00094 KComponentData instance;
00095 };
00096
00097 #endif
00098