summaryrefslogtreecommitdiff
path: root/libopie/odevice.cpp
Side-by-side diff
Diffstat (limited to 'libopie/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp108
1 files changed, 102 insertions, 6 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 9b2a954..8f954b1 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -54,5 +54,5 @@ using namespace Opie;
class ODeviceData {
public:
- bool m_qwsserver;
+ bool m_qwsserver : 1;
QString m_vendorstr;
@@ -271,4 +271,7 @@ void ODevice::init ( )
}
+/**
+ * This method initialises the button mapping
+ */
void ODevice::initButtons ( )
{
@@ -314,5 +317,15 @@ bool ODevice::setSoftSuspend ( bool /*soft*/ )
#define APM_IOC_SUSPEND OD_IO( 'A', 2 )
-
+/**
+ * This method will try to suspend the device
+ * It only works if the user is the QWS Server and the apm application
+ * is installed.
+ * It tries to suspend and then waits some time cause some distributions
+ * do have asynchronus apm implementations.
+ * This method will either fail and return false or it'll suspend the
+ * device and return once the device got woken up
+ *
+ * @return if the device got suspended
+ */
bool ODevice::suspend ( )
{
@@ -355,5 +368,7 @@ bool ODevice::suspend ( )
#define VESA_POWERDOWN 3
-
+/**
+ * This sets the display on or off
+ */
bool ODevice::setDisplayStatus ( bool on )
{
@@ -371,6 +386,11 @@ bool ODevice::setDisplayStatus ( bool on )
}
-bool ODevice::setDisplayBrightness ( int )
+/**
+ * This sets the display brightness
+ * @return success or failure
+ */
+bool ODevice::setDisplayBrightness ( int p)
{
+ Q_UNUSED( p )
return false;
}
@@ -381,4 +401,8 @@ int ODevice::displayBrightnessResolution ( ) const
}
+/**
+ * This returns the vendor as string
+ * @return Vendor as QString
+ */
QString ODevice::vendorString ( ) const
{
@@ -386,4 +410,8 @@ QString ODevice::vendorString ( ) const
}
+/**
+ * This returns the vendor as one of the values of OVendor
+ * @return OVendor
+ */
OVendor ODevice::vendor ( ) const
{
@@ -391,4 +419,8 @@ OVendor ODevice::vendor ( ) const
}
+/**
+ * This returns the model as a string
+ * @return A string representing the model
+ */
QString ODevice::modelString ( ) const
{
@@ -396,4 +428,7 @@ QString ODevice::modelString ( ) const
}
+/**
+ * This does return the OModel used
+ */
OModel ODevice::model ( ) const
{
@@ -401,4 +436,7 @@ OModel ODevice::model ( ) const
}
+/**
+ * This does return the systen name
+ */
QString ODevice::systemString ( ) const
{
@@ -406,4 +444,7 @@ QString ODevice::systemString ( ) const
}
+/**
+ * Return System as OSystem value
+ */
OSystem ODevice::system ( ) const
{
@@ -411,4 +452,7 @@ OSystem ODevice::system ( ) const
}
+/**
+ * @return the version string of the base system
+ */
QString ODevice::systemVersionString ( ) const
{
@@ -416,4 +460,7 @@ QString ODevice::systemVersionString ( ) const
}
+/**
+ * @return the current Transformation
+ */
Transformation ODevice::rotation ( ) const
{
@@ -421,4 +468,7 @@ Transformation ODevice::rotation ( ) const
}
+/**
+ * This plays an alarmSound
+ */
void ODevice::alarmSound ( )
{
@@ -431,4 +481,7 @@ void ODevice::alarmSound ( )
}
+/**
+ * This plays a key sound
+ */
void ODevice::keySound ( )
{
@@ -441,4 +494,7 @@ void ODevice::keySound ( )
}
+/**
+ * This plays a touch sound
+ */
void ODevice::touchSound ( )
{
@@ -452,5 +508,9 @@ void ODevice::touchSound ( )
}
-
+/**
+ * This method will return a list of leds
+ * available on this device
+ * @return a list of LEDs.
+ */
QValueList <OLed> ODevice::ledList ( ) const
{
@@ -458,4 +518,7 @@ QValueList <OLed> ODevice::ledList ( ) const
}
+/**
+ * This does return the state of the LEDs
+ */
QValueList <OLedState> ODevice::ledStateList ( OLed /*which*/ ) const
{
@@ -463,4 +526,7 @@ QValueList <OLedState> ODevice::ledStateList ( OLed /*which*/ ) const
}
+/**
+ * @return the state for a given OLed
+ */
OLedState ODevice::ledState ( OLed /*which*/ ) const
{
@@ -468,9 +534,20 @@ OLedState ODevice::ledState ( OLed /*which*/ ) const
}
-bool ODevice::setLedState ( OLed /*which*/, OLedState /*st*/ )
+/**
+ * Set the state for a LED
+ * @param which Which OLed to use
+ * @param st The state to set
+ * @return success or failure
+ */
+bool ODevice::setLedState ( OLed which, OLedState st )
{
+ Q_UNUSED( which )
+ Q_UNUSED( st )
return false;
}
+/**
+ * @return if the device has a light sensor
+ */
bool ODevice::hasLightSensor ( ) const
{
@@ -478,4 +555,7 @@ bool ODevice::hasLightSensor ( ) const
}
+/**
+ * @return a value from the light senso
+ */
int ODevice::readLightSensor ( )
{
@@ -483,4 +563,7 @@ int ODevice::readLightSensor ( )
}
+/**
+ * @return the light sensor resolution whatever that is ;)
+ */
int ODevice::lightSensorResolution ( ) const
{
@@ -488,4 +571,7 @@ int ODevice::lightSensorResolution ( ) const
}
+/**
+ * @return a list of hardware buttons
+ */
const QValueList <ODeviceButton> &ODevice::buttons ( )
{
@@ -495,4 +581,7 @@ const QValueList <ODeviceButton> &ODevice::buttons ( )
}
+/**
+ * @return The amount of time that would count as a hold
+ */
uint ODevice::buttonHoldTime ( ) const
{
@@ -500,4 +589,11 @@ uint ODevice::buttonHoldTime ( ) const
}
+/**
+ * This method return a ODeviceButton for a key code
+ * or 0 if no special hardware button is available for the device
+ *
+ * @return The devicebutton or 0l
+ * @see ODeviceButton
+ */
const ODeviceButton *ODevice::buttonForKeycode ( ushort code )
{