Torc
0.1
|
A power monitoring class for Unix based systems. More...
#include <torcpowerunixdbus.h>
Public Slots | |
void | DeviceAdded (QDBusObjectPath Device) |
void | DeviceRemoved (QDBusObjectPath Device) |
void | DeviceChanged (QDBusObjectPath Device) |
void | DBusError (QDBusError Error) |
void | DBusCallback (void) |
void | Changed (void) |
![]() | |
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 |
![]() | |
virtual | ~TorcPower () |
QString | GetUIName (void) override |
bool | event (QEvent *Event) override |
![]() | |
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) |
![]() | |
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 void | Create (void) |
static void | TearDown (void) |
Additional Inherited Members | |
![]() | |
enum | PowerLevels { ACPower = -1, BatteryEmpty = 0, BatteryLow = 10, BatteryFull = 100, UnknownPower = 101 } |
![]() | |
void | CanShutdownChanged (bool CanShutdown) |
void | CanSuspendChanged (bool CanSuspend) |
void | CanHibernateChanged (bool CanHibernate) |
void | CanRestartChanged (bool CanRestart) |
void | BatteryLevelChanged (int BatteryLevel) |
![]() | |
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) |
![]() | |
TorcPower () | |
void | BatteryUpdated (int Level) |
void | Debug (void) |
![]() | |
void | HandleSubscriberDeleted (QObject *Subscriber) |
![]() | |
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) |
![]() | |
TorcSetting * | m_canShutdown |
TorcSetting * | m_canSuspend |
TorcSetting * | m_canHibernate |
TorcSetting * | m_canRestart |
int | m_batteryLevel |
![]() | |
QReadWriteLock | m_httpServiceLock |
![]() | |
QString | m_signature |
bool | m_recursive |
QString | m_name |
![]() | |
bool | canShutdown |
bool | canSuspend |
bool | canHibernate |
bool | canRestart |
int | batteryLevel |
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.
Definition at line 10 of file torcpowerunixdbus.h.
TorcPowerUnixDBus::TorcPowerUnixDBus | ( | ) |
Definition at line 66 of file torcpowerunixdbus.cpp.
|
virtualdefault |
|
static |
Definition at line 39 of file torcpowerunixdbus.cpp.
|
slot |
Definition at line 299 of file torcpowerunixdbus.cpp.
|
slot |
Definition at line 295 of file torcpowerunixdbus.cpp.
|
slot |
Definition at line 289 of file torcpowerunixdbus.cpp.
|
slot |
Definition at line 245 of file torcpowerunixdbus.cpp.
|
slot |
Definition at line 275 of file torcpowerunixdbus.cpp.
|
slot |
Definition at line 260 of file torcpowerunixdbus.cpp.
|
overridevirtual |
Implements TorcPower.
Definition at line 204 of file torcpowerunixdbus.cpp.
|
overridevirtual |
Implements TorcPower.
Definition at line 226 of file torcpowerunixdbus.cpp.
|
overridevirtual |
Implements TorcPower.
Definition at line 163 of file torcpowerunixdbus.cpp.
|
overridevirtual |
Implements TorcPower.
Definition at line 182 of file torcpowerunixdbus.cpp.