Symbian3/PDK/Source/GUID-2E33854B-5725-55DE-9B03-7A3100F5A5B5.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Fri, 22 Jan 2010 18:26:19 +0000
changeset 1 25a17d01db0c
child 5 f345bda72bc4
permissions -rw-r--r--
Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608

<?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-2E33854B-5725-55DE-9B03-7A3100F5A5B5" xml:lang="en"><title>Requesting
Feature Notification </title><shortdesc>How to request notification of changes to a feature using <apiname>RFeatureControl</apiname>. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<context id="GUID-9ECB1E79-15A6-52F1-BCDC-2BCC3E35BF25"><p>To request notification
of changes to a feature using <xref href="GUID-F6AAAC24-4A62-383A-86C6-2E46335C3FD4.dita"><apiname>RFeatureControl</apiname></xref>, take the
following steps. </p><p>          To request notification of change to a single
feature: 
</p><table id="GUID-0699C4E1-2BFA-4FAA-A5C3-9D1981E4FC70">
<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
<tbody>
<row>
<entry><p><b>Step</b></p></entry>
<entry><p><b>Action</b></p></entry>
</row>
<row>
<entry><p>1</p></entry>
<entry><p>Implement the interface <xref href="GUID-623C4183-00F0-36B0-AE1F-5C5EDCAF1B3D.dita"><apiname>MFeatureObserver</apiname></xref> and
its functions <xref href="GUID-428DC6B1-6847-313F-BEEF-A8EC2442BA57.dita"><apiname>HandleNotifyChange()</apiname></xref> and <xref href="GUID-F737E1D7-5B67-345D-8290-E31F214D55E8.dita"><apiname>HandleNotifyError()</apiname></xref>, </p></entry>
</row>
<row>
<entry><p>2</p></entry>
<entry><p>create an instance of your implementation,</p></entry>
</row>
<row>
<entry><p>3</p></entry>
<entry><p>construct an instance of <xref href="GUID-CA12C6F7-E997-33B8-9463-B326BC1832C5.dita"><apiname>CFeatureNotifier</apiname></xref> with
an instance of your observer as argument of the constructor function,</p></entry>
</row>
<row>
<entry><p>4</p></entry>
<entry><p>call its <xref href="GUID-B0275876-886E-3C30-A448-0D1791EEE9EA.dita"><apiname>NotifyRequest()</apiname></xref> function with the Uid
of the feature as argument, and </p></entry>
</row>
<row>
<entry><p>5</p></entry>
<entry><p>destroy the <xref href="GUID-CA12C6F7-E997-33B8-9463-B326BC1832C5.dita"><apiname>CFeatureNotifier</apiname></xref> object. </p></entry>
</row>
</tbody>
</tgroup>
</table> <p>         To request notification of change to a single feature: </p><table id="GUID-7C707FE9-AD3D-4ABE-8521-B3D525B07F55">
<tgroup cols="2"><colspec colname="col1"/><colspec colname="col2"/>
<tbody>
<row>
<entry><p><b>Step</b></p></entry>
<entry><p><b>Action</b></p></entry>
</row>
<row>
<entry><p>6</p></entry>
<entry><p>Create an instance of <xref href="GUID-E8FE48BB-6832-3B20-9814-72BE01198EEF.dita"><apiname>RFeatureUidArray</apiname></xref>,</p></entry>
</row>
<row>
<entry><p>7</p></entry>
<entry><p>append to it the Uids of the features, </p></entry>
</row>
<row>
<entry><p>8</p></entry>
<entry><p>create an instance of your implementation of <xref href="GUID-623C4183-00F0-36B0-AE1F-5C5EDCAF1B3D.dita"><apiname>MFeatureObserver</apiname></xref>,</p></entry>
</row>
<row>
<entry><p>9</p></entry>
<entry><p>construct an instance of <xref href="GUID-CA12C6F7-E997-33B8-9463-B326BC1832C5.dita"><apiname>CFeatureNotifier</apiname></xref> with
an instance of your observer as argument of the constructor function, </p></entry>
</row>
<row>
<entry><p>10</p></entry>
<entry><p>call its <xref href="GUID-B0275876-886E-3C30-A448-0D1791EEE9EA.dita"><apiname>NotifyRequest()</apiname></xref> function with a reference
to the <xref href="GUID-E8FE48BB-6832-3B20-9814-72BE01198EEF.dita"><apiname>RFeatureUidArray</apiname></xref> as argument, and</p></entry>
</row>
<row>
<entry><p>11</p></entry>
<entry><p>destroy the <xref href="GUID-CA12C6F7-E997-33B8-9463-B326BC1832C5.dita"><apiname>CFeatureNotifier</apiname></xref> object. </p></entry>
</row>
</tbody>
</tgroup>
</table></context>
<result id="GUID-EBD8A8B7-83E0-5C98-BA10-53B3A0F471EC"><p> <xref href="GUID-B0275876-886E-3C30-A448-0D1791EEE9EA.dita"><apiname>NotifyRequest()</apiname></xref> returns: </p> <ul>
<li id="GUID-F6896AF0-5FD7-57C8-A734-19AC6799BBBA"><p> <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref> if
the notification request was successfully added, </p> </li>
<li id="GUID-AD94852C-83FB-5487-84A9-05B0D6387093"><p> <xref href="GUID-0B91A2C7-2717-3645-9639-D5B4470011A1.dita"><apiname>KAlreadyExists</apiname></xref> if
the notification request already exists, and </p> </li>
<li id="GUID-F3955A5A-F0C3-5E64-B689-ACEDA34A73DC"><p>otherwise returns an
error code. </p> </li>
</ul> </result>
</taskbody><related-links>
<link href="GUID-ADC42872-9A5B-50F2-8A33-6621A8F7C177.dita"><linktext>Handling
feature                 notification</linktext></link>
<link href="GUID-926862C4-5E13-5896-B959-0D408C748AB5.dita"><linktext>Cancelling
feature                 notification</linktext></link>
<link href="GUID-B71AC5E3-8AA8-55AD-916F-9E873926011B.dita"><linktext>Feature Manager
Collection Overview</linktext></link>
<link href="GUID-910780A3-D6AB-5EE2-966A-5F228AC5804F.dita"><linktext>Feature Manager
Notification Tutorials</linktext></link>
</related-links></task>