Torc  0.1
Public Slots | Public Member Functions | Static Public Member Functions | List of all members
TorcPowerUnixDBus Class Referencefinal

A power monitoring class for Unix based systems. More...

#include <torcpowerunixdbus.h>

Inheritance diagram for TorcPowerUnixDBus:
[legend]

Public Slots

void DeviceAdded (QDBusObjectPath Device)
 
void DeviceRemoved (QDBusObjectPath Device)
 
void DeviceChanged (QDBusObjectPath Device)
 
void DBusError (QDBusError Error)
 
void DBusCallback (void)
 
void Changed (void)
 
- Public Slots inherited from TorcPower
void SubscriberDeleted (QObject *Subscriber)
 
bool GetCanShutdown (void)
 
bool GetCanSuspend (void)
 
bool GetCanHibernate (void)
 
bool GetCanRestart (void)
 
int GetBatteryLevel (void)
 
QVariantMap GetPowerStatus (void)
 
bool Shutdown (void)
 
bool Suspend (void)
 
bool Hibernate (void)
 
bool Restart (void)
 
void ShuttingDown (void)
 
void Suspending (void)
 
void Hibernating (void)
 
void Restarting (void)
 
void WokeUp (void)
 
void LowBattery (void)
 

Public Member Functions

 TorcPowerUnixDBus ()
 
virtual ~TorcPowerUnixDBus ()=default
 
bool DoShutdown (void) override
 
bool DoSuspend (void) override
 
bool DoHibernate (void) override
 
bool DoRestart (void) override
 
- Public Member Functions inherited from TorcPower
virtual ~TorcPower ()
 
QString GetUIName (void) override
 
bool event (QEvent *Event) override
 
- Public Member Functions inherited from TorcHTTPService
 TorcHTTPService (QObject *Parent, const QString &Signature, const QString &Name, const QMetaObject &MetaObject, const QString &Blacklist=QStringLiteral(""))
 
virtual ~TorcHTTPService ()
 
void ProcessHTTPRequest (const QString &PeerAddress, int PeerPort, const QString &LocalAddress, int LocalPort, TorcHTTPRequest &Request) override
 
QVariantMap ProcessRequest (const QString &Method, const QVariant &Parameters, QObject *Connection, bool Authenticated) override
 
QString GetMethod (int Index)
 
QVariant GetProperty (int Index)
 Get the value of a given property. More...
 
QVariantMap GetServiceDetails (void)
 Return a QVariantMap describing the services methods and properties. More...
 
virtual QString GetPresentationURL (void)
 
- Public Member Functions inherited from TorcHTTPHandler
 TorcHTTPHandler (const QString &Signature, const QString &Name)
 
virtual ~TorcHTTPHandler ()
 
QString Signature (void) const
 
bool GetRecursive (void) const
 
QString Name (void) const
 

Static Public Member Functions

static bool Available (void)
 
- Static Public Member Functions inherited from TorcPower
static void Create (void)
 
static void TearDown (void)
 

Additional Inherited Members

- Public Types inherited from TorcPower
enum  PowerLevels {
  ACPower = -1, BatteryEmpty = 0, BatteryLow = 10, BatteryFull = 100,
  UnknownPower = 101
}
 
- Signals inherited from TorcPower
void CanShutdownChanged (bool CanShutdown)
 
void CanSuspendChanged (bool CanSuspend)
 
void CanHibernateChanged (bool CanHibernate)
 
void CanRestartChanged (bool CanRestart)
 
void BatteryLevelChanged (int BatteryLevel)
 
- Protected Slots inherited from TorcPower
void CanShutdownActiveChanged (bool Active)
 
void CanSuspendActiveChanged (bool Active)
 
void CanHibernateActiveChanged (bool Active)
 
void CanRestartActiveChanged (bool Active)
 
void CanShutdownValueChanged (bool Value)
 
void CanSuspendValueChanged (bool Value)
 
void CanHibernateValueChanged (bool Value)
 
void CanRestartValueChanged (bool Value)
 
- Protected Member Functions inherited from TorcPower
 TorcPower ()
 
void BatteryUpdated (int Level)
 
void Debug (void)
 
- Protected Member Functions inherited from TorcHTTPService
void HandleSubscriberDeleted (QObject *Subscriber)
 
- Static Protected Member Functions inherited from TorcHTTPHandler
static bool MethodIsAuthorised (TorcHTTPRequest &Request, int Allowed)
 Check the current request is authorised and set the authentication header if not. More...
 
static void HandleOptions (TorcHTTPRequest &Request, int Allowed)
 
static void HandleFile (TorcHTTPRequest &Request, const QString &Filename, int Cache)
 
- Protected Attributes inherited from TorcPower
TorcSettingm_canShutdown
 
TorcSettingm_canSuspend
 
TorcSettingm_canHibernate
 
TorcSettingm_canRestart
 
int m_batteryLevel
 
- Protected Attributes inherited from TorcHTTPService
QReadWriteLock m_httpServiceLock
 
- Protected Attributes inherited from TorcHTTPHandler
QString m_signature
 
bool m_recursive
 
QString m_name
 
- Properties inherited from TorcPower
bool canShutdown
 
bool canSuspend
 
bool canHibernate
 
bool canRestart
 
int batteryLevel
 

Detailed Description

A power monitoring class for Unix based systems.

TorcPowerUnixDBus uses the UPower and ConsoleKit DBus interfaces to monitor the system's power status. UPower has replaced HAL and DeviceKit as the default power monitoring interface but additional implementations for DeviceKit (and perhaps HAL) may be required for complete coverage.

Todo:
Battery status monitoring is untested.

Definition at line 10 of file torcpowerunixdbus.h.

Constructor & Destructor Documentation

TorcPowerUnixDBus::TorcPowerUnixDBus ( )

Definition at line 66 of file torcpowerunixdbus.cpp.

virtual TorcPowerUnixDBus::~TorcPowerUnixDBus ( )
virtualdefault

Member Function Documentation

bool TorcPowerUnixDBus::Available ( void  )
static

Definition at line 39 of file torcpowerunixdbus.cpp.

void TorcPowerUnixDBus::Changed ( void  )
slot

Definition at line 299 of file torcpowerunixdbus.cpp.

void TorcPowerUnixDBus::DBusCallback ( void  )
slot

Definition at line 295 of file torcpowerunixdbus.cpp.

void TorcPowerUnixDBus::DBusError ( QDBusError  Error)
slot

Definition at line 289 of file torcpowerunixdbus.cpp.

void TorcPowerUnixDBus::DeviceAdded ( QDBusObjectPath  Device)
slot

Definition at line 245 of file torcpowerunixdbus.cpp.

void TorcPowerUnixDBus::DeviceChanged ( QDBusObjectPath  Device)
slot

Definition at line 275 of file torcpowerunixdbus.cpp.

void TorcPowerUnixDBus::DeviceRemoved ( QDBusObjectPath  Device)
slot

Definition at line 260 of file torcpowerunixdbus.cpp.

bool TorcPowerUnixDBus::DoHibernate ( void  )
overridevirtual

Implements TorcPower.

Definition at line 204 of file torcpowerunixdbus.cpp.

bool TorcPowerUnixDBus::DoRestart ( void  )
overridevirtual

Implements TorcPower.

Definition at line 226 of file torcpowerunixdbus.cpp.

bool TorcPowerUnixDBus::DoShutdown ( void  )
overridevirtual

Implements TorcPower.

Definition at line 163 of file torcpowerunixdbus.cpp.

bool TorcPowerUnixDBus::DoSuspend ( void  )
overridevirtual

Implements TorcPower.

Definition at line 182 of file torcpowerunixdbus.cpp.


The documentation for this class was generated from the following files: