|
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 To-do time wrapper class for date/time sanity checks |
|
15 * and updates |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CESMRMEMOTIMEVALIDATOR_H |
|
21 #define CESMRMEMOTIMEVALIDATOR_H |
|
22 |
|
23 //<cmail> |
|
24 #include "esmrdef.h" |
|
25 //</cmail> |
|
26 #include <e32base.h> |
|
27 #include <e32std.h> |
|
28 #include "mesmrfieldvalidator.h" |
|
29 |
|
30 class MESMRCalEntry; |
|
31 class CEikTimeEditor; |
|
32 class CEikDateEditor; |
|
33 class MMRAbsoluteAlarmController; |
|
34 |
|
35 /** |
|
36 * Wrapper class handles sanity checks for date/time fields on Memo/Day note |
|
37 * Entry. For example start date can not be after end date. |
|
38 * this calss deals with the cheks for To-do option |
|
39 * InternalizeL() / ExternalizeL() is delegated to this class since those |
|
40 * need sanity checks. Fields (who use this wrapper class) shouldn't react |
|
41 * on ExternalizeL() functions since this wrapper class handles them. On |
|
42 * InternalizeL() they should attach their date/time editors in here. |
|
43 * |
|
44 * @lib esmrgui.lib |
|
45 */ |
|
46 NONSHARABLE_CLASS( CESMRMemoTimeValidator ) : |
|
47 public CBase, |
|
48 public MESMRFieldValidator |
|
49 { |
|
50 |
|
51 public: |
|
52 /** |
|
53 * Two phase constructor. Creates and initializes CESMRMemoTimeValidator |
|
54 * object. |
|
55 * @return Pointer to CESMRMemoTimeValidator object. |
|
56 */ |
|
57 static CESMRMemoTimeValidator* NewL(); |
|
58 |
|
59 /** |
|
60 * C++ destructor. |
|
61 */ |
|
62 ~CESMRMemoTimeValidator(); |
|
63 |
|
64 public: // from MESMRFieldValidator |
|
65 MESMRFieldValidator::TESMRFieldValidatorError ValidateL( |
|
66 TBool aCorrectAutomatically ); |
|
67 void ReadValuesFromEntryL( |
|
68 MESMRCalEntry& aEntry ); |
|
69 void StoreValuesToEntryL( |
|
70 MESMRCalEntry& aEntry ); |
|
71 void SetStartTimeFieldL( |
|
72 CEikTimeEditor& aStartTime ); |
|
73 void SetEndTimeFieldL( |
|
74 CEikTimeEditor& aEndTime ); |
|
75 void SetStartDateFieldL( |
|
76 CEikDateEditor& aStartDate ); |
|
77 void SetEndDateFieldL( |
|
78 CEikDateEditor& aEndDate ); |
|
79 void SetAlarmTimeFieldL( |
|
80 CEikTimeEditor& aAlarmTime ); |
|
81 void SetAlarmDateFieldL( |
|
82 CEikDateEditor& aAlarmDate ); |
|
83 void SetRecurrenceUntilDateFieldL( |
|
84 CEikDateEditor& aRecurrenceUntil ); |
|
85 void SetAbsoluteAlarmOnOffFieldL( |
|
86 MMRAbsoluteAlarmController& aAbsoluteAlarmController ); |
|
87 void StartTimeChangedL(); |
|
88 void EndTimeChangedL(); |
|
89 void StartDateChandedL(); |
|
90 void EndDateChangedL(); |
|
91 void AlarmTimeChangedL(); |
|
92 void AlarmDateChangedL(); |
|
93 void RelativeAlarmChangedL( |
|
94 TTimeIntervalMinutes aCurrentAlarmTimeOffset, |
|
95 TBool aHandleAlarmChange, |
|
96 TBool& aRelativeAlarmValid ); |
|
97 void SetAllDayEventL( |
|
98 TBool aAlldayEvent ); |
|
99 void SetAlarmOnOffL( |
|
100 TBool aAlarmOn ); |
|
101 void RecurrenceChangedL( |
|
102 TESMRRecurrenceValue aRecurrence ); |
|
103 void RecurrenceEndDateChangedL(); |
|
104 TBool IsRelativeAlarmValid( |
|
105 TTimeIntervalMinutes aAlarmTimeOffset ); |
|
106 |
|
107 private: // Implementation |
|
108 CESMRMemoTimeValidator(); |
|
109 TInt PreValidateEditorContent(); |
|
110 void PreValidateEditorContentL(); |
|
111 void DrawEditorsDeferred(); |
|
112 TDateTime StartDateTimeL(); |
|
113 TDateTime EndDateTimeL(); |
|
114 |
|
115 private: // Data |
|
116 /// Ref: Start date editor |
|
117 CEikDateEditor* iStartDate; |
|
118 /// Ref: End date editor |
|
119 CEikDateEditor* iEndDate; |
|
120 /// Own: Current start time. |
|
121 TTime iCurrentStartTime; |
|
122 /// Own: Current end time |
|
123 TTime iCurrentEndTime; |
|
124 /// Ref: Orginal entry |
|
125 MESMRCalEntry* iEntry; |
|
126 }; |
|
127 |
|
128 #endif // CESMRMEMOTIMEVALIDATOR_H |
|
129 |