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 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

Constructor & Destructor Documentation

RFeatureRegistry()

RFeatureRegistry ( ) [inline]

Member Functions Documentation

Close()

IMPORT_C void Close ( )

Closes this registry instance.

Open()

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.

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 &)

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.

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 &)

IMPORT_C TInt QuerySupportS ( TUid aFeatureUid,
TUint32 & aInfo
) [static]

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

TImpl * iImpl

TImpl * iImpl [private]