|
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: ESMR wrapper class for date/time sanity checks and updates |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CESMRMEETINGTIMEVALIDATOR_H |
|
20 #define CESMRMEETINGTIMEVALIDATOR_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32std.h> |
|
24 //<cmail> |
|
25 #include "esmrdef.h" |
|
26 //</cmail> |
|
27 #include "mesmrfieldvalidator.h" |
|
28 |
|
29 class CCalEntry; |
|
30 class CEikTimeEditor; |
|
31 class CEikDateEditor; |
|
32 class MESMRCalEntry; |
|
33 class MMRAbsoluteAlarmController; |
|
34 |
|
35 /** |
|
36 * Validator for meetings. |
|
37 * |
|
38 * @lib esmrgui.lib |
|
39 * @see MESMRFieldValidator |
|
40 */ |
|
41 NONSHARABLE_CLASS( CESMRMeetingTimeValidator ) : |
|
42 public CBase, |
|
43 public MESMRFieldValidator |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Symbian constructor. Creates and initializes new |
|
48 * CESMRMeetingTimeValidator object. |
|
49 * @return Pointer to CESMRMeetingTimeValidator object |
|
50 */ |
|
51 static CESMRMeetingTimeValidator* NewL(); |
|
52 |
|
53 /** |
|
54 * C++ Destructor. |
|
55 */ |
|
56 ~CESMRMeetingTimeValidator(); |
|
57 |
|
58 public: // from MESMRFieldValidator |
|
59 MESMRFieldValidator::TESMRFieldValidatorError ValidateL( |
|
60 TBool aCorrectAutomatically ); |
|
61 void ReadValuesFromEntryL( |
|
62 MESMRCalEntry& aEntry ); |
|
63 void StoreValuesToEntryL( |
|
64 MESMRCalEntry& aEntry ); |
|
65 void SetStartTimeFieldL( |
|
66 CEikTimeEditor& aStartTime ); |
|
67 void SetEndTimeFieldL( |
|
68 CEikTimeEditor& aEndTime ); |
|
69 void SetStartDateFieldL( |
|
70 CEikDateEditor& aStartDate ); |
|
71 void SetEndDateFieldL( |
|
72 CEikDateEditor& aEndDate ); |
|
73 void SetAlarmTimeFieldL( |
|
74 CEikTimeEditor& aAlarmTime ); |
|
75 void SetAlarmDateFieldL( |
|
76 CEikDateEditor& aAlarmDate ); |
|
77 void SetRecurrenceUntilDateFieldL( |
|
78 CEikDateEditor& aRecurrenceUntil ); |
|
79 void SetAbsoluteAlarmOnOffFieldL( |
|
80 MMRAbsoluteAlarmController& aAbsoluteAlarmController ); |
|
81 void StartTimeChangedL(); |
|
82 void EndTimeChangedL(); |
|
83 void StartDateChandedL(); |
|
84 void EndDateChangedL(); |
|
85 void AlarmTimeChangedL(); |
|
86 void AlarmDateChangedL(); |
|
87 void RelativeAlarmChangedL( |
|
88 TTimeIntervalMinutes aCurrentAlarmTimeOffset, |
|
89 TBool aHandleAlarmChange, |
|
90 TBool& aRelativeAlarmValid ); |
|
91 void SetAllDayEventL( |
|
92 TBool aAlldayEvent ); |
|
93 void SetAlarmOnOffL( |
|
94 TBool aAlarmOn ); |
|
95 void RecurrenceChangedL( |
|
96 TESMRRecurrenceValue aRecurrence ); |
|
97 void RecurrenceEndDateChangedL(); |
|
98 TBool IsRelativeAlarmValid( |
|
99 TTimeIntervalMinutes aAlarmTimeOffset ); |
|
100 void SetFieldEventQueue( MESMRFieldEventQueue* aEventQueue ); |
|
101 MESMRFieldValidator::TESMRFieldValidatorError ValidateEditedInstanceTimeL(); |
|
102 private: // Implementation |
|
103 CESMRMeetingTimeValidator(); |
|
104 TInt PreValidateEditorContent(); |
|
105 void PreValidateEditorContentL(); |
|
106 void HandleStartTimeChangeL(); |
|
107 void HandleEndTimeChangeL(); |
|
108 void HandleAlarmTimeChangedL(); |
|
109 void HandleRelativeAlarmTimeChangedL(); |
|
110 void HandleRecurrenceTypeChanged(); |
|
111 void HandleRecurrenceEndDateChangedL(); |
|
112 void DrawEditorsDeferred(); |
|
113 TDateTime StartDateTime(); |
|
114 TDateTime EndDateTime(); |
|
115 TDateTime AlarmDateTime(); |
|
116 TDateTime RecurrenceUntilTime(); |
|
117 void ReadAlarmFromEntryL( |
|
118 CCalEntry& aEntry ); |
|
119 void ReadRecurrenceFromEntryL( |
|
120 MESMRCalEntry& aEntry ); |
|
121 void ForceValuesL(); |
|
122 TDateTime ForceEndDateTime(); |
|
123 TTime ForceRecurrenceUntilTime(); |
|
124 void WriteStartAndEndTimeToEntryL( |
|
125 MESMRCalEntry& aEntry ); |
|
126 void SendFieldChangeEventL( TESMREntryFieldId aFieldId ); |
|
127 |
|
128 private: |
|
129 // Ref: Reference to start time editor |
|
130 CEikTimeEditor* iStartTime; |
|
131 // Ref: Reference to end time editor |
|
132 CEikTimeEditor* iEndTime; |
|
133 // Ref: Reference to alarm time editor |
|
134 CEikTimeEditor* iAlarmTime; |
|
135 // Ref: Reference to start date editor |
|
136 CEikDateEditor* iStartDate; |
|
137 // Ref: Reference to end date editor |
|
138 CEikDateEditor* iEndDate; |
|
139 // Ref: Reference to alarm date editor |
|
140 CEikDateEditor* iAlarmDate; |
|
141 /// Ref: Reference to recurrence until date field |
|
142 CEikDateEditor* iRecurrenceUntilDate; |
|
143 // Ref: Reference to absolute alarm on of interface |
|
144 MMRAbsoluteAlarmController* iAbsoluteAlarmController; |
|
145 /// Own: Current recurrence value |
|
146 TESMRRecurrenceValue iRecurrenceValue; |
|
147 /// Ref: Entry being handled |
|
148 MESMRCalEntry* iEntry; |
|
149 /// Own: Current startTime |
|
150 TTime iCurrentStartTime; |
|
151 /// Own: Current end time |
|
152 TTime iCurrentEndTime; |
|
153 /// Own: Current alarm time |
|
154 TTime iCurrentAlarmTime; |
|
155 /// Own: Current recurrence until date |
|
156 TTime iCurrentRecurrenceUntil; |
|
157 /// Own: Start time before allday event |
|
158 TTime iStartTimeBeforeAlldayEvent; |
|
159 /// Own: End time before allday event |
|
160 TTime iEndTimeBeforeAlldayEvent; |
|
161 /// Own: Current alarm time offset |
|
162 TTimeIntervalMinutes iCurrentAlarmTimeOffset; |
|
163 /// Own: Flag if this is allday event |
|
164 TBool iAlldayEvent; |
|
165 /// Own: Flag for absolute alarm |
|
166 TBool iAlarmOnOff; |
|
167 /// Ref: Reference to relative alarm validity value |
|
168 TBool* iRelativeAlarmValid; |
|
169 /// Own: Editors previous start time value for recurrence handling |
|
170 TDateTime iComparativeStartTime; |
|
171 /// Ref: Field event queue |
|
172 MESMRFieldEventQueue* iEventQueue; |
|
173 }; |
|
174 |
|
175 #endif // CESMRMEETINGTIMEVALIDATOR_H |