|
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: Unified Editor Fields definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _CALENUNIFIEDEDITORCONTROL_H |
|
20 #define _CALENUNIFIEDEDITORCONTROL_H |
|
21 |
|
22 // system includes |
|
23 #include <calentry.h> |
|
24 |
|
25 // user includes |
|
26 #include "CalenEditorDataHandler.h" |
|
27 |
|
28 // forward declaration |
|
29 class CCalenUnifiedEditor; |
|
30 class CCalenEventTypeField; |
|
31 class CCalenReminderField; |
|
32 class CCalenRepeatField; |
|
33 class CCalenAllDayField; |
|
34 class CCalenPriorityField; |
|
35 class CCalenDbField; |
|
36 class CCalenDescription; |
|
37 class MCalenServices; |
|
38 |
|
39 /** |
|
40 * CCalenUnifiedEditorControl class declaration |
|
41 */ |
|
42 NONSHARABLE_CLASS( CCalenUnifiedEditorControl ) : public CBase |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * @brief Two phased constructor |
|
47 * @param reference to unified editor |
|
48 * @return returns unified editor fields |
|
49 */ |
|
50 static CCalenUnifiedEditorControl* NewL( |
|
51 CCalenUnifiedEditor& aUnifiedEditor, |
|
52 MCalenServices& aServices ); |
|
53 |
|
54 /** |
|
55 * @brief Destructor |
|
56 */ |
|
57 virtual ~CCalenUnifiedEditorControl(); |
|
58 |
|
59 private: |
|
60 |
|
61 /** |
|
62 * @brief Default constructor |
|
63 * @param reference to unified editor |
|
64 */ |
|
65 CCalenUnifiedEditorControl( CCalenUnifiedEditor& aUnifiedEditor ); |
|
66 |
|
67 /** |
|
68 * @brief Second phase construction |
|
69 */ |
|
70 void ConstructL(MCalenServices& aServices); |
|
71 |
|
72 public: |
|
73 |
|
74 /** |
|
75 * @brief Initializes the dialog's controls before the dialog is sized and |
|
76 * layed out. Empty by default. |
|
77 */ |
|
78 void MakeUnifiedEditorL(); |
|
79 |
|
80 /** |
|
81 * @brief Set data to the collapsed unified editor |
|
82 * @param onLocaleUpdate TBool to indicate locale change impact on this method |
|
83 */ |
|
84 void SetDataToEditorL(TBool onLocaleUpdate = EFalse); |
|
85 |
|
86 /** |
|
87 * @brief Set date of date editor aControlId in form to aTime |
|
88 * @param aControlId control id of the date field |
|
89 * @param aTime holds the user entered time |
|
90 * @param aDoDraw ETrue for redraw other wise EFalse |
|
91 */ |
|
92 void SetDateField( TInt aControlId, |
|
93 const TTime& aTime, |
|
94 TBool aDoDraw = ETrue ); |
|
95 |
|
96 /** |
|
97 * @brief Sets Time in editor |
|
98 * @param aControlId control id of the date field |
|
99 * @param aTime holds the user entered time |
|
100 * @param aDoDraw ETrue for redraw other wise EFalse |
|
101 */ |
|
102 void SetTimeField( TInt aControlId, |
|
103 const TTime& aTime, |
|
104 TBool aDoDraw = ETrue ); |
|
105 |
|
106 /** |
|
107 * @brief Set date of datetime editor aControlId in form to aTime |
|
108 * @param aControlId control id of the date field |
|
109 * @param aTime holds the user entered time |
|
110 * @param aDoDraw ETrue for redraw other wise EFalse |
|
111 */ |
|
112 void SetDateTimeField( TInt aControlId, |
|
113 const TTime& aTime, |
|
114 TBool aDoDraw = ETrue ); |
|
115 |
|
116 /** |
|
117 * @brief Sets alarm field on or off |
|
118 * @param aOnOff ETrue for alarm field ON otherwise EFalse |
|
119 */ |
|
120 void SetAlarmFieldOnOffL( TBool aOnOff ); |
|
121 |
|
122 /** |
|
123 * @brief Check for whether alarm is activated or not |
|
124 * @return TBool returns ETrue for if alarm active otherwise EFalse |
|
125 */ |
|
126 TBool IsAlarmActiveInForm(); |
|
127 |
|
128 /** |
|
129 * @brief check alarm active based on the input |
|
130 * @param aActive ETrue for alarm "ON" otherwise EFalse for alarm "OFF" |
|
131 */ |
|
132 void CheckAlarmActive( TBool aActive ); |
|
133 |
|
134 /** |
|
135 * @brief check ALLDay field value. |
|
136 * @return TBool retunrns ETrue if AllDay field is 'Yes', else EFalse |
|
137 */ |
|
138 TBool IsAllDayEvent(); |
|
139 |
|
140 /** |
|
141 * @brief Set AllDay field text value |
|
142 * @param aYesOrNo |
|
143 */ |
|
144 void SetAllDayFieldL( TBool aYesOrNo ); |
|
145 |
|
146 /** |
|
147 * @brief To set AllDay field value |
|
148 * @param aActive |
|
149 */ |
|
150 void SetAllDayEventL( TBool aActive ); |
|
151 |
|
152 /** |
|
153 * @brief Handles a state change in the control with id aControlId. |
|
154 * Empty by default. |
|
155 * @param aControlId holds the control id for which the state is changed |
|
156 */ |
|
157 void HandleControlStateChangeL( TInt aControlId ); |
|
158 |
|
159 /** |
|
160 * @brief Tries to change focus to the specified line. Fails if the line |
|
161 * ID is not valid. Calls @c PrepareForFocusTransitionL() before |
|
162 * focus is given to the line. |
|
163 * @param aFocusedId control id which is being focused |
|
164 */ |
|
165 void PrepareForFocusTransitionL( TInt aFocusedId ); |
|
166 |
|
167 /** |
|
168 * @brief Handles event type changed |
|
169 * @param aNewEventType Holds the new event type selected in editor |
|
170 */ |
|
171 void OnEventTypeChangedL( CCalEntry::TType aNewEventType ); |
|
172 |
|
173 /** |
|
174 * @brief Reads editor data mainly for collapsed editor |
|
175 * @aContinueOnError used for handling forced exit of the editor |
|
176 */ |
|
177 void ReadDataFromEditorL( TBool aContinueOnError ); |
|
178 |
|
179 /** |
|
180 * @brief Reads subject field from editor |
|
181 */ |
|
182 void ReadSubjectFromEditorL(); |
|
183 |
|
184 /** |
|
185 * @brief Reads start date time from the editor |
|
186 * @param aContinueOnError used for handling forced exit of the editor |
|
187 */ |
|
188 void ReadStartDateTimeFromEditorL( TBool aContinueOnError, TInt aFousedId=0 ); |
|
189 |
|
190 /** |
|
191 * @brief Reads end date time from the editor |
|
192 * @param aContinueOnError used for handling forced exit of the editor |
|
193 */ |
|
194 void ReadEndDateTimeFromEditorL( TBool aContinueOnError ); |
|
195 |
|
196 /** |
|
197 * @brief Reads place field from editor |
|
198 * @param aContinueOnError used for handling forced exit of the editor |
|
199 */ |
|
200 void ReadPlaceFieldFromEditorL( TBool aContinueOnError ); |
|
201 |
|
202 /** |
|
203 * @brief Reads people field from editor |
|
204 * @param aContinueOnError used for handling forced exit of the editor |
|
205 */ |
|
206 void ReadPeopleFieldFromEditorL( TBool aContinueOnError ); |
|
207 |
|
208 /** |
|
209 * @brief Reads attachment field from editor |
|
210 * @param aContinueOnError used for handling forced exit of the editor |
|
211 */ |
|
212 void ReadAttachmentFieldFromEditorL( TBool aContinueOnError ); |
|
213 |
|
214 /** |
|
215 * @brief Reads description field from editor |
|
216 * @aContinueOnError used for handling forced exit of the editor |
|
217 */ |
|
218 void ReadDescriptionFieldFromEditorL( TBool aContinueOnError ); |
|
219 |
|
220 /** |
|
221 * @brief Update editor lines on environment change notifications |
|
222 */ |
|
223 void UpdateLinesOnLocaleChangeL(); |
|
224 |
|
225 /** |
|
226 * Reads the RRule and Rdates for the current CCalEntry. |
|
227 */ |
|
228 void ReadRruleL(TTime& startTime, TTime& endTime); |
|
229 |
|
230 /** |
|
231 * @brief Get start date time from editor |
|
232 * @return TTime holds the start time |
|
233 */ |
|
234 TTime GetStartDateTimeL(); |
|
235 |
|
236 /** |
|
237 * @brief Get end date time from editor |
|
238 * @return TTime holds the end time |
|
239 */ |
|
240 TTime GetEndDateTimeL(); |
|
241 |
|
242 /** |
|
243 * @brief Reads time from editor |
|
244 * @param aControlId controld of the time field |
|
245 * @return TTime returns time |
|
246 */ |
|
247 TTime ReadTimeField( TInt aControlId ); |
|
248 |
|
249 /** |
|
250 * @brief Reads date from form in QHD resolution |
|
251 * @param aControlId controld of the time field |
|
252 * @return TTime returns time |
|
253 */ |
|
254 TTime ReadDateField( TInt aControlId ); |
|
255 |
|
256 /** |
|
257 * @brief Access to the decription field |
|
258 * @return CCalenDescription returns reference to the decription field |
|
259 */ |
|
260 CCalenDescription* Description(); |
|
261 |
|
262 /** |
|
263 * @brief check repeat note querie required |
|
264 * @param aRepeatType |
|
265 */ |
|
266 CCalenEditorDataHandler::TError AskRepeatingNoteQueriesL( |
|
267 CalCommon::TRecurrenceRange& aRepeatType ); |
|
268 |
|
269 |
|
270 TInt GetCalendarIndexForEntryL(); |
|
271 |
|
272 const TDesC& GetCalendarNameForEntryL(); |
|
273 TInt GetCalendarNameForEntryL(const TDesC& aCalendarFileName); |
|
274 |
|
275 /** |
|
276 * @brief Handle error codes related to the editor fields. |
|
277 * @param aError |
|
278 */ |
|
279 void HandleErrorL( const TInt& aError ); |
|
280 |
|
281 private: |
|
282 |
|
283 /** |
|
284 * @brief Adds collapsed editor fields |
|
285 */ |
|
286 void AddDefaultEditorL(); |
|
287 |
|
288 /** |
|
289 * @brief Add collapsed note editor contents |
|
290 */ |
|
291 void AddDefaultNoteEditorL(); |
|
292 |
|
293 /** |
|
294 * @brief Add collapsed birthday editor contents |
|
295 */ |
|
296 void AddDefaultBirthDayEditorL(); |
|
297 |
|
298 /** |
|
299 * @brief Add collapsed meeting editor contents |
|
300 */ |
|
301 void AddDefaultMeetingEditorL(); |
|
302 |
|
303 /** |
|
304 * @brief Add collapsed todo editor contents |
|
305 */ |
|
306 void AddDefaultTodoEditorL(); |
|
307 |
|
308 /** |
|
309 * @brief Initialise default editor contents |
|
310 */ |
|
311 void InitDefaultEditorsL(); |
|
312 |
|
313 /** |
|
314 * @brief Delete previous entry type fields on selcting |
|
315 * the new entry type |
|
316 */ |
|
317 void DeletePreviousEntryTypeFieldsL(); |
|
318 |
|
319 /** |
|
320 * @brief Delete more information fields from unified editor |
|
321 * @param aPreviousEntryType |
|
322 */ |
|
323 void DeleteExtendedEntryFields( CCalEntry::TType aPreviousEntryType ); |
|
324 |
|
325 /** |
|
326 * @brief Add new entry type's editor fields |
|
327 * aParam aNewEventType new event type selected |
|
328 */ |
|
329 void AddNewEntryTypeFieldsL( CCalEntry::TType aNewEventType ); |
|
330 |
|
331 /* |
|
332 * @brief To update end time in editor |
|
333 */ |
|
334 void UpdateEndTimeL(); |
|
335 |
|
336 /** |
|
337 * @brief To to update meeting duration in iMeetingInterval Which is used |
|
338 * in updating the EndTime of editor on StartTime change. |
|
339 */ |
|
340 void UpdateMeetingDurationL(); |
|
341 |
|
342 private: |
|
343 |
|
344 /** |
|
345 * @var iUnifiedEditor |
|
346 * @brief referance to CCalenUnifiedEditor |
|
347 */ |
|
348 CCalenUnifiedEditor& iUnifiedEditor; |
|
349 |
|
350 /** |
|
351 * @var iEventTypeField |
|
352 * @brief To handle Event type field |
|
353 */ |
|
354 CCalenEventTypeField* iEventTypeField; |
|
355 |
|
356 /** |
|
357 * @var iReminderField |
|
358 * @brief To handle Reminder field |
|
359 */ |
|
360 CCalenReminderField* iReminderField; |
|
361 |
|
362 /** |
|
363 * @var iRepeatField |
|
364 * @brief To handle Repeat field |
|
365 */ |
|
366 CCalenRepeatField* iRepeatField; |
|
367 |
|
368 /** |
|
369 * @var iAllDayField |
|
370 * @brief To handle AllDay field |
|
371 */ |
|
372 CCalenAllDayField* iAllDayField; |
|
373 |
|
374 /** |
|
375 * @var iPriorityField |
|
376 * @brief To handle Note Priority field |
|
377 */ |
|
378 CCalenPriorityField* iPriorityField; |
|
379 |
|
380 /** |
|
381 * @var iDbField |
|
382 * @brief To handle Db field |
|
383 */ |
|
384 CCalenDbField* iDbField; |
|
385 |
|
386 /** |
|
387 * @var iDescription |
|
388 * @brief To handle Description field |
|
389 */ |
|
390 CCalenDescription* iDescription; |
|
391 |
|
392 /** |
|
393 * @var iMeetingInterval |
|
394 * @brief To update end time as per Start time change |
|
395 */ |
|
396 TTimeIntervalMinutes iMeetingInterval; |
|
397 |
|
398 }; |
|
399 |
|
400 #endif // _CALENUNIFIEDEDITORCONTROL_H |