diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-16 23:01:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-16 23:01:29 +0000 |
commit | 4304e8d9dab8e20513e38e71b0debdf6937b630c (patch) | |
tree | 76a86f013a811449a5b5bfbbbb962e7db0bbcc6a /src/dbusHAL.h | |
parent | ba24506b3bb46312d998468ad3c1a7f28058b2bd (diff) | |
download | tdepowersave-4304e8d9dab8e20513e38e71b0debdf6937b630c.tar.gz tdepowersave-4304e8d9dab8e20513e38e71b0debdf6937b630c.zip |
Finish TQt4 port of kpowersave
This enables both Qt3 and Qt4 builds
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kpowersave@1228282 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/dbusHAL.h')
-rw-r--r-- | src/dbusHAL.h | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/dbusHAL.h b/src/dbusHAL.h index 9346f0a..d8e3532 100644 --- a/src/dbusHAL.h +++ b/src/dbusHAL.h @@ -16,14 +16,14 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ - -/*! + +/*! * \file dbusHAL.h * \brief Headerfile for dbusHAL.cpp and the class \ref dbusHAL. */ -/*! +/*! * \class dbusHAL -* \brief class for connection to HAL via D-Bus +* \brief class for connection to HAL via D-Bus * \author Danny Kukawka, <dkukawka@suse.de>, <danny.kukawka@web.de> * \date 2006-2007 */ @@ -41,7 +41,7 @@ #endif // QT - Header -#include <qstring.h> +#include <tqstring.h> // D-Bus Header #include <dbus/dbus.h> // needed for dbus_bool_t @@ -74,10 +74,11 @@ enum msg_type { POLICY_POWER_OWNER_CHANGED }; -class dbusHAL : public QObject{ +class dbusHAL : public TQObject{ Q_OBJECT + TQ_OBJECT -private: +private: //! QT connection to D-Bus DBusQt::Connection* m_dBusQtConnection; @@ -85,7 +86,7 @@ private: DBusConnection *dbus_connection; //! HAL context LibHalContext *hal_ctx; - + //! to store information if KPowersave is connected to D-Bus /*! * This boolean represent information about the state of the connection to D-Bus @@ -100,7 +101,7 @@ private: * \li false: if disconnected */ bool hal_is_connected; - + //! if we could claim the org.freedesktop.Policy.Power interface /*! * This boolean represent information if KPowersave could claim the @@ -114,7 +115,7 @@ private: //! to initialise the connection to D-Bus bool initDBUS(); //! to call a methode on a dbus interface with reply - bool dbusMethodCall( QString interface, QString path, QString object, QString method, + bool dbusMethodCall( TQString interface, TQString path, TQString object, TQString method, DBusBusType dbus_type, void *retvalue, int retval_type, int first_arg_type, va_list var_args); @@ -128,7 +129,7 @@ private: void freeHAL(); public: - + //! default constructor dbusHAL(); //! default destructor @@ -155,7 +156,7 @@ public: bool isConnectedToHAL(); //! to get info about claim org.freedesktop.Policy.Power interface bool aquiredPolicyPowerInterface(); - + //! return the current HAL context LibHalContext *get_HAL_context(); //! return the current DBus connection @@ -163,32 +164,32 @@ public: /* HAL device information stuff */ //! Query a integer device property from HAL - bool halGetPropertyInt(QString udi, QString property, int *returnval); + bool halGetPropertyInt(TQString udi, TQString property, int *returnval); //! Query a bolean device property from HAL - bool halGetPropertyBool(QString udi, QString property, bool *returnval); + bool halGetPropertyBool(TQString udi, TQString property, bool *returnval); //! Query a string device property from HAL - bool halGetPropertyString(QString udi, QString property, QString *returnval); + bool halGetPropertyString(TQString udi, TQString property, TQString *returnval); //! Query a string list device property from HAL - bool halGetPropertyStringList (QString udi, QString property, QStringList *devices); - //! Query a capability for a HAL device - bool halQueryCapability(QString udi, QString capability, bool *returnval); + bool halGetPropertyStringList (TQString udi, TQString property, TQStringList *devices); + //! Query a capability for a HAL device + bool halQueryCapability(TQString udi, TQString capability, bool *returnval); /* functions to find devices and check stuff */ //! check if a property exist on a device - bool halDevicePropertyExist(QString udi, QString property); + bool halDevicePropertyExist(TQString udi, TQString property); //! to find a device by capability - bool halFindDeviceByCapability (QString capability, QStringList *devices); + bool halFindDeviceByCapability (TQString capability, TQStringList *devices); //! to find a device by a string property - bool halFindDeviceByString (QString property, QString keyval, QStringList *devices); - + bool halFindDeviceByString (TQString property, TQString keyval, TQStringList *devices); + /* D-Bus helper functions */ - + /* functions to call methodes */ //! to call a methode on a dbus system bus method without reply - bool dbusSystemMethodCall( QString interface, QString path, QString object, QString method, + bool dbusSystemMethodCall( TQString interface, TQString path, TQString object, TQString method, int first_arg_type, ... ); //! to call a methode on a dbus system bus method with reply - bool dbusSystemMethodCall( QString interface, QString path, QString object, QString method, + bool dbusSystemMethodCall( TQString interface, TQString path, TQString object, TQString method, void *retvalue, int retval_type, int first_arg_type, ... ); //! to call a suspend method on HAL @@ -196,14 +197,14 @@ public: /* PolicyKit call helper */ //! check if the user has a requested privilege - int isUserPrivileged( QString privilege, QString udi, QString ressource = "", QString user = QString()); + int isUserPrivileged( TQString privilege, TQString udi, TQString ressource = "", TQString user = TQString()); //! wrapper to emit a signal with a event from HAL - void emitMsgReceived( msg_type type, QString message, QString string ); - + void emitMsgReceived( msg_type type, TQString message, TQString string ); + signals: //! signal with message to forward from D-Bus to HAL - void msgReceived_withStringString( msg_type, QString, QString ); + void msgReceived_withStringString( msg_type, TQString, TQString ); //! signal if we resumed! void backFromSuspend( int result ); }; |