The type of interface this component uses is a method call. All functionality is accessed through the CFeatureDiscovery class.
The functionality provided by this module is accessed through the CFeatureDiscovery class.
The CFeatureDiscovery class can be used in two different ways, statically and dynamically. If querying only one feature, it is more efficient to use the class via the static method, IsFeatureSupportedL(). For other cases, when querying more than one feature, it is more efficient to use the class by creating an instance and calling the IsSupported() method.
When using CFeatureDiscovery dynamically, the user must create an instance of the CFeatureDiscovery class using one of the factory methods, NewL() or NewLC().
After creating an instance the user can call the exported IsSupported() method to query whether a feature is supported in the current environment. The created instance must be deleted after use.
When using CFeatureDiscovery statically, an instance is not needed; the query operation can be preformed by calling static method IsFeatureSupportedL() directly.
A simple code example showing the usage of Feature Discovery is shown in the Example.
The leave mechanism of the Symbian OS is used to handle out-of-memory conditions. Other errors are indicated using one of the standard Symbian error codes.
No extra error handling is defined.
// Interface declaration #include <FeatDiscovery.h> … // Static way of using the class: TBool isSupported = CFeatureDiscovery::IsFeatureSupportedL(KfeatureIdUsb); // Dynamic way of using the class using NewL(): CFeatureDiscovery* testA = CFeatureDiscovery::NewL(); TBool usbSupported = testA->IsSupported(KFeatureIdUsb); TBool mmcSupported = testA->IsSupported(KFeatureIdMmc); delete testA; // Dynamic way of using the class using NewLC(): CFeatureDiscovery* testB = CFeatureDiscovery::NewLC(); TBool wcdmaSupported = testB->IsSupported(KFeatureIdProtocolWcdma); TBool gsmSupported = testB->IsSupported(KFeatureIdProtocolGsm); CleanupStack::PopAndDestroy();
All the public interfaces of the subsystem are described below in more detail.
This class offers an interface through which the functionality of Feature Discovery is accessed.
This is a factory method that is used to create a new instance.
Parameters:
None.
Return value:
This factory method returns a pointer to a new instance of the CFeatureDiscovery class.
This is a factory method that is used to create a new instance.
This method leaves the instance of the object on the cleanup stack.
Parameters:
None.
Return value:
This factory method returns a pointer to a new instance of the CFeatureDiscovery class.
Fetches information about whether or not a certain feature is supported.
Feature identifications are defined in an appropriate HRH file. The resource header files (HRH) that are used are defined by using the Symbian build variant file variant.CFG which can be found in the following path: epoc32\tools\variant\.
Parameters:
Type | Name | Description |
---|---|---|
TInt |
aFeature |
The feature ID of the feature that is queried. |
Return value:
A TBool indicating whether the feature is supported (ETrue) or not (EFalse).
If the feature does not exist, the return value is Efalse.
Fetches information about whether or not a certain feature is supported.
Feature identifications are defined in an appropriate HRH file. The resource header files (HRH) that are used are defined by using the Symbian build variant file variant.CFG which can be found in the following path: epoc32\tools\variant\.
There is no need to create an instance of the class when using this method.
Parameters:
Type | Name | Description |
---|---|---|
TInt |
aFeature |
The feature ID of the feature that is queried. |
Return value:
A TBool indicating whether the feature is supported (ETrue) or not (EFalse).
If the feature does not exist, the return value is Efalse. The method may leave one of the standard Symbian OS error codes.
The client interface for Feature Discovery can be accessed through the CFeatureDiscovery interface that is defined in the header FeatDiscovery.H. The name of the corresponding DLL is FEATDISCOVERY.DLL.