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-E93EE459-8CF4-42A1-B06C-E78E56FD25A0" xml:lang="en"><title>Listeningfor Property Changes</title><shortdesc>The sensor channel APIs enable the client applications to be notifiedabout the changes to properties associated with a sensor channel.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody><prereq id="GUID-D1D22060-E453-4046-953D-10486D45885F"> Before listening forthe property changes of a sensor channel, you must <xref href="GUID-4B709839-8EEF-4AD2-9868-9AF0176B1E5B.dita#GUID-4B709839-8EEF-4AD2-9868-9AF0176B1E5B/GUID-FBBD3A8B-F240-4DC0-B516-3A51FDD86A88">open the sensor channel</xref>. </prereq><context id="GUID-0D960123-7430-42B5-A84D-B63F2852DD7C"><p>The client applicationscan use the property listener to monitor the property changes made by otherclients.</p></context><steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-6-1-8-1-1-6-1-4-1-4-1-8-1-3-3"><step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-6-1-8-1-1-6-1-4-1-4-1-8-1-3-3-1"><cmd>Create a propertylistener implementation for the <parmname>MSensrvPropertyListener</parmname> interface.</cmd><stepxmp><codeblock xml:space="preserve">class PropertyListener:public MSensrvPropertyListener { public: void PropertyChanged(CSensrvChannel &aChannel, const TSensrvProperty &aChangedProperty) { ... //Implementation } void PropertyError(CSensrvChannel &aChannel, TSensrvErrorSeverity aError) { ... //Implementation } void SetPropertySuccessIndicationChanged(TSetPropertySuccessIndicator aIndication) { ... //Implementation } void GetPropertyListenerInterfaceL(TUid aInterfaceUid, TAny *&aInterface) { ... //Implementation } };</codeblock></stepxmp></step><step id="GUID-6AB619B9-0259-493A-BC40-CAF5BF337E04"><cmd>Start property listeningby passing an instance of property listener implementation using <xref href="GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844.dita#GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844/GUID-4552066A-4FC1-3876-89AA-DC9B081B3814"><apiname>CSensrvChannel::SetPropertyListenerL()</apiname></xref>.</cmd><stepxmp><codeblock xml:space="preserve">//Instance of the property listener implementationPropertyListener propListener;...CSensrvChannel* channel;...channel->SetPropertyListenerL(&propListener);...</codeblock></stepxmp><info>When a property change occurs, a <parmname>PropertyChanged()</parmname> notificationis delivered through the <parmname>MSensrvPropertyListener</parmname> callbackinterface to the clients that are listening for property changes.<note> Theclient that set the property is not notified.</note></info></step><step id="GUID-8AD85E3B-EBBC-41E4-A32C-AF2A52B018E6"><cmd>Once you get therequired property changes associated with the sensor channel, you can stopproperty listening by passing a NULL parameter to the <xref href="GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844.dita#GUID-22DC917F-D833-3531-AB2D-A6E2D52EF844/GUID-4552066A-4FC1-3876-89AA-DC9B081B3814"><apiname>CSensrvChannel::SetPropertyListenerL()</apiname></xref> function.</cmd><stepxmp><codeblock xml:space="preserve">channel->SetPropertyListenerL();</codeblock></stepxmp></step></steps></taskbody></task>