Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QDeviceIndicatorsProvider class provides the backend for the QDeviceIndicator API. More...
#include <QDeviceIndicatorsProvider>
Inherits QObject.
The QDeviceIndicatorsProvider class provides the backend for the QDeviceIndicator API.
QDeviceIndicatorsProvider derived types control the status of device indicators. During construction, derived types usually call addSupportedIndicator() followed by setIndicatorSupportedStates() to set up the indicators they provide. Derived classes must implement the changeIndicatorState() and changeIndicatorAttribute() functions which perform the actual hardware operations involved.
Communication between the frontend QDeviceIndicators and backend QDeviceIndicatorsProvider is facilitated through the Qt Extended Value Space. Whenever the state or attributes of an indicator are modified, the status of the indicators should be reflected in the Value Space via setIndicatorState() and setIndicatorAttribute().
The following table shows a few common attributes and how they could be represented.
Attribute | type(units) |
---|---|
Period (Flash state) | int (ms) |
Duty Cycle(Flash state) | int (%) |
TransitionTime (Throb state) | int (ms) |
Color | QColor |
Because the indicator names and supported states and attributes are device specific, it is expected that the implementer of the QDeviceIndicatorsProvider derived class will provide these to the user of QDeviceIndicators. If the possible values a particular attribute need to be queryable, then another attribute can be made specifically for this eg a SupportedColors attribute whose type is QList<QColor>. Generally this would not be necessary since the possible supported values should be provided to the user of QDeviceIndicators.
This class is part of the Qt Extended server and a specific implementation should be provided as part of a server task.
See also QDeviceIndicators.
Create a new QDeviceIndicatorsProvider instance with the specified parent.
Add an indicator that this QDeviceIndicatorsProvider instance will provide. changeIndicatorState() callbacks will only occur for indicators added in this way or with setSupportedIndicators(). This function will have no effect and produce a warning if an indicator already exists that is already being provided by this or another provider.
The initial state of the indicator is QDeviceIndicators::Off.
See also setSupportedIndicators().
Called when the attribute of indicator should be set to a new value. This is usually in response to a QDeviceIndicators::setIndicatorAttribute() call. Subclasses should implement the hardware specific operations from this function.
See also changeIndicatorState().
Called when the indicator should be set to state. This is usually in response to a QDeviceIndicators::setIndicatorState() call. Subclasses should implement the hardware specific operations from this function.
See also changeIndicatorAttribute().
Sets the published attribute of indicator to value. This is generally called during the changeIndicatorAttribute() callback to reflect the successful change in attribute or at startup to publish the attribute's initial value, but it can be called at any time.
This function has no effect if indicator has not previously been added or set.
See also setIndicatorState().
Set the published indicator state to state. This is generally called during the changeIndicatorState() callback to indicate that the state was successfully changed or at startup to set the initial state, but it can be called at any time.
This function has no effect if indicator has not previously been set up.
See also setIndicatorAttribute().
Sets the published list of the supported states of indicator to states.
This function has no effect if indicator has not previously been set up.
See also setIndicatorState().
Set the indicators that this QDeviceIndicatorsProvider instance will provide. changeIndicatorState() callbacks will only occur for indicators set in this way or added with addSupportedIndicator(). If an indicator in the in the indicators list is already provided by another QDeviceIndicators instance, then that indicator is not set and a warning is produced.
The initial state of the indicators is QDeviceIndicators::Off.
See also addSupportedIndicator().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |