RFeatureRegistry Class Reference

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.

RFeatureRegistry::QuerySupportS

Nested Classes and Structures

Public Member Functions
RFeatureRegistry()
IMPORT_C voidClose()
IMPORT_C TIntOpen()
IMPORT_C TIntQuerySupport(TUid)
IMPORT_C TIntQuerySupport(TUid, TUint32 &)
IMPORT_C TIntQuerySupportS(TUid)
IMPORT_C TIntQuerySupportS(TUid, TUint32 &)
Public Member Enumerations
enumanonymous { EStatusSupportBit = 1, EStatusUpgradableBit = 2 }
Private Attributes
TImpl *iImpl

Constructor & Destructor Documentation

RFeatureRegistry()

RFeatureRegistry()[inline]

Member Functions Documentation

Close()

IMPORT_C voidClose()

Closes this registry instance.

Open()

IMPORT_C TIntOpen()

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 TIntQuerySupport(TUidaFeatureUid)

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 aFeatureUidUnique identifier of feature being queried

QuerySupport(TUid, TUint32 &)

IMPORT_C TIntQuerySupport(TUidaFeatureUid,
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.

Pre-condition
this registry instance is open
panic
FeatReg EFeatRegInvalidUse if this registry instance is not open

Parameters

TUid aFeatureUidUnique identifier of feature being queried
TUint32 & aInfoaddition status information about feature

QuerySupportS(TUid)

IMPORT_C TIntQuerySupportS(TUidaFeatureUid)[static]

Queries support for feature on the device. Static version recommended for single queries.

Parameters

TUid aFeatureUidUnique identifier of feature being queried

QuerySupportS(TUid, TUint32 &)

IMPORT_C TIntQuerySupportS(TUidaFeatureUid,
TUint32 &aInfo
)[static]

Queries support for feature on the device. Static version recommended for single queries.

Parameters

TUid aFeatureUidUnique identifier of feature being queried
TUint32 & aInfoaddition 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

TImpl * iImpl

TImpl *iImpl[private]