summaryrefslogtreecommitdiffstats
path: root/src/hardware_battery.h
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-15 17:42:29 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-15 17:42:29 -0500
commit3ec8230e9f10645de684b5e03471e293481183d7 (patch)
tree0a9f15fcc62fb8a0e84eb8270ff30262274f3f4c /src/hardware_battery.h
parent82806a03ea419871940eb3c03c792f3ea15734d9 (diff)
downloadtdepowersave-3ec8230e9f10645de684b5e03471e293481183d7.tar.gz
tdepowersave-3ec8230e9f10645de684b5e03471e293481183d7.zip
Initial migration off of HAL
Diffstat (limited to 'src/hardware_battery.h')
-rw-r--r--src/hardware_battery.h45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/hardware_battery.h b/src/hardware_battery.h
index 2506c83..1eaa7b0 100644
--- a/src/hardware_battery.h
+++ b/src/hardware_battery.h
@@ -42,6 +42,9 @@
#include <tqstringlist.h>
#include <tqobject.h>
+// TDE hardware library
+#include <tdehardwaredevices.h>
+
#include "dbusHAL.h"
class Battery : public TQObject {
@@ -50,12 +53,11 @@ class Battery : public TQObject {
private:
- //! Internal reference to dbusHAL for communication with HAL daemon
- dbusHAL* dbus_HAL;
+ TDEHardwareDevices *m_hwdevices;
- //! HAL udi of the battery to represent
+ //! TDE hardware library udi of the battery to represent
/*!
- * This TQString holds the HAL udi adress of the battery.
+ * This TQString holds the TDE hardware library udi adress of the battery.
* \li empty: all primary batteries are represented
* \li e.g. "/org/freedesktop/Hal/devices/acpi_BAT0": first acpi battery
*/
@@ -67,10 +69,10 @@ private:
* \li e.g. "LION"
*/
TQString technology;
- //! Current charging state of this battery as reported by HAL
+ //! Current charging state of this battery as reported by TDE hardware library
/*!
- * This TQString tells the current capacity_state HAL is reporting.
- * \li as of current HAL spec: "ok", "critical"
+ * This TQString tells the current capacity_state TDE hardware library is reporting.
+ * \li as of current TDE hardware library spec: "ok", "critical"
*/
TQString capacity_state;
//! Unit of charge_level_unit and charge_level_lastfull.
@@ -116,7 +118,7 @@ private:
* \li BAT_LOW: batterylevel is already low
* \li BAT_CRIT: batterylevel has become really critical
* \li BAT_NONE: battery state not available
- * \li BAT_HAL_ERROR: battery state couldn't be retrieved because of a HAL error
+ * \li BAT_TDE hardware library_ERROR: battery state couldn't be retrieved because of a TDE hardware library error
*/
int state;
//! Current charging state of this battery
@@ -221,31 +223,30 @@ signals:
void changedBatteryWarnState (int state);
//! emitted if any Battery state changed
void changedBattery();
-
+
+public slots:
+ //! update a property on device event
+ void updateProperty(TDEGenericDevice*);
+
public:
//! default constructor
- Battery( dbusHAL* _dbus_HAL, TQString _udi );
- //! default constructor
- Battery( dbusHAL* _dbus_HAL );
- //! this constructor forces the use of init with dbuHAL pointer set!
- Battery();
+ Battery( TQString _udi );
//! default destructor
~Battery();
- //! initialize this battery object with values from HAL
- void init( dbusHAL* _dbus_HAL = NULL );
+ //! initialize this battery object with values from TDE hardware library
+ void init();
//! recheck all properties of the battery
void recheck();
//! rechecks only minimalistic set properties
void minRecheck();
- //! update a property on HAL event
- bool updateProperty(TQString _udi, TQString _property);
+
//ro-Interface to internal data
- //! reports the HAL udi of this battery
+ //! reports the TDE hardware library udi of this battery
TQString getUdi() const;
- //! reports HAL capacity_state value
+ //! reports TDE hardware library capacity_state value
TQString getCapacityState() const;
//! reports the physical unit of values like DesignCapacity, PresentRate and Lastfull
TQString getChargelevelUnit() const;
@@ -282,9 +283,9 @@ public:
int getCritLevel() const;
//writeable access to internals
- //! Resets the current HAL udi used by the one given
+ //! Resets the current TDE hardware library udi used by the one given
/*!
- * The given TQString will be (checked and) used as new HAL udi for the battery.
+ * The given TQString will be (checked and) used as new TDE hardware library udi for the battery.
* But don't forget to do a recheck of the battery afterwards.
* \li returns TRUE: if reset was successfull
* \li returns FALSE: if reset couldn't be applied