|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: PIM item repeat rule converter. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PIMREPEATRULECONVERTER_H |
|
20 #define PIMREPEATRULECONVERTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <calrrule.h> |
|
25 #include "mpimrepeatruledata.h" |
|
26 |
|
27 /** |
|
28 * Event RepeatRuleConverter implementation. The class converts repeat rule |
|
29 * between PIM framework and Agenda model. |
|
30 */ |
|
31 NONSHARABLE_CLASS(PIMRepeatRuleConverter) |
|
32 { |
|
33 public: |
|
34 |
|
35 static CArrayFixFlat< TPIMDate>* DatesL( |
|
36 const MPIMRepeatRuleData& aRepeatRuleData, |
|
37 const TPIMDate& aStartDate, |
|
38 const TPIMDate& aSubsetBeginning, |
|
39 const TPIMDate& aSubsetEnding, |
|
40 CArrayFixFlat< TPIMDate>& aExceptionDates, |
|
41 const TPIMDate& aRepeatRuleEndDate, |
|
42 const TPIMField& aRepeatRuleCount); |
|
43 |
|
44 static TBool IsValidAgendaDate(const TPIMDate& aDate); |
|
45 |
|
46 static TCalRRule ConvertSupportedRepeatToAgnL( |
|
47 const MPIMRepeatRuleData& aSrcPimRRule, TPIMDate aStartDate); |
|
48 |
|
49 static void ConvertSupportedRepeatToPIML(MPIMRepeatRuleData& aDstPimRRule, |
|
50 TCalRRule& aSrcAgnRRule); |
|
51 |
|
52 static TBool IsRepeatFieldPresentL(TPIMField aRepeatRuleField, |
|
53 const MPIMRepeatRuleData& aRepeat); |
|
54 |
|
55 static TBool IsRepeatFieldPresentL(TPIMField aRepeatRuleField, |
|
56 const CArrayFix<TPIMField>& aRepeatFields); |
|
57 |
|
58 private: |
|
59 |
|
60 static TBool AddRepeatDateL( |
|
61 const CArrayFix< TPIMField>& aFields, |
|
62 TTime aDate, |
|
63 TTime aSubsetBeginning, |
|
64 TTime aSubsetEnding, |
|
65 const TTime& aRepeatRuleEndDate, |
|
66 const TInt aRepeatRuleCount, |
|
67 CArrayFixFlat< TPIMDate>** aRepeatDates, |
|
68 TInt* aCountIndex); |
|
69 |
|
70 static TBool CheckDaysInWeekL(const CArrayFix<TPIMField>& aFields, |
|
71 TTime aDate, TTime aSubsetBeginning, TTime aSubsetEnding, |
|
72 TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, |
|
73 const TInt aRepeatRuleDayInWeek, |
|
74 CArrayFixFlat<TPIMDate>** aRepeatDates, TInt* aCount); |
|
75 |
|
76 static TBool CheckDaysInWeekNoMonthChangeL( |
|
77 const CArrayFix<TPIMField>& aFields, TTime aDate, |
|
78 TTime aSubsetBeginning, TTime aSubsetEnding, |
|
79 TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, |
|
80 const TInt aRepeatRuleDayInWeek, |
|
81 CArrayFixFlat<TPIMDate>** aRepeatDates, TInt* aCount); |
|
82 |
|
83 static TBool CheckWeeksInMonthL(const CArrayFix<TPIMField>& aFields, |
|
84 TTime aDate, TTime aSubsetBeginning, TTime aSubsetEnding, |
|
85 TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, |
|
86 const TInt aRepeatRuleWeekInMonth, const TInt aRepeatRuleDayInWeek, |
|
87 CArrayFixFlat<TPIMDate>** aRepeatDates, TInt* aCount); |
|
88 |
|
89 static TBool CheckMonthsInYearL(const CArrayFix<TPIMField>& aFields, |
|
90 TTime aDate, TTime aSubsetBeginning, TTime aSubsetEnding, |
|
91 TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, |
|
92 TInt aRepeatRuleWeekInMonth, TInt aRepeatRuleDayInWeek, |
|
93 TInt aRepeatRuleMonthInYear, TInt aRepeatRuleDayInMonth, |
|
94 CArrayFixFlat<TPIMDate>** aRepeatDates, TInt* aCount); |
|
95 |
|
96 static TBool CheckMonthL(const CArrayFix<TPIMField>& aFields, TTime aDate, |
|
97 TTime aSubsetBeginning, TTime aSubsetEnding, |
|
98 TTime aRepeatRuleEndDate, TInt aRepeatRuleCount, |
|
99 TInt aRepeatRuleWeekInMonth, TInt aRepeatRuleDayInWeek, |
|
100 TInt aRepeatRuleDayInMonth, CArrayFixFlat<TPIMDate>** aRepeatDates, |
|
101 TInt* aCount); |
|
102 |
|
103 static void AddCommonRulesToAgnL(const MPIMRepeatRuleData& aSrcPimRRule, |
|
104 const TTime& aSrcStartDate, TCalRRule& aDstAgnRRule); |
|
105 |
|
106 private: // Hidden constructor |
|
107 |
|
108 PIMRepeatRuleConverter() |
|
109 {} |
|
110 |
|
111 }; |
|
112 |
|
113 #endif // PIMREPEATRULECONVERTER_H |
|
114 // End of File |