CFeatureDiscovery Class Reference

API published in: S60 2nd Ed FP 3

Link against: featdiscovery.lib

Capability Information

Required Capabilities

None


#include <featdiscovery.h>

Detailed Description

Class used to query which features are suppported in the environment.

Feature Discovery API provides methods which are used to query which features are supported in the environment. A feature is a functionality that can be optionally left out of some product configurations. Features often depend on the underlying hardware. For example, MMC support or USB support can be features. The API consist of the CFeatureDiscovery class which is used together with feature IDs defined in the featureinfo.h file.

Usage:

  #include <FeatDiscovery.h>
  #include <featureinfo.h> // for feature definitions

  // If querying only one feature, it is more efficient to use the class
  // via the static method, IsFeatureSupportedL().
  // When querying more than one feature, it is more efficient to use the 
  // class by creating an instance and calling the IsSupported() method.

  // Static way of using the class:
  TBool isSupported = CFeatureDiscovery::IsFeatureSupportedL(KFeatureIdUsb);

  // Dynamic way of using the class using NewL():
  
  // Call NewL() to create an instance of CFeatureDiscovery. 
  CFeatureDiscovery* testA = CFeatureDiscovery::NewL();
 
  // Call the exported IsSupported() method to query whether features 
  // are supported in the current environment or not.
  TBool usbSupported = testA->IsSupported(KFeatureIdUsb);
  TBool mmcSupported = testA->IsSupported(KFeatureIdMmc);

  // Delete the created instance of CFeatureDiscovery.
  delete testA;

  // Dynamic way of using the class using NewLC():
 
  // Call NewLC() to create an instance of CFeatureDiscovery.
  // The method leaves the instance of the object on the cleanup stack.
  CFeatureDiscovery* testB = CFeatureDiscovery::NewLC();

  // Call the exported IsSupported() method to query whether features 
  // are supported in the current environment or not. 
  TBool wcdmaSupported = testB->IsSupported(KFeatureIdProtocolWcdma);
  TBool gsmSupported = testB->IsSupported(KFeatureIdProtocolGsm);

  // Pop and delete the created instance of CFeatureDiscovery.
  CleanupStack::PopAndDestroy();

Public Member Functions

virtual  ~CFeatureDiscovery ()
  Destructor.
IMPORT_C TBool  IsSupported (TInt aFeature) const
  Dynamic way to fetch information whether a certain feature is supported in the current environment.

Static Public Member Functions

static IMPORT_C CFeatureDiscovery NewL ()
  This is a two-phase constructor method that is used to create a new instance of the CFeatureDiscovery class.
static IMPORT_C CFeatureDiscovery NewLC ()
  This is a two-phase constructor method that is used to create a new instance of the CFeatureDiscovery class.
static IMPORT_C TBool  IsFeatureSupportedL (TInt aFeature)
  Static way to fetch information whether a certain feature is supported in the current envinronment.

Constructor & Destructor Documentation

virtual CFeatureDiscovery::~CFeatureDiscovery  )  [virtual]
 

Destructor.


Member Function Documentation

static IMPORT_C TBool CFeatureDiscovery::IsFeatureSupportedL TInt  aFeature  )  [static]
 

Static way to fetch information whether a certain feature is supported in the current envinronment.

There is no need to create an instance of the class when using this method.

Parameters:
aFeature  is the feature ID of the feature that is queried.
Returns:
a TBool indicating whether the feature is supported (ETrue) or not (EFalse). If the feature does not exist, the return value is EFalse.
Leave:
One of the Symbian OS error codes.
IMPORT_C TBool CFeatureDiscovery::IsSupported TInt  aFeature  )  const
 

Dynamic way to fetch information whether a certain feature is supported in the current environment.

Before calling the method an instance of the CFeatureDiscovery class need to be created by using one of the factory methods, NewL() or NewLC(). The created instance must be deleted after use.

Parameters:
aFeature  is the feature ID of the feature that is queried.
Returns:
a TBool indicating whether the feature is supported (ETrue) or not (EFalse). If the feature does not exist, the return value is EFalse.
static IMPORT_C CFeatureDiscovery* CFeatureDiscovery::NewL  )  [static]
 

This is a two-phase constructor method that is used to create a new instance of the CFeatureDiscovery class.

Returns:
a pointer to a new instance of the CFeatureDiscovery class.
Leave:
One of the Symbian OS error codes
static IMPORT_C CFeatureDiscovery* CFeatureDiscovery::NewLC  )  [static]
 

This is a two-phase constructor method that is used to create a new instance of the CFeatureDiscovery class.

This method leaves the instance of the object on the cleanup stack.

Returns:
a pointer to a new instance of the CFeatureDiscovery class.
Leave:
One of the Symbian OS error codes

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top