diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-B7A7E2E8-E727-5A01-8C1B-60679B6AA3D4.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-B7A7E2E8-E727-5A01-8C1B-60679B6AA3D4.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,42 @@ + + + + + +Querying a Single Feature Dynamically Using RFeatureControl How to query a feature using RFeatureControl dynamically.

To query whether a feature is supported using RFeatureControl dynamically, take the following steps.

Create an instance of RFeatureControl, +// replace <featureUID> with a real Uid ) +#include <featurecontrol.h> +#include <featureinfo.h> // for feature definitions +CMyClass::MyMethodL() + { + // Replace KFeatureUidx with real feature Uid. + // Open() must be called before calling any other methods. + // Disconnect is done by calling the Close() method. + RFeatureControl featureControl; call its Open() function, + TInt err = featureControl.Open(); + determine the Uid of the feature you wish to query, call the FeatureSupported() function of the RFeatureControl object with the Uid of the feature as argument, and + if ( err == KErrNone ) + { + // Query single feature status + err = control.FeatureSupported( KFeatureUid3 ); + if( err == KFeatureSupported ) + { + // do something with enabled feature + } + + call the Close() function of the RFeatureControl object. + // Remember to call CloseL after using RFeatureControl. + // It disconnects the Feature Manager server. + featureControl.Close(); + } +

FeatureSupported() returns:

  • KFeatureSupported if the feature is supported,

  • KFeatureUnsupported if the feature is not supported,

  • KErrNotFound if the feature does not exist,

  • KErrNotReady if the feature is uninitialised, and

  • otherwise returns an error code.

RFeatureControl has a deprecated function Connect() which should no longer be used as it has been replaced by the function Open().

Querying a Single Feature + Dynamically Using CFeatureDiscovery Querying a Single Feature + Statically Using CFeatureDiscovery Querying a Feature Set Dynamically + Using CFeatureDiscovery Querying a Feature Set Statically + Using CFeatureDiscovery Feature Manager Collection Overview Feature Manager Query Tutorials
\ No newline at end of file