Querying
a Feature Set Dynamically Using CFeatureDiscovery
How to query a feature set using CFeatureDiscovery dynamically.
To query whether
a feature is supported in a feature set using CFeatureDiscovery dynamically,
take the following steps.
Decide the set of features you want to query and determine their Uids,
create an instance of TFeatureSet,
// Dynamic way of using multiple feature query. This is preferred
// way to fetch support statuses if there are several features to be
// queried, because it involves less inter-process communication.
TFeatureSet featset;
add each feature you want to query by calling the Append() function
of TFeatureSet with the Uid of the feature as argument
(one call for each feature),
User::LeaveIfError( featset.Append( <featureUIDx> ) );
User::LeaveIfError( featset.Append( <featureUIDx> ) );
create an instance of CFeatureDiscovery,
// 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 its FeaturesSupported() function with the TFeatureSet as
argument, and
// Call the exported IsSupported() method to query whether features
// are supported in the current environment or not.
TBool wcdmaSupported = testB->IsSupported(<featureUIDx>);
TBool gsmSupported = testB->IsSupported(<featureUIDx>);
destroy the CFeatureDiscovery instance when you have
finished with it if it was created with NewL() rather than NewLC().
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.