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