Symbian3/PDK/Source/GUID-711594BD-9B8E-5E8A-A5A9-6C94F65AF064.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 12 80ef3a206772
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-711594BD-9B8E-5E8A-A5A9-6C94F65AF064" xml:lang="en"><title>Querying
a Single Feature Dynamically Using CFeatureDiscovery</title><shortdesc>How to query a feature using <codeph>CFeatureDiscovery</codeph> dynamically. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<context id="GUID-D2E2CCAE-2B15-53E0-A949-973894871DAF"><p>To query whether
a feature is supported using <xref href="GUID-2C9E6E72-2858-37A1-9D43-4E8086569520.dita"><apiname>CFeatureDiscovery</apiname></xref> dynamically,
take the following steps. </p> </context>
<steps id="GUID-9BD2AF39-8A86-5952-BD94-6ED688FD6829">
<step id="GUID-8911CB98-2426-554D-9923-B509922D586E"><cmd/>
<info>Determine the Uid of the feature. </info>
</step>
<step id="GUID-60CD7151-81A2-5A9F-A94B-AB5225B85E01"><cmd>Create an instance
of <xref href="GUID-2C9E6E72-2858-37A1-9D43-4E8086569520.dita"><apiname>CFeatureDiscovery</apiname></xref> thus, </cmd>
<stepxmp><codeblock id="GUID-9575563D-A7CC-5A27-B517-E8F259128DF3" xml:space="preserve">
  // Dynamic way of using the class using NewL():
  
  // Call NewL() to create an instance of CFeatureDiscovery. 
  CFeatureDiscovery* testA = CFeatureDiscovery::NewL();
</codeblock> </stepxmp>
<info>or thus </info>
<stepxmp><codeblock id="GUID-4C9E66E6-9201-5E45-8C0D-AF8F9A97A34D" xml:space="preserve">
  // 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();
</codeblock> </stepxmp>
</step>
<step id="GUID-C0347D3E-857E-57CD-8D66-DB0482F6B4A0"><cmd>call its <xref href="GUID-4533ABBD-EC51-3507-AD7C-82931229AF66.dita"><apiname>IsSupported()</apiname></xref> function
with the Uid of the feature as argument, and </cmd>
<stepxmp><codeblock id="GUID-9AD6F9ED-07A0-500C-A0BF-6581A3DDB4A3" xml:space="preserve">  // Call the exported IsSupported() method to query whether features 
  // are supported in the current environment or not.
  TBool usbSupported = testA-&gt;IsSupported(&lt;featureUIDx&gt;);
  TBool mmcSupported = testA-&gt;IsSupported(&lt;featureUIDx&gt;);
</codeblock> </stepxmp>
</step>
<step id="GUID-3DC44450-DC99-5493-BB78-C7F99BBBB30C"><cmd/>
<info>delete the instance of <xref href="GUID-2C9E6E72-2858-37A1-9D43-4E8086569520.dita"><apiname>CFeatureDiscovery</apiname></xref> if it was
not created using <xref href="GUID-343E6447-4947-34EE-8641-3CB72930CCF6.dita"><apiname>NewLC()</apiname></xref>. </info>
<stepxmp><codeblock id="GUID-DEDA9801-9223-55AD-8940-EAF53465F6F1" xml:space="preserve">  // Delete the created instance of CFeatureDiscovery.
  delete testA;
</codeblock> </stepxmp>
</step>
</steps>
<result id="GUID-1C697056-2837-50A1-96AA-801CCC600BD2-GENID-1-12-1-27-1-1-4-1-1-5-1-14-1-5-1-3-3"><p> <xref href="GUID-4533ABBD-EC51-3507-AD7C-82931229AF66.dita"><apiname>IsSupported()</apiname></xref> returns <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref> if
the feature is supported or else an error message. </p> </result>
</taskbody><related-links>
<link href="GUID-08ED8657-DB96-59AC-9016-602BD5680752.dita"><linktext>Querying
a single feature                 statically using CFeatureDiscovery</linktext>
</link>
<link href="GUID-3D50D2DE-A202-5560-80AB-0DBAC332179F.dita"><linktext>Querying
a feature set dynamically                 using CFeatureDiscovery</linktext>
</link>
<link href="GUID-DAC496E8-C8D0-5EC6-9A5D-5F5DA667D083.dita"><linktext>Querying
a feature set statically                 using CFeatureDiscovery</linktext>
</link>
<link href="GUID-B7A7E2E8-E727-5A01-8C1B-60679B6AA3D4.dita"><linktext>Querying
a Single Feature                 Dynamically Using RFeatureControl</linktext>
</link>
<link href="GUID-B71AC5E3-8AA8-55AD-916F-9E873926011B.dita"><linktext>Feature Manager
Collection Overview</linktext></link>
<link href="GUID-1A22E574-831B-5D00-98BD-0DFFA9CC09A0.dita"><linktext>Feature Manager
Query Tutorials</linktext></link>
</related-links></task>