Symbian3/SDK/Source/GUID-3987D040-27F7-5226-96AC-D578ECA4C0A2.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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 concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-3987D040-27F7-5226-96AC-D578ECA4C0A2"><title>Callback Interfaces</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>The API uses two types of callback interfaces: change notifications, and progress/completion notifications. </p> <section><title>Change notifications</title> <p>The <xref href="GUID-353A4B43-8C06-3181-B2CD-1DC646D0E726.dita"><apiname>MCalChangeCallBack</apiname></xref> interface is implemented to monitor changes to calendar entries, such as the addition, deletion, and update of entries. </p> <p>Call <xref href="GUID-609318A7-43F1-3FC1-952B-146B1EA8115D.dita#GUID-609318A7-43F1-3FC1-952B-146B1EA8115D/GUID-6E8C296A-BFBC-34C9-B448-C706393B05C5"><apiname>CCalSession::StartChangeNotification()</apiname></xref> to request change notifications. The following requests notifications of all changes for entries between 1 Jan 2005 and 1 Jan 2006. </p> <codeblock id="GUID-72CA6019-C6A2-5EE1-802C-C660B8399CFA" xml:space="preserve">// set up notification of all changes on all entries in 2005 
TTime startTime(TDateTime(2005, EJanuary, 0, 0, 0, 0, 0)); // start time
TTime endTime(startTime + TTimeIntervalYears(1)); // end time 
// assume this object implements MCalChangeCallBack
session-&gt;StartChangeNotification(this, EChangeEntryAll, ETrue, startTime, endTime);</codeblock> <p>The observer's implementation of <xref href="GUID-353A4B43-8C06-3181-B2CD-1DC646D0E726.dita#GUID-353A4B43-8C06-3181-B2CD-1DC646D0E726/GUID-593A1DB8-C056-3BC4-A66A-F2433CF1371F"><apiname>MCalChangeCallBack::CalChangeNotification()</apiname></xref> is called whenever a change to the calendar entries occurs that matches the specified criteria. </p> <p>You can disable a change notification by using <xref href="GUID-609318A7-43F1-3FC1-952B-146B1EA8115D.dita#GUID-609318A7-43F1-3FC1-952B-146B1EA8115D/GUID-1F42C4AD-FC62-3FAC-A9B3-F1B1BFF482D3"><apiname>CCalSession::StopChangeNotification()</apiname></xref>. </p> </section> <section><title>Progress and completion notifications</title> <p>The <xref href="GUID-1A1D94E6-AD7C-3202-B1BD-A1583FA34A5F.dita"><apiname>MCalProgressCallBack</apiname></xref> interface is used for monitoring the progress and completion of asynchronous tasks, such as the addition, deletion or updating of a calendar entry carried out on the entry view or instance view. <xref href="GUID-1A1D94E6-AD7C-3202-B1BD-A1583FA34A5F.dita#GUID-1A1D94E6-AD7C-3202-B1BD-A1583FA34A5F/GUID-A717C7C7-45BE-3E7F-B054-621751C95787"><apiname>MCalProgressCallBack::Progress()</apiname></xref> reports the percentage completion of the current task. <xref href="GUID-1A1D94E6-AD7C-3202-B1BD-A1583FA34A5F.dita#GUID-1A1D94E6-AD7C-3202-B1BD-A1583FA34A5F/GUID-CDF9D6D4-BE72-3FF3-8E65-2C3D5B5B6230"><apiname>MCalProgressCallBack::Completed()</apiname></xref> is called when the current task is completed. </p> </section> </conbody></concept>