tderootsystemdevice.h
00001 /* This file is part of the TDE libraries 00002 Copyright (C) 2012 Timothy Pearson <kb9vqf@pearsoncomputing.net> 00003 (C) 2013 Golubev Alexander <fatzer2@gmail.com> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 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 HybridSuspend, 00046 Disk // Used temporarily to detect hibernation and hybrid suspend capability 00047 }; 00048 }; 00049 00050 namespace TDESystemHibernationMethod { 00051 enum TDESystemHibernationMethod { 00052 Unsupported, 00053 Platform, 00054 Shutdown, 00055 Reboot, 00056 TestProc, 00057 Test, 00058 Suspend 00059 }; 00060 }; 00061 00062 typedef TQValueList<TDESystemPowerState::TDESystemPowerState> TDESystemPowerStateList; 00063 typedef TQValueList<TDESystemHibernationMethod::TDESystemHibernationMethod> TDESystemHibernationMethodList; 00064 00065 class TDECORE_EXPORT TDERootSystemDevice : public TDEGenericDevice 00066 { 00067 public: 00072 TDERootSystemDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null); 00073 00077 ~TDERootSystemDevice(); 00078 00082 TDESystemFormFactor::TDESystemFormFactor formFactor(); 00083 00087 TDESystemPowerStateList powerStates(); 00088 00092 TDESystemHibernationMethodList hibernationMethods(); 00093 00097 TDESystemHibernationMethod::TDESystemHibernationMethod hibernationMethod(); 00098 00102 unsigned long diskSpaceNeededForHibernation(); 00103 00107 bool canSetHibernationMethod(); 00108 00112 bool canStandby(); 00113 00117 bool canFreeze(); 00118 00122 bool canSuspend(); 00123 00127 bool canHibernate(); 00128 00132 bool canHybridSuspend(); 00133 00137 bool canPowerOff(); 00138 00142 bool canReboot(); 00143 00147 void setHibernationMethod(TDESystemHibernationMethod::TDESystemHibernationMethod hm); 00148 00153 bool setPowerState(TDESystemPowerState::TDESystemPowerState ps); 00154 00155 protected: 00160 void internalSetFormFactor(TDESystemFormFactor::TDESystemFormFactor ff); 00161 00166 void internalSetPowerStates(TDESystemPowerStateList ps); 00167 00172 void internalSetHibernationMethods(TDESystemHibernationMethodList hm); 00173 00178 void internalSetHibernationMethod(TDESystemHibernationMethod::TDESystemHibernationMethod hm); 00179 00184 void internalSetDiskSpaceNeededForHibernation(unsigned long sz); 00185 00186 private: 00187 TDESystemFormFactor::TDESystemFormFactor m_formFactor; 00188 TDESystemPowerStateList m_powerStates; 00189 TDESystemHibernationMethodList m_hibernationMethods; 00190 TDESystemHibernationMethod::TDESystemHibernationMethod m_hibernationMethod; 00191 unsigned long m_hibernationSpace; 00192 00193 friend class TDEHardwareDevices; 00194 }; 00195 00196 #endif // _TDEROOTSYSTEMDEVICE_H
Trinity API Reference