libopie API Documentation

Opie::ODevice Class Reference

A singleton which gives informations about device specefic option like the Hardware used, LEDs, the Base Distribution and hardware key mappings. A small class for device specefic options. More...

#include <odevice.h>

Inheritance diagram for Opie::ODevice:

Inheritance graph
[legend]
Collaboration diagram for Opie::ODevice:

Collaboration graph
[legend]
List of all members.

Signals

void buttonMappingChanged ()

Public Member Functions

QString modelString () const
 This returns the model as a string.

OModel model () const
 This does return the OModel used.

OModel series () const
QString vendorString () const
 This returns the vendor as string.

OVendor vendor () const
 This returns the vendor as one of the values of OVendor.

QString systemString () const
 This does return the systen name.

OSystem system () const
 Return System as OSystem value.

QString systemVersionString () const
virtual Transformation rotation () const
virtual ODirection direction () const
virtual bool setSoftSuspend (bool on)
virtual bool suspend ()
 This method will try to suspend the device It only works if the user is the QWS Server and the apm application is installed.

virtual bool setDisplayStatus (bool on)
 This sets the display on or off.

virtual bool setDisplayBrightness (int brightness)
 This sets the display brightness.

virtual int displayBrightnessResolution () const
virtual bool setDisplayContrast (int contrast)
 This sets the display contrast.

virtual int displayContrastResolution () const
virtual void alarmSound ()
 This plays an alarmSound.

virtual void keySound ()
 This plays a key sound.

virtual void touchSound ()
 This plays a touch sound.

virtual QValueList< OLed > ledList () const
 This method will return a list of leds available on this device.

virtual QValueList< OLedState > ledStateList (OLed led) const
 This does return the state of the LEDs.

virtual OLedState ledState (OLed led) const
virtual bool setLedState (OLed led, OLedState st)
 Set the state for a LED.

virtual bool hasLightSensor () const
virtual int readLightSensor ()
virtual int lightSensorResolution () const
virtual bool hasHingeSensor () const
virtual OHingeStatus readHingeSensor ()
const QStrListallowedCpuFrequencies () const
bool setCurrentCpuFrequency (uint index)
 Set desired CPU frequency.

const QValueList< ODeviceButton > & buttons ()
 /todo ### make const

const ODeviceButtonbuttonForKeycode (ushort keyCode)
 Returns the DeviceButton for the keyCode.

void remapPressedAction (int button, const OQCopMessage &qcopMessage)
 Reassigns the pressed action for button.

void remapHeldAction (int button, const OQCopMessage &qcopMessage)
 Reassigns the held action for button.

uint buttonHoldTime () const
 How long (in ms) you have to press a button for a "hold" action.


Static Public Member Functions

ODeviceinst ()

Protected Member Functions

virtual void init ()
virtual void initButtons ()
 This method initialises the button mapping.

void reloadButtonMapping ()
virtual void virtual_hook (int id, void *data)

Protected Attributes

ODeviceData * d

Detailed Description

A singleton which gives informations about device specefic option like the Hardware used, LEDs, the Base Distribution and hardware key mappings. A small class for device specefic options.

See also:
QObject
Author:
Robert Griebl
Version:
1.0

Definition at line 163 of file odevice.h.


Member Function Documentation

void ODevice::initButtons  )  [protected, virtual]
 

This method initialises the button mapping.

Definition at line 508 of file odevice.cpp.

References QObject::connect(), and model().

Referenced by buttonForKeycode(), buttons(), remapHeldAction(), and remapPressedAction().

QString ODevice::modelString  )  const
 

This returns the model as a string.

Returns:
A string representing the model

Definition at line 689 of file odevice.cpp.

OModel ODevice::model  )  const
 

This does return the OModel used.

Definition at line 697 of file odevice.cpp.

Referenced by initButtons().

QString ODevice::vendorString  )  const
 

This returns the vendor as string.

Returns:
Vendor as QString

Definition at line 671 of file odevice.cpp.

OVendor ODevice::vendor  )  const
 

This returns the vendor as one of the values of OVendor.

Returns:
OVendor

Definition at line 680 of file odevice.cpp.

QString ODevice::systemString  )  const
 

This does return the systen name.

Definition at line 705 of file odevice.cpp.

OSystem ODevice::system  )  const
 

Return System as OSystem value.

Definition at line 713 of file odevice.cpp.

QString ODevice::systemVersionString  )  const
 

Returns:
the version string of the base system

Definition at line 721 of file odevice.cpp.

Transformation ODevice::rotation  )  const [virtual]
 

Returns:
the current Transformation

Definition at line 729 of file odevice.cpp.

ODirection ODevice::direction  )  const [virtual]
 

Returns:
the current rotation direction

Definition at line 737 of file odevice.cpp.

bool ODevice::suspend  )  [virtual]
 

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

Returns:
if the device got suspended

Definition at line 565 of file odevice.cpp.

bool ODevice::setDisplayStatus bool  on  )  [virtual]
 

This sets the display on or off.

Definition at line 609 of file odevice.cpp.

bool ODevice::setDisplayBrightness int  p  )  [virtual]
 

This sets the display brightness.

Parameters:
p The brightness to be set on a scale from 0 to 255
Returns:
success or failure

Definition at line 632 of file odevice.cpp.

int ODevice::displayBrightnessResolution  )  const [virtual]
 

Returns:
returns the number of steppings on the brightness slider in the Light-'n-Power settings.

Definition at line 642 of file odevice.cpp.

bool ODevice::setDisplayContrast int  p  )  [virtual]
 

This sets the display contrast.

Parameters:
p The contrast to be set on a scale from 0 to 255
Returns:
success or failure

Definition at line 652 of file odevice.cpp.

int ODevice::displayContrastResolution  )  const [virtual]
 

Returns:
return the max value for the brightness settings slider or 0 if the device doesn't support setting of a contrast

Definition at line 662 of file odevice.cpp.

void ODevice::alarmSound  )  [virtual]
 

This plays an alarmSound.

Definition at line 745 of file odevice.cpp.

void ODevice::keySound  )  [virtual]
 

This plays a key sound.

Definition at line 758 of file odevice.cpp.

void ODevice::touchSound  )  [virtual]
 

This plays a touch sound.

Definition at line 771 of file odevice.cpp.

QValueList< OLed > ODevice::ledList  )  const [virtual]
 

This method will return a list of leds available on this device.

Returns:
a list of LEDs.

Definition at line 786 of file odevice.cpp.

QValueList< OLedState > ODevice::ledStateList OLed  led  )  const [virtual]
 

This does return the state of the LEDs.

Definition at line 794 of file odevice.cpp.

OLedState ODevice::ledState OLed  led  )  const [virtual]
 

Returns:
the state for a given OLed

Definition at line 802 of file odevice.cpp.

bool ODevice::setLedState OLed  which,
OLedState  st
[virtual]
 

Set the state for a LED.

Parameters:
which Which OLed to use
st The state to set
Returns:
success or failure

Definition at line 813 of file odevice.cpp.

bool ODevice::hasLightSensor  )  const [virtual]
 

Returns:
if the device has a light sensor

Definition at line 823 of file odevice.cpp.

int ODevice::readLightSensor  )  [virtual]
 

Returns:
a value from the light sensor

Definition at line 831 of file odevice.cpp.

int ODevice::lightSensorResolution  )  const [virtual]
 

Returns:
the light sensor resolution

Definition at line 839 of file odevice.cpp.

bool ODevice::hasHingeSensor  )  const [virtual]
 

Returns:
if the device has a hinge sensor

Definition at line 847 of file odevice.cpp.

OHingeStatus ODevice::readHingeSensor  )  [virtual]
 

Returns:
a value from the hinge sensor

Definition at line 855 of file odevice.cpp.

const QStrList & ODevice::allowedCpuFrequencies  )  const
 

Returns:
a list with CPU frequencies supported by the hardware

Definition at line 863 of file odevice.cpp.

bool ODevice::setCurrentCpuFrequency uint  index  ) 
 

Set desired CPU frequency.

Parameters:
index index into d->m_cpu_frequencies of the frequency to be set

Definition at line 874 of file odevice.cpp.

const QValueList< ODeviceButton > & ODevice::buttons  ) 
 

/todo ### make const

Returns:
a list of hardware buttons

Definition at line 899 of file odevice.cpp.

References initButtons().

const ODeviceButton * ODevice::buttonForKeycode ushort  keyCode  ) 
 

Returns the DeviceButton for the keyCode.

If keyCode is not found, it returns 0L

Definition at line 921 of file odevice.cpp.

References initButtons().

void ODevice::remapPressedAction int  button,
const OQCopMessage &  qcopMessage
 

Reassigns the pressed action for button.

To return to the factory default pass an empty string as qcopMessage.

Definition at line 963 of file odevice.cpp.

References initButtons().

void ODevice::remapHeldAction int  button,
const OQCopMessage &  qcopMessage
 

Reassigns the held action for button.

To return to the factory default pass an empty string as qcopMessage.

Definition at line 987 of file odevice.cpp.

References initButtons().

uint ODevice::buttonHoldTime  )  const
 

How long (in ms) you have to press a button for a "hold" action.

Returns:
The amount of time that would count as a hold

Definition at line 909 of file odevice.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:25:07 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001