|
1 /* |
|
2 * Copyright (c) 2009 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: CCalEntry wrapper class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_MRCALENTRY_H |
|
20 #define C_MRCALENTRY_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32std.h> |
|
24 #include <caltime.h> |
|
25 #include <magnentryui.h> |
|
26 #include "mesmrcalentry.h" |
|
27 |
|
28 class CCalEntry; |
|
29 class MESMRCalDbMgr; |
|
30 |
|
31 /** |
|
32 * Provides utility functions for handling calendar entry. |
|
33 */ |
|
34 NONSHARABLE_CLASS( CMRCalEntry ) : |
|
35 public CBase, |
|
36 public MESMRCalEntry |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 * @param aEntry Calendar Entry . |
|
42 * @param aGlobalData Calendar Global data instace. |
|
43 * @param aInstanceTime Entry instance time. |
|
44 * @param aEditorMode Defines: creating new / editing existing / viewing entry |
|
45 */ |
|
46 /*static CMRCalEntry* NewL( |
|
47 CCalEntry& aEntry, |
|
48 MCalenServices& aServices, |
|
49 const TCalTime& aInstanceTime, |
|
50 MAgnEntryUi::TAgnEntryUiEditorMode aEditorMode );*/ |
|
51 |
|
52 static CMRCalEntry* NewL( |
|
53 CCalEntry& aEntry, |
|
54 MESMRCalDbMgr& aCalDb ); |
|
55 |
|
56 /** |
|
57 * C++ destructor. |
|
58 */ |
|
59 ~CMRCalEntry(); |
|
60 |
|
61 /** |
|
62 * Updates the original entry. This is used when user store the entry |
|
63 * without exiting the editor. |
|
64 */ |
|
65 void UpdateComparativeEntryL(); |
|
66 |
|
67 // From MESMRCalEntry |
|
68 |
|
69 TESMRCalEntryType Type() const; |
|
70 MESMRCalEntry& MESMRCalEntryRef(); |
|
71 const MESMRCalEntry& MESMRCalEntryRef() const; |
|
72 const CCalEntry& Entry() const; |
|
73 CCalEntry& Entry(); |
|
74 CCalInstance* InstanceL() const; |
|
75 TBool CanSetRecurrenceL() const; |
|
76 void GetRecurrenceL( TESMRRecurrenceValue& aRecurrence, |
|
77 TTime& aUntil ) const; |
|
78 TBool IsAllDayEventL() const; |
|
79 void SetRecurrenceL( TESMRRecurrenceValue aRecurrence, |
|
80 TTime aUntil = Time::NullTTime() ); |
|
81 void SetAllDayEventL( TTime aStartDate, |
|
82 TTime aEndDate ); |
|
83 TBool IsStoredL() const; |
|
84 TBool IsEntryEditedL() const; |
|
85 TBool IsRecurrentEventL() const; |
|
86 TBool IsEntryTypeChangedL() const; |
|
87 TESMRRecurrenceModifyingRule RecurrenceModRule() const; |
|
88 void SetModifyingRuleL( TESMRRecurrenceModifyingRule aRule, |
|
89 const TBool aTypeChanging = EFalse ); |
|
90 void SetPriorityL( |
|
91 TUint aPriority ); |
|
92 TUint GetPriorityL() const; |
|
93 void GetAlarmL( TESMRAlarmType& aAlarmType, |
|
94 TTime &aAlarmTime ); |
|
95 const CCalEntry& OriginalEntry(); |
|
96 void UpdateEntryAfterStoringL(); |
|
97 void UpdateComparativeEntry( CCalEntry* aNewComparativeEntry ); |
|
98 void SetDefaultValuesToEntryL(); |
|
99 void UpdateTimeStampL(); |
|
100 CCalEntry* CloneEntryLC( TESMRCalEntryType aType ) const; |
|
101 CCalEntry* ValidateEntryL(); |
|
102 CCalEntry* RemoveInstanceFromSeriesL(); |
|
103 MESMRCalDbMgr& GetDBMgr(); |
|
104 TBool SupportsCapabilityL( |
|
105 MESMRCalEntry::TMREntryCapability aCapability ) const; |
|
106 TBool ContainsRemoteAttachmentsL(); |
|
107 void SetTypeChanged( TBool aTypeChanged ); |
|
108 TBool AnyInstancesBetweenTimePeriodL( |
|
109 TTime& aStart, |
|
110 TTime& aEnd ); |
|
111 void GetFirstInstanceStartAndEndTimeL( |
|
112 TTime& aStart, |
|
113 TTime& aEnd ); |
|
114 TBool IsRepeatingMeetingL( |
|
115 const CCalEntry& aEntry) const; |
|
116 |
|
117 private: // Implementation |
|
118 CMRCalEntry( MESMRCalDbMgr& aCalDb ); |
|
119 void ConstructL( |
|
120 CCalEntry& aEntry ); |
|
121 |
|
122 CCalEntry* CreateCopyL( CCalEntry& aSourceEntry ); |
|
123 |
|
124 |
|
125 void CreateInternalEntryL(); |
|
126 void SetDefaultValuesForTodoL(); |
|
127 void SetDefaultValuesForMemoL(); |
|
128 void SetDefaultValuesForMeetingL(); |
|
129 void SetDefaultValuesForAnniversaryL(); |
|
130 inline CCalEntry* DoGetEntry() const; |
|
131 CCalEntry* ValidateMeetingL(); |
|
132 |
|
133 private: // Data |
|
134 /// Ref: Caledar global data utility class |
|
135 // MCalenServices& iServices; // Not owned, don't release here. |
|
136 /// Own: Calendar entry |
|
137 CCalEntry* iEntry; |
|
138 /// Own: Copy of calendar entry instance |
|
139 CCalEntry* iComparativeEntry; |
|
140 /// Own: Copy from client. |
|
141 CCalEntry* iOriginalEntry; |
|
142 /// Own: Entry modifying rule |
|
143 TESMRRecurrenceModifyingRule iRecurrenceModRule; |
|
144 /// Own: Instance time |
|
145 TCalTime iInstanceTime; |
|
146 /// Cal DB Manager mode: |
|
147 MESMRCalDbMgr& iCalDb; |
|
148 // Own: Indicates if the entry is type changed or not |
|
149 TBool iTypeChanged; |
|
150 }; |
|
151 |
|
152 #endif // CBCCALENTRY_H |