diff options
author | Ken Moore <ken@ixsystems.com> | 2018-01-30 09:05:21 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-01-30 09:05:21 -0500 |
commit | 019c1b82daa8307db4ee4341bd71246d1f8a03cc (patch) | |
tree | 546e06b536b7bcda6a0f8fcd84a05217dd149c30 /src-qt5/src-cpp/framework-OSInterface.h | |
parent | A few couple other attempts at the layering issue. (diff) | |
download | lumina-019c1b82daa8307db4ee4341bd71246d1f8a03cc.tar.gz lumina-019c1b82daa8307db4ee4341bd71246d1f8a03cc.tar.bz2 lumina-019c1b82daa8307db4ee4341bd71246d1f8a03cc.zip |
Get the OSInterface framework up and running (template OS only at the moment)
Diffstat (limited to 'src-qt5/src-cpp/framework-OSInterface.h')
-rw-r--r-- | src-qt5/src-cpp/framework-OSInterface.h | 71 |
1 files changed, 62 insertions, 9 deletions
diff --git a/src-qt5/src-cpp/framework-OSInterface.h b/src-qt5/src-cpp/framework-OSInterface.h index 88f4d10a..95b1b441 100644 --- a/src-qt5/src-cpp/framework-OSInterface.h +++ b/src-qt5/src-cpp/framework-OSInterface.h @@ -39,9 +39,10 @@ class OSInterface : public QObject{ Q_OBJECT // == QML ACCESSIBLE PROPERTIES == //Battery - Q_PROPERTY( float batteryCharge READ batteryCharge NOTIFY batteryChargeChanged) - Q_PROPERTY( bool batteryCharging READ batteryCharging NOTIFY batteryChargingChanged) - Q_PROPERTY( double batterySecondsLeft READ batterySecondsLeft NOTIFY batterySecondsLeftChanged) + Q_PROPERTY( float batteryCharge READ batteryCharge NOTIFY batteryChanged) + Q_PROPERTY( bool batteryCharging READ batteryCharging NOTIFY batteryChanged) + Q_PROPERTY( QString batteryRemaining READ batteryRemaining NOTIFY batteryChanged) + Q_PROPERTY( QString batteryIcon READ batteryIcon NOTIFY batteryChanged) //Volume Q_PROPERTY( int volume READ volume WRITE setVolume NOTIFY volumeChanged) //Network @@ -76,7 +77,8 @@ public: Q_INVOKABLE bool batteryAvailable(); Q_INVOKABLE float batteryCharge(); Q_INVOKABLE bool batteryCharging(); - Q_INVOKABLE double batterySecondsLeft(); + Q_INVOKABLE QString batteryRemaining(); + Q_INVOKABLE QString batteryIcon(); // = Volume = Q_INVOKABLE bool volumeSupported(); @@ -86,8 +88,8 @@ public: // = Network Information = Q_INVOKABLE bool networkAvailable(); Q_INVOKABLE QString networkType(); //"wifi", "wired", "cell", "cell-2G", "cell-3G", "cell-4G" - Q_INVOKABLE QString networkTypeFromDeviceName(QString name); //wifi, wired, cell, cell-2G, cell-3G, cell-4G Q_INVOKABLE float networkStrength(); //percentage. ("wired" type should always be 100%) + Q_INVOKABLE QString networkIcon(); Q_INVOKABLE QString networkHostname(); Q_INVOKABLE QHostAddress networkAddress(); @@ -149,7 +151,56 @@ public: Q_INVOKABLE QString appStoreShortcut(); //relative *.desktop shortcut name (Example: "some_utility.desktop") - // QML-Accessible properties/functions + // = DIRECT OS INTERACTIONS = (properties above are cached/gated) + // = Battery = + bool OS_batteryAvailable(); + float OS_batteryCharge(); + bool OS_batteryCharging(); + double OS_batterySecondsLeft(); + // = Volume = + bool OS_volumeSupported(); + int OS_volume(); + void OS_setVolume(int); + // = Network Information = + QString OS_networkTypeFromDeviceName(QString name); + float OS_networkStrengthFromDeviceName(QString name); + // = Media Shortcuts = + QStringList OS_mediaDirectories(); + // = Updates = + bool OS_updatesSupported(); + bool OS_updatesAvailable(); + QString OS_updateDetails(); + bool OS_updatesRunning(); + QString OS_updateLog(); + bool OS_updatesFinished(); + QString OS_updateResults(); + void OS_startUpdates(); + bool OS_updateOnlyOnReboot(); + bool OS_updateCausesReboot(); + QDateTime OS_lastUpdate(); + QString OS_lastUpdateResults(); + // = System Power = + bool OS_canReboot(); + void OS_startReboot(); + bool OS_canShutdown(); + void OS_startShutdown(); + bool OS_canSuspend(); + void OS_startSuspend(); + // = Screen Brightness = + bool OS_brightnessSupported(); + int OS_brightness(); + void OS_setBrightness(int); + // = System Status Monitoring + bool OS_cpuSupported(); + QList<int> OS_cpuPercentage(); + QStringList OS_cpuTemperatures(); + bool OS_memorySupported(); + int OS_memoryUsedPercentage(); + QString OS_memoryTotal(); + QStringList OS_diskIO(); + bool OS_diskSupported(); + int OS_fileSystemPercentage(QString dir); + QString OS_fileSystemCapacity(QString dir); private slots: // ================ @@ -176,9 +227,7 @@ private slots: void DiskTimerUpdate(); signals: - void batteryChargeChanged(); - void batteryChargingChanged(); - void batterySecondsLeftChanged(); + void batteryChanged(); void volumeChanged(); void networkStatusChanged(); void mediaShortcutsChanged(); @@ -186,6 +235,10 @@ signals: void powerAvailableChanged(); void brightnessChanged(); + //Internal alert signals + void BatteryFullAlert(); + void BatteryEmptyAlert(); + private: //Internal persistant data storage, OS-specific usage implementation QHash< QString, QVariant> INFO; |