Home · All Classes · Grouped Classes · Annotated · Functions

QHardwareInterface Class Reference

The QHardwareInterface class is the base class of all accessory classes. More...

    #include <QHardwareInterface>

Inherits QAbstractIpcInterface.

Inherited by QBootSourceAccessory, QKeypadLightAccessory, QPowerSource, QSignalSource, and QVibrateAccessory.

Public Functions

Additional Inherited Members

Detailed Description

The QHardwareInterface class is the base class of all accessory classes.

QHardwareInterface and the accessory classes are part of the Qtopia Accessory System, which provides information and on the availability of physical accessories and an API for controlling those accessories. The accessory API is split into two sets of classes: accessory provider classes and accessory client classes. Both sets are subclasses of QHardwareInterface.

The accessory provider classes implement device-specific code for controlling the hardware feature and manage the state that is reported to the rest of Qtopia through the accessory client API. Provider classes are created by passing QAbstractIpcInterface::Server as the mode parameter when constructing QHardwareInterface derived classes.

The accessory client classes provide an API for querying the state of and controlling accessories. Client classes communicate with provider classes through an Inter Process Communication (IPC) mechanism. Multiple client instances can connect to a single accessory provider. Client classes are created by passing QAbstractIpcInterface::Client as the mode parameter when constructing QHardwareInterface derived classes.

Qtopia automatically recognizes any subclass of QHardwareInterface as a Qtopia accessory. Each accessory follows the principal of accessory and accessory provider whereby the provider is a subclass of the accessory class. See the documentation for QAbstractIpcInterface for more information on wrting and using interface classes.

The accessory system supports multiple accessory providers of the same interface type. For example, a device could have a primary and secondary battery. Each battery would be exposed as a separate instance of a QPowerSourceProvider derived class. Default accessories can be defined in the Trolltech/HardwareAccessories.conf configuration file. The file contains a list of interface names and the identity of the default accessory, for example:

    QPowerSource = DefaultBattery
    QSignalSource = DefaultSignal
    QVibrateAccessory = Modem

See also QHardwareManager and QAbstractIpcInterface.

Member Function Documentation

QHardwareInterface::QHardwareInterface ( const QString & name, const QString & id = QString(), QObject * parent = 0, QAbstractIpcInterface::Mode mode = Client )

Constructs a new QHardwareInterface object with interface type name, identity id and operates in mode. The object is attached to parent.

If id is empty the default accessory for name will be automatically selected.

QHardwareInterface::~QHardwareInterface ()

Destroys the hardware interface object.

Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3