RFeatureRegistry Class Reference
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.
RFeatureRegistry::QuerySupportS
Nested Classes and Structures
Private Attributes |
---|
TImpl * | iImpl |
Constructor & Destructor Documentation
RFeatureRegistry()
RFeatureRegistry | ( | ) | [inline] |
Member Functions Documentation
Close()
Closes this registry instance.
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.
QuerySupport(TUid)
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.
- Pre-condition
- this registry instance is open
-
panic
- FeatReg EFeatRegInvalidUse if this registry instance is not open
Parameters
TUid aFeatureUid | Unique identifier of feature being queried |
QuerySupport(TUid, TUint32 &)
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.
- Pre-condition
- this registry instance is open
-
panic
- FeatReg EFeatRegInvalidUse if this registry instance is not open
Parameters
TUid aFeatureUid | Unique identifier of feature being queried |
TUint32 & aInfo | addition status information about feature |
QuerySupportS(TUid)
IMPORT_C TInt | QuerySupportS | ( | TUid | aFeatureUid | ) | [static] |
Queries support for feature on the device. Static version recommended for single queries.
Parameters
TUid aFeatureUid | Unique identifier of feature being queried |
QuerySupportS(TUid, TUint32 &)
Queries support for feature on the device. Static version recommended for single queries.
Parameters
TUid aFeatureUid | Unique identifier of feature being queried |
TUint32 & aInfo | addition status information about feature |
Member Enumerations Documentation
Enum anonymous
Bit assignments in status word for listed features
Enumerators
EStatusSupportBit = 1 | |
EStatusUpgradableBit = 2 | |
Member Data Documentation
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.