Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QDeviceIndicators Class Reference
[QtBaseModule]

The QDeviceIndicators class allows applications to control indicator lights. More...

    #include <QDeviceIndicators>

Inherits QObject.

Public Types

Public Functions

Signals

Additional Inherited Members


Detailed Description

The QDeviceIndicators class allows applications to control indicator lights.

The QDeviceIndicators class can be used by applications to control visual lights on a device. For example, many devices have an "Email" light that is illuminated whenever there are new messages. Each light has a name, and is manipulated through it's state such as On or Flash and attributes such as Color. The names of each indicator, and their supported states and attributes are device specific. Typically the implementer of QDeviceIndicatorsProvider would document these and provide them to the user of QDeviceIndicators.

QDeviceIndicators acts as a thin convenience wrapper around entries in the Qt Extended Value Space. The current status on indicators is located under the /Hardware/IndicatorLights path. For example, the "Email" indicator state could be read and set directly through the /Hardware/IndicatorLights/Email item.

Note: Because QDeviceIndicators uses Value Space, it is not thread safe and may only be used from an application's main thread.

See also QDeviceIndicatorsProvider.


Member Type Documentation

enum QDeviceIndicators::IndicatorState

Represents the state of a device indicator.

ConstantValueDescription
QDeviceIndicators::Off0The indicator light is not illuminated.
QDeviceIndicators::On1The indicator light is illuminated.
QDeviceIndicators::Flash2The indicator is flashing on and off.
QDeviceIndicators::Throb3The indicator is smoothly cycling from zero intensity to full intensity and back again


Member Function Documentation

QDeviceIndicators::QDeviceIndicators ( QObject * parent = 0 )

Create a new QDeviceIndicators instance with the provided parent.

QDeviceIndicators::~QDeviceIndicators ()   [virtual]

Destroys the instance.

QVariant QDeviceIndicators::indicatorAttribute ( const QString & name, const QString & attribute ) const

Returns the value of the attribute of the given indcator's name. An invalid QVariant is returned if the indicator name does not exist or attribute is not supported.

See also setIndicatorAttribute().

IndicatorState QDeviceIndicators::indicatorState ( const QString & name )

Returns the current indicator state for name.

See also setIndicatorState() and isIndicatorStateSupported().

void QDeviceIndicators::indicatorStateChanged ( const QString & name, QDeviceIndicators::IndicatorState newState )   [signal]

Emitted whenever the indicator name changes state. newState will be set to the new indicator state.

See also indicatorState() and setIndicatorState().

bool QDeviceIndicators::isIndicatorStateSupported ( const QString & name, IndicatorState state )

Returns true if the indicator name supports a given state. Returns false if the state is not supported or the indicator name is not recognised.

See also indicatorState() and setIndicatorState().

bool QDeviceIndicators::isIndicatorSupported ( const QString & name )

Returns true if the indicator name is supported by the device.

See also supportedIndicators().

void QDeviceIndicators::setIndicatorAttribute ( const QString & name, const QString & attribute, const QVariant & value )

Attempts to set the attribute of indicator name to value. Setting an attribute is an asynchronous event. Honoring or ignoring the request is up to the implementation of QDeviceIndicatorsProvider, typically valid requests would always be honored.

See also indicatorAttribute().

void QDeviceIndicators::setIndicatorState ( const QString & name, IndicatorState state )

Attempts to change the indicator name to the provided state. Setting an indicator is an asynchronous event. If necessary, callers should monitor the indicatorStateChanged() signal to determine when the state change occurs.

See also indicatorState() and isIndicatorStateSupported().

QStringList QDeviceIndicators::supportedIndicators () const

Returns the list of all indicators supported by the device.

See also isIndicatorSupported().


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3