00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _TDEROOTSYSTEMDEVICE_H
00021 #define _TDEROOTSYSTEMDEVICE_H
00022
00023 #include "tdegenericdevice.h"
00024 #include "tdehwcommontypes.h"
00025
00026 namespace TDESystemFormFactor {
00027 enum TDESystemFormFactor {
00028 Unclassified,
00029 Desktop,
00030 Laptop,
00031 Server,
00032 Other = 0x80000000
00033 };
00034 };
00035
00036 namespace TDESystemPowerState {
00037 enum TDESystemPowerState {
00038 Active,
00039 Standby,
00040 Freeze,
00041 Suspend,
00042 Hibernate,
00043 PowerOff,
00044 Reboot
00045 };
00046 };
00047
00048 namespace TDESystemHibernationMethod {
00049 enum TDESystemHibernationMethod {
00050 Unsupported,
00051 Platform,
00052 Shutdown,
00053 Reboot,
00054 TestProc,
00055 Test
00056 };
00057 };
00058
00059 typedef TQValueList<TDESystemPowerState::TDESystemPowerState> TDESystemPowerStateList;
00060 typedef TQValueList<TDESystemHibernationMethod::TDESystemHibernationMethod> TDESystemHibernationMethodList;
00061
00062 class TDECORE_EXPORT TDERootSystemDevice : public TDEGenericDevice
00063 {
00064 public:
00069 TDERootSystemDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
00070
00074 ~TDERootSystemDevice();
00075
00079 TDESystemFormFactor::TDESystemFormFactor formFactor();
00080
00084 TDESystemPowerStateList powerStates();
00085
00089 TDESystemHibernationMethodList hibernationMethods();
00090
00094 TDESystemHibernationMethod::TDESystemHibernationMethod hibernationMethod();
00095
00099 unsigned long diskSpaceNeededForHibernation();
00100
00104 bool canSetHibernationMethod();
00105
00109 bool canStandby();
00110
00114 bool canFreeze();
00115
00119 bool canSuspend();
00120
00124 bool canHibernate();
00125
00129 bool canPowerOff();
00130
00134 bool canReboot();
00135
00139 void setHibernationMethod(TDESystemHibernationMethod::TDESystemHibernationMethod hm);
00140
00145 bool setPowerState(TDESystemPowerState::TDESystemPowerState ps);
00146
00147 protected:
00152 void internalSetFormFactor(TDESystemFormFactor::TDESystemFormFactor ff);
00153
00158 void internalSetPowerStates(TDESystemPowerStateList ps);
00159
00164 void internalSetHibernationMethods(TDESystemHibernationMethodList hm);
00165
00170 void internalSetHibernationMethod(TDESystemHibernationMethod::TDESystemHibernationMethod hm);
00171
00176 void internalSetDiskSpaceNeededForHibernation(unsigned long sz);
00177
00178 private:
00179 TDESystemFormFactor::TDESystemFormFactor m_formFactor;
00180 TDESystemPowerStateList m_powerStates;
00181 TDESystemHibernationMethodList m_hibernationMethods;
00182 TDESystemHibernationMethod::TDESystemHibernationMethod m_hibernationMethod;
00183 unsigned long m_hibernationSpace;
00184
00185 friend class TDEHardwareDevices;
00186 };
00187
00188 #endif // _TDEROOTSYSTEMDEVICE_H