1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CALRRULE_H__
17 #define __CALRRULE_H__
21 /** Class representing iCal repeat types.
23 This supports the following standard iCal properties:
25 - DTSTART (start date),
27 - COUNT (number of instances),
28 - INTERVAL (interval between instances),
32 - WKST (start day of week).
34 Note that the repeat rule type (FREQ) must be set before any of the following
35 properties can be set, since their behaviour is dependent on the rule type:
36 BYDAY, BYMONTHDAY, BYYEARDAY
38 The WKST parameter is only significant in weekly repeat rules with an interval of
41 The repeat rule type may not be changed once it has been set.
43 If the start date of the entry does not match an instance of its repeat rule then
44 the entry's start date will be moved forward to the first matching instance. For example,
45 if the rule repeats every Wednesday but the start date of the entry is Monday, then the
46 start date will be changed to the Wednesday.
51 NONSHARABLE_CLASS(TCalRRule)
54 /** Types of repeat rule.
61 /** The type has not yet been defined. */
63 /** Rule which repeats based on a number of days. */
65 /** Rule which repeats based on a number of weeks. */
67 /** Rule which repeats based on a number of months. */
69 /** Rule which repeats based on a number of years. */
73 /** Class to represent a weekday within a month.
75 Valid values of iWeekInMonth are 1, 2, 3, 4 for the 1st, 2nd, 3rd and 4th week of
76 the month, or -1 for the last week of the month.
79 The 3rd Wednesday would have iDay = EWednesday and iWeekInMonth = 3.
80 The last Sunday would have iDay = ESunday and iWeekInMonth = -1.
88 IMPORT_C TDayOfMonth(TDay aDay, TInt8 aWeekInMonth);
89 IMPORT_C TDay Day() const;
90 IMPORT_C TInt8 WeekInMonth() const;
97 IMPORT_C TCalRRule(TType aType);
99 IMPORT_C void SetType(TType aType);
100 IMPORT_C TType Type() const;
102 IMPORT_C void SetDtStart(const TCalTime& aTime);
103 IMPORT_C TCalTime DtStart() const;
105 IMPORT_C void SetUntil(const TCalTime& aTime);
106 IMPORT_C TCalTime Until() const;
108 IMPORT_C void SetCount(TUint aCount);
109 IMPORT_C TUint Count() const;
111 IMPORT_C void SetInterval(TInt aInterval);
112 IMPORT_C TInt Interval() const;
114 IMPORT_C void SetByDay(const RArray<TDay>& aDays);
115 IMPORT_C void GetByDayL(RArray<TDay>& aDays) const;
117 IMPORT_C void SetByDay(const RArray<TDayOfMonth>& aDays);
118 IMPORT_C void GetByDayL(RArray<TDayOfMonth>& aDays) const;
120 IMPORT_C void SetByMonthDay(const RArray<TInt>& aMonthDays);
121 IMPORT_C void GetByMonthDayL(RArray<TInt>& aMonthDays) const;
123 IMPORT_C void SetByMonth(const RArray<TMonth> aMonths);
124 IMPORT_C void GetByMonthL(RArray<TMonth>& aMonths) const;
126 IMPORT_C void SetWkSt(TDay aDay);
127 IMPORT_C TDay WkSt() const;
129 void SetUntilAndCount(const TCalTime& aTime, TUint aCount);
132 void InitialiseData();
134 TUint MapToBitsWeekdays(TDay aDay);
136 TBool GetNthBit(TUint aNum) const;
137 void SetNthBit(TUint aNum);
140 TUint64 iBuffer; // stores BYDAY/BYMONTHDAY
151 #endif // __CALRRULE_H__