class RFeatureRegistry |
Interface for inquiring whether features are supported on the device.
The code segment below shows an example of how the QuerySupport() API should be used in client code that checks feature status.
// Single query // TBool haveUsb = RFeatureRegistry::QuerySupportS(NFeature::KUsb) > 0; if (haveUsb) { // ... connect to USB service ... } // or Multiple queries // RFeatureRegistry featReg; const TBool opened = (featReg.Open() == KErrNone); iHaveUsb = opened && (featReg.QuerySupport(NFeature::KUsb) > 0); iHaveBluetooth = opened && (featReg.QuerySupport(NFeature::KBluetooth) > 0); featReg.Close(); // can always call Close(), even if Open() failed: // ... proceed to update application menus based on these featue flags
Note the QuerySupport() API can return a negative error code. Clients calling this API need to decide if this should result in specific error handling or whether ignoring the error and assuming the feature is not supported is the best policy.
Public Member Functions | |
---|---|
RFeatureRegistry () | |
IMPORT_C void | Close () |
IMPORT_C TInt | Open () |
IMPORT_C TInt | QuerySupport ( TUid ) |
IMPORT_C TInt | QuerySupport ( TUid , TUint32 &) |
IMPORT_C TInt | QuerySupportS ( TUid ) |
IMPORT_C TInt | QuerySupportS ( TUid , TUint32 &) |
Public Member Enumerations | |
---|---|
enum | anonymous { EStatusSupportBit = 1, EStatusUpgradableBit = 2 } |
Private Attributes | |
---|---|
TImpl * | iImpl |
IMPORT_C TInt | Open | ( | ) |
Opens connection to the Feature Registry for making non-static queries. Note all non-static queries return state at the time Open() was called; Feature Registry changes are not observed until instance closed and re-opened.
IMPORT_C TInt | QuerySupport | ( | TUid | aFeatureUid | ) |
Queries support for feature on the device. Non-static version requiring open instance of class. Recommended when making multiple queries. Note: returns support for feature from the time Open() was called.
TUid aFeatureUid | Unique identifier of feature being queried |
IMPORT_C TInt | QuerySupport | ( | TUid | aFeatureUid, |
TUint32 & | aInfo | |||
) |
Queries support for feature on the device. Non-static version requiring open instance of class. Recommended when making multiple queries. Note: returns support for feature from the time Open() was called.
IMPORT_C TInt | QuerySupportS | ( | TUid | aFeatureUid | ) | [static] |
Queries support for feature on the device. Static version recommended for single queries.
TUid aFeatureUid | Unique identifier of feature being queried |
IMPORT_C TInt | QuerySupportS | ( | TUid | aFeatureUid, |
TUint32 & | aInfo | |||
) | [static] |
Queries support for feature on the device. Static version recommended for single queries.
Bit assignments in status word for listed features
EStatusSupportBit = 1 | |
EStatusUpgradableBit = 2 |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.