Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opie::ODevice Class Reference

A small class for device specefic options. More...

#include </home/clem/local/src/opie/noncore/unsupported/libopie/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

virtual ~ODevice ()
QString modelString () const
OModel model () const
OModel series () const
QString vendorString () const
OVendor vendor () const
QString systemString () const
OSystem system () const
QString systemVersionString () const
Transformation rotation () const
ODirection direction () const
virtual bool setSoftSuspend (bool on)
virtual bool suspend ()
virtual bool setDisplayStatus (bool on)
virtual bool setDisplayBrightness (int brightness)
virtual int displayBrightnessResolution () const
virtual bool setDisplayContrast (int contrast)
virtual int displayContrastResolution () const
virtual void alarmSound ()
virtual void keySound ()
virtual void touchSound ()
virtual QValueList< OLedledList () const
virtual QValueList< OLedStateledStateList (OLed led) const
virtual OLedState ledState (OLed led) const
virtual bool setLedState (OLed led, OLedState st)
virtual bool hasLightSensor () const
virtual int readLightSensor ()
virtual int lightSensorResolution () const
bool hasHingeSensor () const
OHingeStatus readHingeSensor ()
const QStrListallowedCpuFrequencies () const
bool setCurrentCpuFrequency (uint index)
const QValueList< ODeviceButton > & buttons ()
const ODeviceButtonbuttonForKeycode (ushort keyCode)
void remapPressedAction (int button, const OQCopMessage &qcopMessage)
void remapHeldAction (int button, const OQCopMessage &qcopMessage)
uint buttonHoldTime () const

Static Public Member Functions

static ODeviceinst ()

Protected Types

enum  { VIRTUAL_ROTATION = 0x200, VIRTUAL_DIRECTION, VIRTUAL_HAS_HINGE, VIRTUAL_HINGE }

Protected Member Functions

 ODevice ()
virtual void init ()
virtual void initButtons ()
void reloadButtonMapping ()
virtual void virtual_hook (int id, void *data)

Protected Attributes

ODeviceDatad

Private Slots

void systemMessage (const QCString &, const QByteArray &)

Private Member Functions

 ODevice (const ODevice &)

Classes

struct  VirtDirection
struct  VirtHasHinge
struct  VirtHingeStatus
struct  VirtRotation

Detailed Description

A small class for device specefic options.

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

See also:
QObject
Author:
Robert Griebl
Version:
1.0

Definition at line 163 of file odevice.h.


Member Enumeration Documentation

anonymous enum [protected]
 

Enumeration values:
VIRTUAL_ROTATION 
VIRTUAL_DIRECTION 
VIRTUAL_HAS_HINGE 
VIRTUAL_HINGE 

Definition at line 283 of file odevice.h.


Constructor & Destructor Documentation

Opie::ODevice::ODevice const ODevice  )  [private]
 

ODevice::ODevice  )  [protected]
 

Definition at line 454 of file odevice.cpp.

References Opie::CW, d, Opie::Model_Unknown, Rot0, Opie::System_Unknown, and Opie::Vendor_Unknown.

Referenced by inst().

ODevice::~ODevice  )  [virtual]
 

Definition at line 516 of file odevice.cpp.

References d.


Member Function Documentation

void ODevice::alarmSound  )  [virtual]
 

This plays an alarmSound

Reimplemented in iPAQ, Zaurus, and SIMpad.

Definition at line 734 of file odevice.cpp.

References snd.

Referenced by BenD::slotIMAPStatus().

const QStrList & ODevice::allowedCpuFrequencies  )  const
 

Returns:
a list with CPU frequencies supported by the hardware

Definition at line 857 of file odevice.cpp.

References d, and ODeviceData::m_cpu_frequencies.

const ODeviceButton * ODevice::buttonForKeycode ushort  keyCode  ) 
 

Returns the DeviceButton for the keyCode. If keyCode is not found, it returns 0L

Definition at line 915 of file odevice.cpp.

References begin, d, end, initButtons(), and keycode.

uint ODevice::buttonHoldTime  )  const
 

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

Definition at line 903 of file odevice.cpp.

References d.

void Opie::ODevice::buttonMappingChanged  )  [signal]
 

const QValueList< ODeviceButton > & ODevice::buttons  ) 
 

/todo ### make const

Definition at line 893 of file odevice.cpp.

References d, and initButtons().

ODirection ODevice::direction  )  const
 

Returns:
the current rotation direction

Reimplemented in Zaurus.

Definition at line 723 of file odevice.cpp.

References Opie::ODevice::VirtDirection::direct, VIRTUAL_DIRECTION, and virtual_hook().

int ODevice::displayBrightnessResolution  )  const [virtual]
 

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

Reimplemented in iPAQ, Jornada, Zaurus, SIMpad, Ramses, and Yopy.

Definition at line 625 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

Reimplemented in Ramses.

Definition at line 645 of file odevice.cpp.

bool ODevice::hasHingeSensor  )  const
 

Returns:
if the device has a hinge sensor

Reimplemented in Zaurus.

Definition at line 836 of file odevice.cpp.

References Opie::ODevice::VirtHasHinge::hasHinge, VIRTUAL_HAS_HINGE, and virtual_hook().

bool ODevice::hasLightSensor  )  const [virtual]
 

Returns:
if the device has a light sensor

Reimplemented in iPAQ.

Definition at line 812 of file odevice.cpp.

void ODevice::init  )  [protected, virtual]
 

Reimplemented in iPAQ, Jornada, Zaurus, SIMpad, Ramses, and Yopy.

Definition at line 480 of file odevice.cpp.

Referenced by inst().

void ODevice::initButtons  )  [protected, virtual]
 

This method initialises the button mapping

Reimplemented in iPAQ, Zaurus, SIMpad, and Yopy.

Definition at line 487 of file odevice.cpp.

References code, d, fheldaction, fheldservice, fpressedaction, fpressedservice, i, ipaq_buttons, Resource::loadPixmap(), Opie::Core::makeChannel(), model(), Opie::Model_iPAQ_H36xx, pix, qDebug(), reloadButtonMapping(), systemMessage(), tr, and utext.

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

ODevice * ODevice::inst  )  [static]
 

Definition at line 422 of file odevice.cpp.

References QFile::exists(), init(), Jornada::isJornada(), Yopy::isYopy(), Zaurus::isZaurus(), and ODevice().

Referenced by UserDialog::addUser(), BackupAndRestore::backupRootFs(), OQWSServer::eventFilter(), WellenreiterConfigWindow::performAction(), BenD::slotClicked(), BenD::slotIMAPStatus(), VolumeControl::VolumeControl(), and Wellenreiter::Wellenreiter().

void ODevice::keySound  )  [virtual]
 

This plays a key sound

Reimplemented in Zaurus.

Definition at line 747 of file odevice.cpp.

References snd.

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

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

Returns:
a list of LEDs.

Reimplemented in iPAQ, Zaurus, and SIMpad.

Definition at line 775 of file odevice.cpp.

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

Returns:
the state for a given OLed

Reimplemented in iPAQ, Zaurus, and SIMpad.

Definition at line 791 of file odevice.cpp.

References Opie::Led_Off.

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

This does return the state of the LEDs

Reimplemented in iPAQ, Zaurus, and SIMpad.

Definition at line 783 of file odevice.cpp.

int ODevice::lightSensorResolution  )  const [virtual]
 

Returns:
the light sensor resolution

Reimplemented in iPAQ.

Definition at line 828 of file odevice.cpp.

OModel ODevice::model  )  const
 

This does return the OModel used

Definition at line 680 of file odevice.cpp.

References d.

Referenced by iPAQ::displayBrightnessResolution(), Zaurus::init(), SIMpad::initButtons(), iPAQ::initButtons(), initButtons(), Jornada::isJornada(), Yopy::isYopy(), Zaurus::isZaurus(), and series().

QString ODevice::modelString  )  const
 

This returns the model as a string

Returns:
A string representing the model

Definition at line 672 of file odevice.cpp.

References d.

OHingeStatus ODevice::readHingeSensor  ) 
 

Returns:
a value from the hinge sensor

Reimplemented in Zaurus.

Definition at line 847 of file odevice.cpp.

References Opie::ODevice::VirtHingeStatus::hingeStat, VIRTUAL_HINGE, and virtual_hook().

int ODevice::readLightSensor  )  [virtual]
 

Returns:
a value from the light sensor

Reimplemented in iPAQ.

Definition at line 820 of file odevice.cpp.

void ODevice::reloadButtonMapping  )  [protected]
 

Definition at line 926 of file odevice.cpp.

References d, i, initButtons(), and QString::number().

Referenced by Opie::Core::Internal::SIMpad::initButtons(), SIMpad::initButtons(), Zaurus::initButtons(), iPAQ::initButtons(), Yopy::initButtons(), initButtons(), and systemMessage().

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 981 of file odevice.cpp.

References channel, d, initButtons(), message, and QString::number().

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 957 of file odevice.cpp.

References channel, d, initButtons(), message, and QString::number().

Transformation ODevice::rotation  )  const
 

Returns:
the current Transformation

Reimplemented in Zaurus.

Definition at line 712 of file odevice.cpp.

References Opie::ODevice::VirtRotation::trans, virtual_hook(), and VIRTUAL_ROTATION.

OModel Opie::ODevice::series  )  const [inline]
 

Definition at line 187 of file odevice.h.

References model(), and Opie::Model_Series_Mask.

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 868 of file odevice.cpp.

References QPtrList< type >::at(), QPtrList< type >::count(), d, ODeviceData::m_cpu_frequencies, qWarning(), and write().

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

Reimplemented in iPAQ, Jornada, Zaurus, SIMpad, Ramses, and Yopy.

Definition at line 615 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

Reimplemented in Ramses.

Definition at line 635 of file odevice.cpp.

bool ODevice::setDisplayStatus bool  on  )  [virtual]
 

This sets the display on or off

Reimplemented in SIMpad, and Ramses.

Definition at line 588 of file odevice.cpp.

References d, FBIOBLANK, Opie::Model_Unknown, qDebug(), VESA_NO_BLANKING, and VESA_POWERDOWN.

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

Reimplemented in iPAQ, Zaurus, and SIMpad.

Definition at line 802 of file odevice.cpp.

Referenced by BenD::slotClicked(), and BenD::slotIMAPStatus().

bool ODevice::setSoftSuspend bool  on  )  [virtual]
 

Reimplemented in iPAQ, Jornada, Zaurus, SIMpad, and Ramses.

Definition at line 524 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

Reimplemented in Zaurus, SIMpad, Ramses, and Yopy.

Definition at line 544 of file odevice.cpp.

References d, Opie::Core::isQWS(), Opie::Model_Unknown, qDebug(), and system().

OSystem ODevice::system  )  const
 

Return System as OSystem value

Definition at line 696 of file odevice.cpp.

References d.

Referenced by SIMpad::setDisplayStatus(), SIMpad::suspend(), Zaurus::suspend(), and suspend().

void ODevice::systemMessage const QCString ,
const QByteArray
[private, slot]
 

Definition at line 473 of file odevice.cpp.

References reloadButtonMapping().

Referenced by SIMpad::initButtons(), Zaurus::initButtons(), iPAQ::initButtons(), Yopy::initButtons(), and initButtons().

QString ODevice::systemString  )  const
 

This does return the systen name

Definition at line 688 of file odevice.cpp.

References d.

QString ODevice::systemVersionString  )  const
 

Returns:
the version string of the base system

Definition at line 704 of file odevice.cpp.

References d.

void ODevice::touchSound  )  [virtual]
 

This plays a touch sound

Reimplemented in Zaurus.

Definition at line 760 of file odevice.cpp.

References snd.

OVendor ODevice::vendor  )  const
 

This returns the vendor as one of the values of OVendor

Returns:
OVendor

Definition at line 663 of file odevice.cpp.

References d.

QString ODevice::vendorString  )  const
 

This returns the vendor as string

Returns:
Vendor as QString

Definition at line 654 of file odevice.cpp.

References d.

void ODevice::virtual_hook int  id,
void *  data
[protected, virtual]
 

Reimplemented in Zaurus.

Definition at line 1000 of file odevice.cpp.

References Opie::CASE_UNKNOWN, d, Opie::ODevice::VirtDirection::direct, Opie::ODevice::VirtHasHinge::hasHinge, Opie::ODevice::VirtHingeStatus::hingeStat, ODeviceData::m_direction, ODeviceData::m_rotation, Opie::ODevice::VirtRotation::trans, VIRTUAL_DIRECTION, VIRTUAL_HAS_HINGE, VIRTUAL_HINGE, and VIRTUAL_ROTATION.

Referenced by direction(), hasHingeSensor(), readHingeSensor(), and rotation().


Member Data Documentation

ODeviceData* Opie::ODevice::d [protected]
 

Definition at line 175 of file odevice.h.

Referenced by allowedCpuFrequencies(), buttonForKeycode(), buttonHoldTime(), buttons(), Zaurus::buzzer(), Zaurus::direction(), Zaurus::displayBrightnessResolution(), iPAQ::filter(), Zaurus::hasHingeSensor(), Opie::Core::Internal::SIMpad::init(), Jornada::init(), Ramses::init(), SIMpad::init(), Zaurus::init(), iPAQ::init(), Yopy::init(), Opie::Core::Internal::SIMpad::initButtons(), SIMpad::initButtons(), Zaurus::initButtons(), iPAQ::initButtons(), Yopy::initButtons(), initButtons(), iPAQ::ledList(), iPAQ::ledStateList(), model(), modelString(), ODevice(), reloadButtonMapping(), remapHeldAction(), remapPressedAction(), Zaurus::rotation(), setCurrentCpuFrequency(), Zaurus::setDisplayBrightness(), setDisplayStatus(), Zaurus::suspend(), suspend(), system(), systemString(), systemVersionString(), vendor(), vendorString(), virtual_hook(), and ~ODevice().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:00:18 2005 for OPIE by  doxygen 1.4.2