Symbian3/PDK/Source/GUID-131A9070-AF80-5BC5-91D2-0F1C7019ABF2.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Fri, 22 Jan 2010 18:26:19 +0000
changeset 1 25a17d01db0c
child 3 46218c8b8afa
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 concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-131A9070-AF80-5BC5-91D2-0F1C7019ABF2"><title>Setting the Repeat Rule</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>For an event to occur repetitively, such as a weekly progress meeting, you need to set a repeat rule. You can set the repeat frequency as daily, weekly, monthly by day (for example every Monday of first week), monthly by date (for example 25th of every month), yearly by day (for example every Monday of first week of October) and yearly by date, to a calendar entry. </p> <p>A repeat rule can be set by passing a <xref href="GUID-010934C4-DC1F-37F3-8121-E497B0BC9CDE.dita"><apiname>TCalRRule</apiname></xref> to <xref href="GUID-725D11A2-8805-3466-98DB-EF5CDEAF2801.dita#GUID-725D11A2-8805-3466-98DB-EF5CDEAF2801/GUID-C66CEE4B-6B7C-3AA4-896F-AE3724C915E2"><apiname>CCalEntry::SetRRule()</apiname></xref>. TCalRRule allows you to set any of the following iCal properties: </p> <ul><li id="GUID-F0CB6D79-2C62-54AE-B35B-74DE497B9C1F"><p>FREQ (rule type) </p> </li> <li id="GUID-1D3E64A0-777E-568F-B40D-1B74E1AE8690"><p>DTSTART (start date) </p> </li> <li id="GUID-C3175B30-5E80-5E7C-AD36-A3C7328259AF"><p>UNTIL (end date) </p> </li> <li id="GUID-A4B90BAF-7DD4-595B-8A78-7B094D132744"><p>COUNT (number of instances) </p> </li> <li id="GUID-D91E2EE3-AE9F-5216-9262-D629BC5E71E1"><p>INTERVAL (interval between instances) </p> </li> <li id="GUID-A7409FBA-83D0-5613-86E2-BC47F070E2A6"><p>BYDAY </p> </li> <li id="GUID-EB9505F8-FA10-510A-9CC4-B4CB7A972708"><p>BYMONTHDAY </p> </li> <li id="GUID-CED46A8A-3954-5783-9E87-9087B0C8CFE7"><p>BYYEARDAY </p> </li> <li id="GUID-32ABB85D-B7B3-59E8-89DB-473EB2A15F14"><p>WKST (start day of week) </p> </li> </ul> <p>You can set the repeat rule as follows: </p> <codeblock id="GUID-A5F8B566-F148-5660-A138-19813157C69C" xml:space="preserve">// set the repeat definition type
TCalRRule rrule = TCalRRule(EWeekly);
// set interval between each instance 
rrule.SetInterval(1);
// set the start Time 
TCalTime startTime; 
startTime.SetTimeLocalL(TDateTime(2005, EJuly, 26, 0, 0, 0, 0)); 
rpt.SetDtStart(startTime); 
// set the end Time 
TCalTime endTime; 
endTime.SetTimeLocalL(TDateTime(2007, EAugust, 28, 14, 0, 0, 0)); 
rrule.SetUntil(endTime); 
// set the repeat rule in the calendar entry 
entry-&gt;SetRRuleL(rrule); 
// You can set the time zone rules for the entry’s repeat rules
entry-&gt;SetTzRulesL(*tzrule); // tzrule object is of CTzRules type</codeblock> </conbody></concept>