| Home · All Classes · Grouped Classes · Annotated · Functions | ![]() |
The QHardwareManager class finds available accessory providers for a given hardware interface. More...
#include <QHardwareManager>
Inherits QAbstractIpcInterfaceGroupManager.
The QHardwareManager class finds available accessory providers for a given hardware interface.
QHardwareManager is part of the Qtopia Accessory System, which provides information about the available hardware accessories.
A QHardwareMonitor can be used to monitor the availability of a given type of hardware accessory, providing a list of providers through providers() and emitting signals providerAdded() and providerRemoved() when that list changes. The type of hardware accessory monitored is given as a parameter to constructing the QHardwareMonitor.
The following example responds whenever a new QSignalSource becomes available:
QHardwareManager* manager = new QHardwareManager( "QSignalSource" );
connect( manager, SIGNAL(providerAdded(QString)),
this, SLOT(newBatteryAdded(QString)));
The types of hardware accessories are the names of the accessory classes which implement the accessories. Any class that is subclassing QHardwareInterface is considered to be a Qtopia accessory.
See also QHardwareInterface, QPowerSource, QSignalSource, and QVibrateAccessory.
Creates a QHardwareManager object and attaches it to parent. interface is the name of the accessory interface that this object is monitoring.
The following code assumes that Qtopia is running on a device that has a modem as power source (for more details see QPowerStatus and QPowerSource).
QHardwareManager manager( "QPowerSource" );
QStringList providers = manager.providers();
//Qtopia always has a virtual power source with id DefaultBattery
providers.contains( "DefaultBattery" ); //always true
providers.contains( "modem" ); //true
Another way to achieve the same as the above example would be:
QStringList providers = QHardwareManager::providers<QPowerSource>();
providers.contains( "DefaultBattery" ); //always true
providers.contains( "modem" ); //true
Destroys the QHardwareManager object.
Returns the interface that this object is monitoring.
This signal is emitted when provider id is added.
This signal is emitted when provider id is removed.
Returns a list of providers that support the interface that this object was initialized with.
This is an overloaded member function, provided for convenience.
Returns a list of providers which support the given interface of type T. The following example demonstrates how to get the list of providers that supports the QPowerSource interface.
QStringList providers = QHardwareManager::providers<QPowerSource>();
| Copyright © 2008 Nokia | Trademarks | Qtopia 4.3.3 |