Symbian3/PDK/Source/GUID-981C138C-1CF1-5D77-BEB5-81163AC71E44.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Tue, 30 Mar 2010 11:42:04 +0100
changeset 4 4816d766a08a
parent 1 25a17d01db0c
child 5 f345bda72bc4
permissions -rw-r--r--
Week 12 contribution of SDK documentation_content. See release notes for details. Fixes Bug 1892, Bug 1522, Bug 1520, Bug 394, Bug 1319, Bug 344, Bug 1897
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     6
<!-- Initial Contributors:
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     7
    Nokia Corporation - initial contribution.
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     8
Contributors: 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     9
-->
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    10
<!DOCTYPE task
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    12
<task xml:lang="en" id="GUID-981C138C-1CF1-5D77-BEB5-81163AC71E44"><title>Reporting on all Features on a Device Dynamically Using RFeatureControl </title><shortdesc>How to list all supported features on a device using <apiname>RFeatureControl</apiname> dynamically. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody><context id="GUID-66CE0C50-75D0-547E-869C-8D0BFEBE0974"><p>To list all supported features on a device using <xref href="GUID-F6AAAC24-4A62-383A-86C6-2E46335C3FD4.dita"><apiname>RFeatureControl</apiname></xref> dynamically, take the following steps. </p> </context> <steps id="GUID-0C573781-0002-500B-A7F4-E44CC688A820"><step id="GUID-B65FF1CA-5A11-563E-B0A3-9DDD2E555276"><cmd/><info>Create an instance of <xref href="GUID-F6AAAC24-4A62-383A-86C6-2E46335C3FD4.dita"><apiname>RFeatureControl</apiname></xref>, </info> <stepxmp><codeblock id="GUID-0F3730FF-00DC-5FCD-9A0C-CA205082A5B1" xml:space="preserve">
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    13
// replace &lt;featureUID&gt; with a real Uid ) 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    14
#include &lt;featurecontrol.h&gt;
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    15
#include &lt;featureinfo.h&gt; // for feature definitions
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    16
CMyClass::MyMethodL()
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    17
     {
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    18
     // Replace KFeatureUidx with real feature Uid.
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    19
     // Open() must be called before calling any other methods. 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    20
     // Disconnect is done by calling the Close() method.
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    21
     RFeatureControl featureControl;
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    22
</codeblock> </stepxmp> </step> <step id="GUID-A4FEB01F-56A0-595C-85A5-5C2E435BD175"><cmd/><info>call its <xref href="GUID-20D0D10F-3401-3F72-8AF6-DC35F6025DC2.dita"><apiname>Open()</apiname></xref> function, </info> <stepxmp><codeblock id="GUID-61D3CB3F-1760-5747-8F55-6595BAF66AAB" xml:space="preserve">
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    23
     TInt err = featureControl.Open();
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    24
</codeblock> </stepxmp> </step> <step id="GUID-DAFA2032-8535-5F63-AD1B-D83D843FB271"><cmd/><info>create an instance of <xref href="GUID-144E257F-A162-3680-B1C5-C28BEAA902BC.dita"><apiname>RFeatureArray</apiname></xref> (an array of <xref href="GUID-80C51259-F2C4-3877-97B4-EC0C85DE93DE.dita"><apiname>TFeatureEntry</apiname></xref> objects), </info> <stepxmp><codeblock id="GUID-3CAE75C5-A1B6-51B9-AD2C-2E13AE53FD8E" xml:space="preserve">
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    25
         // List all supported features.
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    26
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    27
         // A client owned RFeatureUidArray array which will be filled with 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    28
         // the UIDs of supported features. 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    29
         RFeatureUidArray supportedFeatures;
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    30
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    31
</codeblock> </stepxmp> </step> <step id="GUID-9BD96024-5335-5A54-832A-0A87B293B24A"><cmd/><info>call its <xref href="GUID-5647EEB3-56CB-35C9-B9E1-1E348644A27A.dita"><apiname>ListSupportedFeatures()</apiname></xref> function with a reference to the <xref href="GUID-144E257F-A162-3680-B1C5-C28BEAA902BC.dita"><apiname>RFeatureArray</apiname></xref> as argument, </info> <stepxmp><codeblock id="GUID-6B1D8B91-76D2-575E-91AE-93727C75FA89" xml:space="preserve">
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    32
         // ListSupportedFeatures() returns one of the Symbian error codes.
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    33
         err = featureControl.ListSupportedFeatures( supportedFeatures );
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    34
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    35
         // do something
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    36
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    37
</codeblock> </stepxmp> </step> <step id="GUID-8BF96CBE-BB74-58A3-A63B-8AC32F71D78C"><cmd/><info>call its <xref href="GUID-01D2AF56-21E1-3FF3-BF86-0C356A1658EF.dita"><apiname>Close()</apiname></xref> function, </info> <stepxmp><codeblock id="GUID-C8126829-41FA-50B2-B462-9F92090B5146" xml:space="preserve">
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    38
         // Closes the array and frees all memory allocated to the array.
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    39
         supportedFeatures.Close();
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    40
</codeblock> </stepxmp> </step> <step id="GUID-AAB93851-F12D-52A8-BAC5-00B78C09024C"><cmd/><info>call the <xref href="GUID-01D2AF56-21E1-3FF3-BF86-0C356A1658EF.dita"><apiname>Close()</apiname></xref> function of the RFeatureArray object. </info> <stepxmp><codeblock id="GUID-475D7629-1E07-5269-8F11-75756C04FE26" xml:space="preserve">
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    41
         // Remember to call CloseL after using RFeatureControl.
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    42
         // It disconnects the Feature Manager server.
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    43
         featureControl.Close();  
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    44
         }
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    45
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    46
     }
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    47
</codeblock> </stepxmp> </step> </steps> <result id="GUID-2FDD0EEF-AE71-5078-8A53-2ECB603D30E8"><p> <xref href="GUID-5647EEB3-56CB-35C9-B9E1-1E348644A27A.dita"><apiname> ListSupportedFeatures()</apiname></xref> causes the passed in array to be filled with the Uids of supported features. It returns: </p> <ul><li id="GUID-8B1E55A0-20C0-5C72-93B4-2C1828633192"><p> <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref> if the <xref href="GUID-144E257F-A162-3680-B1C5-C28BEAA902BC.dita"><apiname>RFeatureArray</apiname></xref> was successfully filled with Uids, </p> </li> <li id="GUID-AA416C1E-E619-5637-905B-27ADD3A09AD9"><p> <xref href="GUID-E306B54A-1F34-3FB0-B515-90D647B7B822.dita"><apiname>KServerBusy</apiname></xref> if the call failed because features were being enabled or disabled (so creating a lock), and </p> </li> <li id="GUID-0462B50E-A799-562E-9B8E-8EA5C1DD1F8A"><p>otherwise returns an error code. </p> </li> </ul> </result> </taskbody><related-links><link href="GUID-BE841768-0F22-5B9D-B783-B02C74E89AFB.dita"><linktext>Reporting Feature Data for a Single
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    48
                Feature Dynamically Using RFeatureControl</linktext> </link> <link href="GUID-3C52315A-71CC-52B2-B809-F04E4078338D.dita"><linktext>Reporting on Several Features
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    49
                Dynamically Using RFeatureControl</linktext> </link> <link href="GUID-B71AC5E3-8AA8-55AD-916F-9E873926011B.dita"><linktext>Feature Manager Collection Overview</linktext> </link> <link href="GUID-F2489DE2-18E2-5C5B-A174-49B5B7A64A7C.dita"><linktext>Feature Manager ReportingTutorials</linktext> </link> </related-links></task>