summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/tdehardwaredevices.h
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/tdehw/tdehardwaredevices.h')
-rw-r--r--tdecore/tdehw/tdehardwaredevices.h385
1 files changed, 3 insertions, 382 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.h b/tdecore/tdehw/tdehardwaredevices.h
index 710d7bd8e..200999bf1 100644
--- a/tdecore/tdehw/tdehardwaredevices.h
+++ b/tdecore/tdehw/tdehardwaredevices.h
@@ -36,6 +36,9 @@
// FIXME delete those headers after complete porting
#include "tdegenericdevice.h"
#include "tdestoragedevice.h"
+#include "tdecpudevice.h"
+#include "tdemainspowerdevice.h"
+#include "tdebatterydevice.h"
/**
* Hardware Device Access and Monitoring Library
@@ -73,388 +76,6 @@ class TDECORE_EXPORT TDESensorCluster
double critical;
};
-class TDECORE_EXPORT TDECPUDevice : public TDEGenericDevice
-{
- public:
- /**
- * Constructor.
- * @param Device type
- */
- TDECPUDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
-
- /**
- * Destructor.
- */
- ~TDECPUDevice();
-
- /**
- * @return a double with the current CPU frequency in MHz, if available
- */
- double frequency();
-
- /**
- * @return a double with the minimum CPU frequency in MHz, if available
- */
- double minFrequency();
-
- /**
- * @return a double with the maximum CPU frequency in MHz, if available
- */
- double maxFrequency();
-
- /**
- * @return a double with the transition latency in ns, if available
- */
- double transitionLatency();
-
- /**
- * @return a TQString with the current CPU governor policy, if available
- */
- TQString governor();
-
- /**
- * @return a TQString with the current CPU scaling driver, if available
- */
- TQString scalingDriver();
-
- /**
- * @return a TQStringList with the IDs of all processors that are dependent on the frequency/power settings of this one, if available
- */
- TQStringList dependentProcessors();
-
- /**
- * @return a TQStringList with all valid scaling frequencies in Hz, if available
- */
- TQStringList availableFrequencies();
-
- /**
- * @return a TQStringList with all available governor policies, if available
- */
- TQStringList availableGovernors();
-
- /**
- * @return TRUE if permissions allow the CPU governor to be set, FALSE if not
- */
- bool canSetGovernor();
-
- /**
- * @param gv a TQString with the new CPU governor policy name
- */
- void setGovernor(TQString gv);
-
- /**
- * @return TRUE if permissions allow the CPU maximum frequency to be set, FALSE if not
- */
- bool canSetMaximumScalingFrequency();
-
- /**
- * @param gv a double with the new CPU maximum frequency in MHz
- */
- void setMaximumScalingFrequency(double fr);
-
- /**
- * @return an integer with the core number, starting at 0
- */
- int coreNumber();
-
- protected:
- /**
- * @param fr a double with the current CPU frequency in MHz, if available
- * @internal
- */
- void internalSetFrequency(double fr);
-
- /**
- * @param fr a double with the minimum CPU frequency in MHz, if available
- * @internal
- */
- void internalSetMinFrequency(double fr);
-
- /**
- * @param fr a double with the maximum CPU frequency in MHz, if available
- * @internal
- */
- void internalSetMaxFrequency(double fr);
-
- /**
- * @param tl a double with the transition latency in ns, if available
- * @internal
- */
- void internalSetTransitionLatency(double tl);
-
- /**
- * @param gr a TQString with the current CPU governor policy, if available
- * @internal
- */
- void internalSetGovernor(TQString gr);
-
- /**
- * @param dr a TQString with the current CPU scaling driver, if available
- * @internal
- */
- void internalSetScalingDriver(TQString dr);
-
- /**
- * @param dp a TQStringList with the IDs of all processors that are dependent on the frequency/power settings of this one, if available
- * @internal
- */
- void internalSetDependentProcessors(TQStringList dp);
-
- /**
- * @param af a TQStringList with all valid scaling frequencies in Hz, if available
- * @internal
- */
- void internalSetAvailableFrequencies(TQStringList af);
-
- /**
- * @param gp a TQStringList with all available governor policies, if available
- * @internal
- */
- void internalSetAvailableGovernors(TQStringList gp);
-
- /**
- * @param cn an integer with the core number, starting at 0
- * @internal
- */
- void internalSetCoreNumber(int cn);
-
- private:
- double m_frequency;
- double m_minfrequency;
- double m_maxfrequency;
- double m_transitionlatency;
- TQString m_governor;
- TQString m_scalingdriver;
- TQStringList m_tiedprocs;
- TQStringList m_frequencies;
- TQStringList m_governers;
- int m_corenumber;
-
- friend class TDEHardwareDevices;
-};
-
-namespace TDEBatteryStatus {
-enum TDEBatteryStatus {
- Charging,
- Discharging,
- Full,
- Unknown = 0x80000000
-};
-};
-
-class TDECORE_EXPORT TDEBatteryDevice : public TDEGenericDevice
-{
- public:
- /**
- * Constructor.
- * @param Device type
- */
- TDEBatteryDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
-
- /**
- * Destructor.
- */
- ~TDEBatteryDevice();
-
- /**
- * @return a double with the current battery voltage, if available
- */
- double voltage();
-
- /**
- * @return a double with the minimum battery voltage, if available
- */
- double minimumVoltage();
-
- /**
- * @return a double with the maximum battery voltage, if available
- */
- double maximumVoltage();
-
- /**
- * @return a double with the designed maximum battery voltage, if available
- */
- double maximumDesignVoltage();
-
- /**
- * @return a double with the current battery energy in watt-hours, if available
- */
- double energy();
-
- /**
- * @return a double with the current battery alarm energy in watt-hours, if available
- */
- double alarmEnergy();
-
- /**
- * @return a double with the maximum battery energy in watt-hours, if available
- */
- double maximumEnergy();
-
- /**
- * @return a double with the designed maximum battery energy in watt-hours, if available
- */
- double maximumDesignEnergy();
-
- /**
- * @return a double with the current battery discharge rate in watt-hours, if available
- */
- double dischargeRate();
-
- /**
- * @return a double with the current battery discharge time remaining in seconds, if available
- */
- double timeRemaining();
-
- /**
- * @return a TQString with the battery technology, if available
- */
- TQString technology();
-
- /**
- * @return a TDEBatteryStatus::TDEBatteryStatus with the current battery status
- */
- TDEBatteryStatus::TDEBatteryStatus status();
-
- /**
- * @return TRUE if the battery is installed
- */
- bool installed();
-
- /**
- * @return a double with the current battery charge in percent, if available
- */
- double chargePercent();
-
- protected:
- /**
- * @param a double with the current battery voltage, if available
- * @internal
- */
- void internalSetVoltage(double vt);
-
- /**
- * @param a double with the minimum battery voltage, if available
- * @internal
- */
- void internalSetMinimumVoltage(double vt);
-
- /**
- * @param a double with the maximum battery voltage, if available
- * @internal
- */
- void internalSetMaximumVoltage(double vt);
-
- /**
- * @param a double with the designed maximum battery voltage, if available
- * @internal
- */
- void internalSetMaximumDesignVoltage(double vt);
-
- /**
- * @param a double with the current battery energy in watt-hours, if available
- * @internal
- */
- void internalSetEnergy(double vt);
-
- /**
- * @param a double with the current battery alarm energy in watt-hours, if available
- * @internal
- */
- void internalSetAlarmEnergy(double vt);
-
- /**
- * @param a double with the maximum battery energy in watt-hours, if available
- * @internal
- */
- void internalSetMaximumEnergy(double vt);
-
- /**
- * @param a double with the designed maximum battery energy in watt-hours, if available
- * @internal
- */
- void internalSetMaximumDesignEnergy(double vt);
-
- /**
- * @param a double with the current battery discharge rate in volt-hours, if available
- * @internal
- */
- void internalSetDischargeRate(double vt);
-
- /**
- * @param a double with the current battery discharge time remaining in seconds, if available
- * @internal
- */
- void internalSetTimeRemaining(double tr);
-
- /**
- * @param a TQString with the battery technology, if available
- * @internal
- */
- void internalSetTechnology(TQString tc);
-
- /**
- * @param a TQString with the battery status, if available
- * @internal
- */
- void internalSetStatus(TQString tc);
-
- /**
- * @param TRUE if the battery is installed
- * @internal
- */
- void internalSetInstalled(bool tc);
-
- private:
- double m_currentVoltage;
- double m_minimumVoltage;
- double m_maximumVoltage;
- double m_maximumDesignVoltage;
- double m_alarmEnergy;
- double m_currentEnergy;
- double m_maximumEnergy;
- double m_maximumDesignEnergy;
- double m_dischargeRate;
- double m_timeRemaining;
- TQString m_technology;
- TDEBatteryStatus::TDEBatteryStatus m_status;
- bool m_installed;
-
- friend class TDEHardwareDevices;
-};
-
-class TDECORE_EXPORT TDEMainsPowerDevice : public TDEGenericDevice
-{
- public:
- /**
- * Constructor.
- * @param Device type
- */
- TDEMainsPowerDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
-
- /**
- * Destructor.
- */
- ~TDEMainsPowerDevice();
-
- /**
- * @return TRUE if power supply is online via mains power, FALSE if not
- */
- bool online();
-
- protected:
- /**
- * @param TRUE if power supply is online via mains power, FALSE if not
- * @internal
- */
- void internalSetOnline(bool vt);
-
- private:
- bool m_online;
-
- friend class TDEHardwareDevices;
-};
-
class TDECORE_EXPORT TDENetworkDevice : public TDEGenericDevice
{
public: