author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:17:03 +0300 | |
branch | RCL_3 |
changeset 31 | 97232defd20e |
parent 30 | bd7edf625bdd |
permissions | -rw-r--r-- |
30 | 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 : calendar unified editor fields control |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// system includes |
|
19 |
#include <eikedwin.h> |
|
20 |
#include <eikmfne.h> |
|
21 |
#include <StringLoader.h> |
|
22 |
#include <e32des16.h> |
|
23 |
#include <calentry.h> |
|
24 |
#include <CalenDefaultEditorsData.rsg> |
|
25 |
#include <calendateutils.h> |
|
26 |
#include <calenservices.h> |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
27 |
#include <featmgr.h> |
30 | 28 |
// user includes |
29 |
#include "calenunifiededitorcontrol.h" |
|
30 |
#include "calenunifiededitor.h" |
|
31 |
#include "CalenDefaultEditors.hrh" |
|
32 |
#include "calenentryutil.h" |
|
33 |
#include "caleneventtypefield.h" |
|
34 |
#include "calenreminderfield.h" |
|
35 |
#include "calenrepeatfield.h" |
|
36 |
#include "calenalldayfield.h" |
|
37 |
#include "calenpriorityfield.h" |
|
38 |
#include "calendbfield.h" |
|
39 |
#include "CalenDescription.h" |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
40 |
#include "KoreanLunarDateEditor.h" |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
41 |
#include "KoreanLunarTypeField.h" |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
42 |
|
30 | 43 |
|
44 |
// debug |
|
45 |
#include "calendarui_debug.h" |
|
46 |
||
47 |
// Constants |
|
48 |
const TInt KOneDay( 1 ); |
|
49 |
||
50 |
||
51 |
// ----------------------------------------------------------------------------- |
|
52 |
// CCalenUnifiedEditorControl::NewL |
|
53 |
// Two phased constructor |
|
54 |
// ----------------------------------------------------------------------------- |
|
55 |
// |
|
56 |
CCalenUnifiedEditorControl* CCalenUnifiedEditorControl::NewL( CCalenUnifiedEditor& aUnifiedEditor, |
|
57 |
MCalenServices& aServices ) |
|
58 |
{ |
|
59 |
TRACE_ENTRY_POINT; |
|
60 |
||
61 |
CCalenUnifiedEditorControl* self = new (ELeave)CCalenUnifiedEditorControl( aUnifiedEditor ); |
|
62 |
CleanupStack::PushL( self ); |
|
63 |
self->ConstructL(aServices); |
|
64 |
CleanupStack::Pop(); |
|
65 |
||
66 |
TRACE_EXIT_POINT; |
|
67 |
return self; |
|
68 |
} |
|
69 |
||
70 |
// ----------------------------------------------------------------------------- |
|
71 |
// CCalenUnifiedEditorControl::CCalenUnifiedEditorControl |
|
72 |
// Destructor |
|
73 |
// ----------------------------------------------------------------------------- |
|
74 |
// |
|
75 |
CCalenUnifiedEditorControl::~CCalenUnifiedEditorControl() |
|
76 |
{ |
|
77 |
TRACE_ENTRY_POINT; |
|
78 |
||
79 |
delete iEventTypeField; |
|
80 |
delete iReminderField; |
|
81 |
delete iRepeatField; |
|
82 |
delete iAllDayField; |
|
83 |
delete iPriorityField; |
|
84 |
delete iDbField; |
|
85 |
delete iDescription; |
|
86 |
||
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
87 |
if( iKoreanLunarTypeField ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
88 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
89 |
delete iKoreanLunarTypeField; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
90 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
91 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
92 |
// Do not call UnInitializeLib() if InitalizeLib() leaves. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
93 |
if ( iFeatMgrInitialized ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
94 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
95 |
// Frees the TLS. Must be done after FeatureManager is used. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
96 |
FeatureManager::UnInitializeLib(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
97 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
98 |
|
30 | 99 |
TRACE_EXIT_POINT; |
100 |
} |
|
101 |
||
102 |
// ----------------------------------------------------------------------------- |
|
103 |
// CCalenUnifiedEditorControl::ConstructL |
|
104 |
// Second phased construction |
|
105 |
// ----------------------------------------------------------------------------- |
|
106 |
// |
|
107 |
void CCalenUnifiedEditorControl::ConstructL(MCalenServices& aServices) |
|
108 |
{ |
|
109 |
TRACE_ENTRY_POINT; |
|
110 |
||
111 |
iEventTypeField = CCalenEventTypeField::NewL( iUnifiedEditor ); |
|
112 |
iReminderField = CCalenReminderField::NewL( iUnifiedEditor ); |
|
113 |
iRepeatField = CCalenRepeatField::NewL( iUnifiedEditor ); |
|
114 |
iAllDayField = CCalenAllDayField::NewL( iUnifiedEditor ); |
|
115 |
iPriorityField = CCalenPriorityField::NewL( iUnifiedEditor ); |
|
116 |
iDbField = CCalenDbField::NewL( iUnifiedEditor,aServices ); |
|
117 |
iDescription = CCalenDescription::NewL( iUnifiedEditor ); |
|
118 |
||
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
119 |
// Sets up TLS, must be done before FeatureManager is used. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
120 |
FeatureManager::InitializeLibL(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
121 |
// Used in destructor. |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
122 |
iFeatMgrInitialized = ETrue; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
123 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
124 |
if( FeatureManager::FeatureSupported( KFeatureIdKorean ) ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
125 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
126 |
iKoreanLunarTypeField = CKoreanLunarTypeField::NewL( iUnifiedEditor ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
127 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
128 |
|
30 | 129 |
TRACE_EXIT_POINT; |
130 |
} |
|
131 |
||
132 |
// ----------------------------------------------------------------------------- |
|
133 |
// CCalenUnifiedEditorControl::CCalenUnifiedEditorControl |
|
134 |
// Default constructor |
|
135 |
// ----------------------------------------------------------------------------- |
|
136 |
// |
|
137 |
CCalenUnifiedEditorControl::CCalenUnifiedEditorControl( CCalenUnifiedEditor& aUnifiedEditor ) |
|
138 |
:iUnifiedEditor( aUnifiedEditor ) |
|
139 |
{ |
|
140 |
TRACE_ENTRY_POINT; |
|
141 |
TRACE_EXIT_POINT; |
|
142 |
} |
|
143 |
||
144 |
// ----------------------------------------------------------------------------- |
|
145 |
// CCalenUnifiedEditorControl::MakeUnifiedEditorL |
|
146 |
// Initializes the dialog's controls before the dialog is sized |
|
147 |
// ----------------------------------------------------------------------------- |
|
148 |
// |
|
149 |
void CCalenUnifiedEditorControl::MakeUnifiedEditorL() |
|
150 |
{ |
|
151 |
TRACE_ENTRY_POINT; |
|
152 |
||
153 |
// Add default editor fields. |
|
154 |
AddDefaultEditorL(); |
|
155 |
// Initialise editor fields. |
|
156 |
InitDefaultEditorsL(); |
|
157 |
// Set data to editor fields. |
|
158 |
SetDataToEditorL(); |
|
159 |
||
160 |
// Update MSK string. |
|
161 |
iUnifiedEditor.SetMskFromResourceL(); |
|
162 |
iUnifiedEditor.UpdateFormL(); |
|
163 |
||
164 |
TRACE_EXIT_POINT; |
|
165 |
} |
|
166 |
||
167 |
// ----------------------------------------------------------------------------- |
|
168 |
// CCalenUnifiedEditorControl::SetDataToEditorL |
|
169 |
// Set data to the collapsed unified editor |
|
170 |
// ----------------------------------------------------------------------------- |
|
171 |
// |
|
172 |
void CCalenUnifiedEditorControl::SetDataToEditorL(TBool onLocaleUpdate) |
|
173 |
{ |
|
174 |
TRACE_ENTRY_POINT; |
|
175 |
||
176 |
// Set Editor field values |
|
177 |
||
178 |
// Set data to EventType fields |
|
179 |
iEventTypeField->SetDataToEditorL(); |
|
180 |
||
181 |
TPtrC subject = iUnifiedEditor.Edited().Summary().Left( |
|
182 |
iUnifiedEditor.MaxTextEditorLength() ); |
|
183 |
||
184 |
if(!onLocaleUpdate) |
|
185 |
iUnifiedEditor.SetEditorTextL( ECalenEditorSubject, &subject ); |
|
186 |
||
187 |
||
188 |
||
189 |
// update duration for EndTime update, with StartTime change |
|
190 |
UpdateMeetingDurationL(); |
|
191 |
||
192 |
switch( iUnifiedEditor.GetEntryType() ) |
|
193 |
{ |
|
194 |
case CCalEntry::EEvent: |
|
195 |
{ |
|
196 |
iAllDayField->SetDataToEditorL(); |
|
197 |
} |
|
198 |
break; |
|
199 |
case CCalEntry::EAnniv: |
|
200 |
{ |
|
201 |
TTime birthDayYear = iUnifiedEditor.Edited().EventDateTime(); |
|
202 |
SetDateField( ECalenEditorStartDate, birthDayYear, ETrue ); |
|
203 |
} |
|
204 |
break; |
|
205 |
case CCalEntry::EAppt: |
|
206 |
{ |
|
207 |
if( iUnifiedEditor.Edited().IsAllDayEvent() ) |
|
208 |
{ |
|
209 |
iAllDayField->SetDataToEditorL(); |
|
210 |
} |
|
211 |
else |
|
212 |
{ |
|
213 |
// Entry is Non-AllDay event |
|
214 |
TTime firstRDate; |
|
215 |
TTime rruleEndTime ; |
|
216 |
TTimeIntervalMinutes duration; |
|
217 |
||
218 |
TTime entryStartTime = iUnifiedEditor.Edited().StartDateTime(); |
|
219 |
TTime entryEndTime = iUnifiedEditor.Edited().EndDateTime(); |
|
220 |
||
221 |
User::LeaveIfError( entryEndTime.MinutesFrom( entryStartTime, duration ) ); |
|
222 |
||
223 |
ReadRruleL(firstRDate,rruleEndTime); |
|
224 |
||
225 |
if( firstRDate <= entryStartTime) |
|
226 |
{ |
|
227 |
SetTimeField( ECalenEditorStartTime, firstRDate, ETrue ); |
|
228 |
SetTimeField( ECalenEditorEndTime, rruleEndTime, ETrue ); |
|
229 |
SetDateField( ECalenEditorStartDate, firstRDate, ETrue); |
|
230 |
SetDateField( ECalenEditorEndDate, rruleEndTime, ETrue); |
|
231 |
} |
|
232 |
else{ |
|
233 |
SetTimeField( ECalenEditorStartTime, entryStartTime, ETrue ); |
|
234 |
SetTimeField( ECalenEditorEndTime, entryEndTime, ETrue ); |
|
235 |
SetDateField( ECalenEditorStartDate, entryStartTime, ETrue); |
|
236 |
SetDateField( ECalenEditorEndDate, entryEndTime, ETrue); |
|
237 |
} |
|
238 |
} |
|
239 |
||
240 |
} |
|
241 |
break; |
|
242 |
case CCalEntry::ETodo: |
|
243 |
{ |
|
244 |
TTime dueDate = iUnifiedEditor.Edited().EventDateTime(); |
|
245 |
||
246 |
// update date field with todays date |
|
247 |
SetDateField(ECalenEditorStartDate, dueDate, ETrue); |
|
248 |
// set priority field value |
|
249 |
iPriorityField->SetDataToEditorL(); |
|
250 |
||
251 |
} |
|
252 |
break; |
|
253 |
default: |
|
254 |
break; |
|
255 |
} |
|
256 |
||
257 |
iReminderField->SetDataToEditorL(); |
|
258 |
||
259 |
// Anniversary, To-do, exceptional and single instance of repeat entry |
|
260 |
// do not have Repeat field. |
|
261 |
if( CCalEntry::EAnniv != iUnifiedEditor.GetEntryType() |
|
262 |
&& CCalEntry::ETodo != iUnifiedEditor.GetEntryType() ) |
|
263 |
{ |
|
264 |
iRepeatField->SetDataToEditorL(); |
|
265 |
} |
|
266 |
||
267 |
if(!iDbField->IsCalendarEdited()) |
|
268 |
{ |
|
269 |
iDbField->SetDataToEditorL(); |
|
270 |
} |
|
271 |
||
272 |
if( CCalEntry::ETodo != iUnifiedEditor.GetEntryType() ) |
|
273 |
{ |
|
274 |
TPtrC location = iUnifiedEditor.Edited().Location().Left( |
|
275 |
iUnifiedEditor.MaxTextEditorLength() ); |
|
276 |
||
277 |
if(!onLocaleUpdate) |
|
278 |
iUnifiedEditor.SetEditorTextL( ECalenEditorPlace, &location ); |
|
279 |
} |
|
280 |
||
281 |
// TODO: Uncomment this when enabling attachment support |
|
282 |
iUnifiedEditor.SetAttachmentNamesToEditorL(); |
|
283 |
||
284 |
TRACE_EXIT_POINT; |
|
285 |
} |
|
286 |
||
287 |
// ----------------------------------------------------------------------------- |
|
288 |
// CCalenUnifiedEditorControl::AddDefaultEditorL |
|
289 |
// Adds editor fields |
|
290 |
// ----------------------------------------------------------------------------- |
|
291 |
// |
|
292 |
void CCalenUnifiedEditorControl::AddDefaultEditorL() |
|
293 |
{ |
|
294 |
TRACE_ENTRY_POINT; |
|
295 |
||
296 |
switch( iUnifiedEditor.GetEntryType() ) |
|
297 |
{ |
|
298 |
case CCalEntry::EEvent: |
|
299 |
{ |
|
300 |
AddDefaultMeetingEditorL(); |
|
301 |
} |
|
302 |
break; |
|
303 |
case CCalEntry::EAnniv: |
|
304 |
{ |
|
305 |
AddDefaultBirthDayEditorL(); |
|
306 |
} |
|
307 |
break; |
|
308 |
case CCalEntry::EAppt: |
|
309 |
{ |
|
310 |
AddDefaultMeetingEditorL(); |
|
311 |
} |
|
312 |
break; |
|
313 |
case CCalEntry::ETodo: |
|
314 |
{ |
|
315 |
AddDefaultTodoEditorL(); |
|
316 |
} |
|
317 |
break; |
|
318 |
default: |
|
319 |
break; |
|
320 |
} |
|
321 |
||
322 |
TRACE_EXIT_POINT; |
|
323 |
} |
|
324 |
||
325 |
// ----------------------------------------------------------------------------- |
|
326 |
// CCalenUnifiedEditorControl::InitDefaultEditorsL |
|
327 |
// Initialise default editor contents |
|
328 |
// ----------------------------------------------------------------------------- |
|
329 |
// |
|
330 |
void CCalenUnifiedEditorControl::InitDefaultEditorsL() |
|
331 |
{ |
|
332 |
TRACE_ENTRY_POINT; |
|
333 |
||
334 |
// Set editor lengths |
|
335 |
CEikEdwin* edwin = static_cast<CEikEdwin*>( iUnifiedEditor.Control( ECalenEditorSubject ) ); |
|
336 |
edwin->SetTextLimit( iUnifiedEditor.MaxTextEditorLength() ); |
|
337 |
||
338 |
iEventTypeField->InitEventTypeFieldLayoutL(); |
|
339 |
||
340 |
//Currently nothig to be initalized |
|
341 |
//as its intial value depend on entry |
|
342 |
iAllDayField->InitAllDayFieldLayoutL(); |
|
343 |
||
344 |
||
345 |
iReminderField->InitReminderFieldLdayoutL(); |
|
346 |
||
347 |
// To Initialise priority field for meeting tyrpe entry |
|
348 |
if( CCalEntry::ETodo == iUnifiedEditor.GetEntryType() ) |
|
349 |
{ |
|
350 |
iPriorityField->InitPriorityFieldLayoutL(); |
|
351 |
} |
|
352 |
||
353 |
// Initialise repeat field, if it's not Anniversary. |
|
354 |
// To-do entry don't have repeat field, for now |
|
355 |
if( CCalEntry::EAnniv != iUnifiedEditor.GetEntryType() && |
|
356 |
CCalEntry::ETodo != iUnifiedEditor.GetEntryType() ) |
|
357 |
{ |
|
358 |
iRepeatField->InitRepetFieldLayoutL(); |
|
359 |
} |
|
360 |
||
361 |
RPointerArray<CCalCalendarInfo> calendarInfoList; |
|
362 |
iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList); |
|
363 |
CleanupClosePushL( calendarInfoList ); |
|
364 |
if( calendarInfoList.Count() > 1 ) |
|
365 |
{ |
|
366 |
iDbField->InitDbFieldLayoutL(); |
|
367 |
} |
|
368 |
CleanupStack::PopAndDestroy( &calendarInfoList ); |
|
369 |
||
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
370 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
371 |
if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
372 |
&& FeatureManager::FeatureSupported( KFeatureIdKorean ) ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
373 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
374 |
iKoreanLunarTypeField->PreLayoutDynInitL(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
375 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
376 |
|
30 | 377 |
iDescription->InitDescritpionFieldLayoutL(); |
378 |
||
379 |
TRACE_EXIT_POINT; |
|
380 |
} |
|
381 |
||
382 |
// ----------------------------------------------------------------------------- |
|
383 |
// CCalenUnifiedEditorControl::AddDefaultBirthDayEditorL |
|
384 |
// Add collapsed birthday editor contents |
|
385 |
// ----------------------------------------------------------------------------- |
|
386 |
// |
|
387 |
void CCalenUnifiedEditorControl::AddDefaultBirthDayEditorL() |
|
388 |
{ |
|
389 |
TRACE_ENTRY_POINT; |
|
390 |
// event type, subject, date & year,more details |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
391 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
392 |
TInt prevItem = 0; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
393 |
prevItem=ECalenEditorSubject; |
30 | 394 |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
395 |
if(FeatureManager::FeatureSupported( KFeatureIdKorean )) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
396 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
397 |
iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_NOTEVIEW_TYPE_LINE, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
398 |
EKoreanLunarTypeSelectSolarLunarLeap, ECalenEditorSubject ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
399 |
prevItem=EKoreanLunarTypeSelectSolarLunarLeap; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
400 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
401 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
402 |
TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
403 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
404 |
if( type != ESolar && FeatureManager::FeatureSupported( KFeatureIdKorean )) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
405 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
406 |
iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_DATE_EDITOR_LINE, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
407 |
EKoreanLunarAniversityStart, prevItem ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
408 |
prevItem=EKoreanLunarAniversityStart; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
409 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
410 |
TTime birthDayYear = iUnifiedEditor.Edited().EventDateTime(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
411 |
SetDateField( ECalenEditorStartDate, birthDayYear, ETrue ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
412 |
} |
30 | 413 |
else |
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
414 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
415 |
RPointerArray<CCalCalendarInfo> calendarInfoList; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
416 |
iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
417 |
CleanupClosePushL( calendarInfoList ); |
30 | 418 |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
419 |
if( calendarInfoList.Count() > 1 ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
420 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
421 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
422 |
ECalenEditorDBName, prevItem ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
423 |
prevItem = ECalenEditorDBName; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
424 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
425 |
ECalenEditorStartDate, prevItem ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
426 |
prevItem=ECalenEditorStartDate; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
427 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
428 |
else |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
429 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
430 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
431 |
ECalenEditorStartDate, prevItem ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
432 |
prevItem = ECalenEditorStartDate; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
433 |
} |
30 | 434 |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
435 |
CleanupStack::PopAndDestroy( &calendarInfoList ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
436 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
437 |
// "Start Date" Label should be "Date of Birth" for Birthday |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
438 |
iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
439 |
R_QTN_CALEN_EDITOR_DATE_OF_BIRTH ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
440 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
441 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
442 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
443 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_ITEM, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
444 |
ECalenEditorReminder, prevItem ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
445 |
|
30 | 446 |
|
447 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PLACE_ITEM, |
|
448 |
ECalenEditorPlace, ECalenEditorReminder ); |
|
449 |
||
450 |
// TODO: Uncomment this when enabling attachment support |
|
451 |
// Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement |
|
452 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM, |
|
453 |
ECalenEditorAttachment, ECalenEditorPlace ); |
|
454 |
||
455 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DESCRIPTION_ITEM, |
|
456 |
ECalenEditorDescription, ECalenEditorAttachment ); |
|
457 |
iUnifiedEditor.UpdateFormL(); |
|
458 |
TRACE_EXIT_POINT; |
|
459 |
} |
|
460 |
||
461 |
// ----------------------------------------------------------------------------- |
|
462 |
// CCalenUnifiedEditorControl::AddDefaultMeetingEditorL |
|
463 |
// Add meeting editor contents |
|
464 |
// ----------------------------------------------------------------------------- |
|
465 |
// |
|
466 |
void CCalenUnifiedEditorControl::AddDefaultMeetingEditorL() |
|
467 |
{ |
|
468 |
TRACE_ENTRY_POINT; |
|
469 |
// non all day event |
|
470 |
// event type,subject,all day,start time,end time,start date, |
|
471 |
// end date,place,more details |
|
472 |
||
473 |
// all day event |
|
474 |
// subject,event type,all day,start date,end date,place,more details |
|
475 |
||
476 |
RPointerArray<CCalCalendarInfo> calendarInfoList; |
|
477 |
iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList); |
|
478 |
CleanupClosePushL( calendarInfoList ); |
|
479 |
||
480 |
if( calendarInfoList.Count() > 1 ) |
|
481 |
{ |
|
482 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM, |
|
483 |
ECalenEditorDBName, ECalenEditorSubject ); |
|
484 |
||
485 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ALL_DAY_ITEM, |
|
486 |
ECalenEditorAllDayItem, ECalenEditorDBName ); |
|
487 |
} |
|
488 |
else |
|
489 |
{ |
|
490 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ALL_DAY_ITEM, |
|
491 |
ECalenEditorAllDayItem, ECalenEditorSubject ); |
|
492 |
} |
|
493 |
||
494 |
CleanupStack::PopAndDestroy( &calendarInfoList ); |
|
495 |
||
496 |
if( !iUnifiedEditor.Edited().IsAllDayEvent() ) |
|
497 |
{ |
|
498 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_TIME_ITEM, |
|
499 |
ECalenEditorStartTime, ECalenEditorAllDayItem ); |
|
500 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_END_TIME_ITEM, |
|
501 |
ECalenEditorEndTime, ECalenEditorStartTime ); |
|
502 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
503 |
ECalenEditorStartDate, ECalenEditorEndTime ); |
|
504 |
} |
|
505 |
else |
|
506 |
{ |
|
507 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
508 |
ECalenEditorStartDate, ECalenEditorAllDayItem ); |
|
509 |
} |
|
510 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_END_DATE_ITEM, |
|
511 |
ECalenEditorEndDate, ECalenEditorStartDate ); |
|
512 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PLACE_ITEM, |
|
513 |
ECalenEditorPlace, ECalenEditorEndDate ); |
|
514 |
||
515 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_ITEM, |
|
516 |
ECalenEditorReminder, ECalenEditorPlace ); |
|
517 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REPEAT_ITEM, |
|
518 |
ECalenEditorRepeat, ECalenEditorReminder ); |
|
519 |
/*iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PEOPLE_ITEM, |
|
520 |
ECalenEditorPeople, ECalenEditorRepeat ); |
|
521 |
*/ |
|
522 |
/* iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM, |
|
523 |
ECalenEditorDBName, ECalenEditorRepeat ); |
|
524 |
*/ |
|
525 |
// TODO: Uncomment this when enabling attachment support |
|
526 |
// Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement |
|
527 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM, |
|
528 |
ECalenEditorAttachment, ECalenEditorRepeat ); |
|
529 |
||
530 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DESCRIPTION_ITEM, |
|
531 |
ECalenEditorDescription, ECalenEditorAttachment ); |
|
532 |
iUnifiedEditor.UpdateFormL(); |
|
533 |
TRACE_EXIT_POINT; |
|
534 |
} |
|
535 |
||
536 |
// ----------------------------------------------------------------------------- |
|
537 |
// CCalenUnifiedEditorControl::AddDefaultTodoEditorL |
|
538 |
// Add collapsed todo editor contents |
|
539 |
// ----------------------------------------------------------------------------- |
|
540 |
// |
|
541 |
void CCalenUnifiedEditorControl::AddDefaultTodoEditorL() |
|
542 |
{ |
|
543 |
TRACE_ENTRY_POINT; |
|
544 |
// event type,subject,due date,more details |
|
545 |
RPointerArray<CCalCalendarInfo> calendarInfoList; |
|
546 |
iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList); |
|
547 |
CleanupClosePushL( calendarInfoList ); |
|
548 |
||
549 |
if( calendarInfoList.Count() > 1 ) |
|
550 |
{ |
|
551 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM, |
|
552 |
ECalenEditorDBName, ECalenEditorSubject ); |
|
553 |
||
554 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
555 |
ECalenEditorStartDate, ECalenEditorDBName ); |
|
556 |
} |
|
557 |
else |
|
558 |
{ |
|
559 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
560 |
ECalenEditorStartDate, ECalenEditorSubject ); |
|
561 |
} |
|
562 |
||
563 |
CleanupStack::PopAndDestroy( &calendarInfoList ); |
|
564 |
||
565 |
// "Start Date" Label should be "Due date" for To-Do |
|
566 |
iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate, |
|
567 |
R_QTN_CALEN_EDITOR_DUE_DATE ); |
|
568 |
||
569 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_ITEM, |
|
570 |
ECalenEditorReminder, ECalenEditorStartDate ); |
|
571 |
||
572 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PRIORITY_ITEM, |
|
573 |
ECalenEditorPriority, ECalenEditorReminder ); |
|
574 |
||
575 |
/*iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM, |
|
576 |
ECalenEditorDBName, ECalenEditorPriority );*/ |
|
577 |
||
578 |
// TODO: Uncomment this when enabling attachment support |
|
579 |
// Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement |
|
580 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_ATTACHMENT_ITEM, |
|
581 |
ECalenEditorAttachment, ECalenEditorPriority ); |
|
582 |
||
583 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DESCRIPTION_ITEM, |
|
584 |
ECalenEditorDescription, ECalenEditorAttachment ); |
|
585 |
iUnifiedEditor.UpdateFormL(); |
|
586 |
TRACE_EXIT_POINT; |
|
587 |
} |
|
588 |
||
589 |
// ----------------------------------------------------------------------------- |
|
590 |
// CCalenUnifiedEditorControl::SetTimeField |
|
591 |
// Sets the time field in touch layouts |
|
592 |
// ----------------------------------------------------------------------------- |
|
593 |
// |
|
594 |
void CCalenUnifiedEditorControl::SetTimeField( TInt aControlId, const TTime& aTime , |
|
595 |
TBool aDoDraw ) |
|
596 |
{ |
|
597 |
TRACE_ENTRY_POINT; |
|
598 |
||
599 |
CEikTimeEditor* timeField = |
|
600 |
static_cast<CEikTimeEditor*>( iUnifiedEditor.ControlOrNull( aControlId ) ); |
|
601 |
if( timeField ) |
|
602 |
{ |
|
603 |
timeField->SetTime( aTime ); |
|
604 |
if ( aDoDraw ) |
|
605 |
{ |
|
606 |
timeField->DrawDeferred(); |
|
607 |
} |
|
608 |
} |
|
609 |
||
610 |
TRACE_EXIT_POINT; |
|
611 |
} |
|
612 |
||
613 |
// ----------------------------------------------------------------------------- |
|
614 |
// CCalenUnifiedEditorControl::SetDateField |
|
615 |
// Sets a date field to the given TTime. |
|
616 |
// ----------------------------------------------------------------------------- |
|
617 |
// |
|
618 |
void CCalenUnifiedEditorControl::SetDateField( TInt aControlId, const TTime& aTime, |
|
619 |
TBool aDoDraw ) |
|
620 |
{ |
|
621 |
TRACE_ENTRY_POINT; |
|
622 |
||
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
623 |
TBool useLunarDate = EFalse; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
624 |
if(aControlId == ECalenEditorStartDate |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
625 |
&& FeatureManager::FeatureSupported( KFeatureIdKorean )) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
626 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
627 |
if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
628 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
629 |
TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
630 |
if( type != ESolar ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
631 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
632 |
useLunarDate = ETrue; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
633 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
634 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
635 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
636 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
637 |
if(useLunarDate || aControlId == EKoreanLunarAniversityStart |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
638 |
&& FeatureManager::FeatureSupported( KFeatureIdKorean ) ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
639 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
640 |
CKoreanLunarDateEditor* dateField = NULL; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
641 |
dateField = static_cast<CKoreanLunarDateEditor*>( iUnifiedEditor.ControlOrNull( EKoreanLunarAniversityStart ) ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
642 |
if( dateField ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
643 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
644 |
dateField->SetDate(aTime, EFalse); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
645 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
646 |
if ( aDoDraw ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
647 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
648 |
dateField->DrawDeferred(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
649 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
650 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
651 |
else |
30 | 652 |
{ |
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
653 |
CEikDateEditor* dateField = NULL; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
654 |
dateField = static_cast<CEikDateEditor*>( iUnifiedEditor.ControlOrNull( aControlId ) ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
655 |
if( dateField ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
656 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
657 |
dateField->SetDate( aTime ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
658 |
if( aDoDraw ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
659 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
660 |
dateField->DrawDeferred(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
661 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
662 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
663 |
} |
30 | 664 |
TRACE_EXIT_POINT; |
665 |
} |
|
666 |
||
667 |
// ----------------------------------------------------------------------------- |
|
668 |
// CCalenUnifiedEditorControl::SetDateTimeField |
|
669 |
// Update date and time field |
|
670 |
// ----------------------------------------------------------------------------- |
|
671 |
void CCalenUnifiedEditorControl::SetDateTimeField( TInt aControlId, const TTime& aTime, |
|
672 |
TBool aDoDraw ) |
|
673 |
{ |
|
674 |
TRACE_ENTRY_POINT; |
|
675 |
||
676 |
CEikTimeAndDateEditor* dateTimeField = NULL; |
|
677 |
dateTimeField = static_cast<CEikTimeAndDateEditor*>( iUnifiedEditor.ControlOrNull( aControlId ) ); |
|
678 |
if( dateTimeField ) |
|
679 |
{ |
|
680 |
dateTimeField->SetTimeAndDate( aTime ); |
|
681 |
if( aDoDraw ) |
|
682 |
{ |
|
683 |
dateTimeField->DrawDeferred(); |
|
684 |
} |
|
685 |
} |
|
686 |
||
687 |
TRACE_EXIT_POINT; |
|
688 |
} |
|
689 |
||
690 |
// ----------------------------------------------------------------------------- |
|
691 |
// CCalenUnifiedEditorControl::SetAlarmFieldOnOffL |
|
692 |
// Set alarm field on or off |
|
693 |
// ----------------------------------------------------------------------------- |
|
694 |
// |
|
695 |
void CCalenUnifiedEditorControl::SetAlarmFieldOnOffL( TBool aOnOff ) |
|
696 |
{ |
|
697 |
TRACE_ENTRY_POINT; |
|
698 |
||
699 |
iUnifiedEditor.SetAlarmFieldOnOffL( aOnOff ); |
|
700 |
||
701 |
TRACE_EXIT_POINT; |
|
702 |
} |
|
703 |
||
704 |
// ----------------------------------------------------------------------------- |
|
705 |
// CCalenUnifiedEditorControl::SetAlarmFieldOnOffL |
|
706 |
// Set alarm field on or off |
|
707 |
// ----------------------------------------------------------------------------- |
|
708 |
// |
|
709 |
void CCalenUnifiedEditorControl::SetAllDayFieldL( TBool aYesNo ) |
|
710 |
{ |
|
711 |
TRACE_ENTRY_POINT; |
|
712 |
||
713 |
iUnifiedEditor.SetAllDayFieldL( aYesNo ); |
|
714 |
||
715 |
TRACE_EXIT_POINT; |
|
716 |
} |
|
717 |
||
718 |
||
719 |
// ----------------------------------------------------------------------------- |
|
720 |
// CCalenUnifiedEditorControl::IsAlarmActiveInForm |
|
721 |
// Check for whether alarm is activated or not |
|
722 |
// ----------------------------------------------------------------------------- |
|
723 |
// |
|
724 |
TBool CCalenUnifiedEditorControl::IsAlarmActiveInForm() |
|
725 |
{ |
|
726 |
TRACE_ENTRY_POINT; |
|
727 |
TRACE_EXIT_POINT; |
|
728 |
return iReminderField->IsAlarmActiveInForm(); |
|
729 |
} |
|
730 |
||
731 |
// ----------------------------------------------------------------------------- |
|
732 |
// CCalenUnifiedEditorControl::CheckAlarmActive |
|
733 |
// check alarm active based on the input |
|
734 |
// ----------------------------------------------------------------------------- |
|
735 |
// |
|
736 |
void CCalenUnifiedEditorControl::CheckAlarmActive( TBool aActive ) |
|
737 |
{ |
|
738 |
TRACE_ENTRY_POINT; |
|
739 |
||
740 |
iReminderField->CheckAlarmActive( aActive ); |
|
741 |
||
742 |
TRACE_EXIT_POINT |
|
743 |
} |
|
744 |
||
745 |
// ----------------------------------------------------------------------------- |
|
746 |
// CCalenUnifiedEditorControl::IsAllDayEvent |
|
747 |
// To check value of AllDay field |
|
748 |
// ----------------------------------------------------------------------------- |
|
749 |
// |
|
750 |
TBool CCalenUnifiedEditorControl::IsAllDayEvent() |
|
751 |
{ |
|
752 |
TRACE_ENTRY_POINT; |
|
753 |
||
754 |
return iAllDayField->IsAllDayEvent(); |
|
755 |
||
756 |
TRACE_EXIT_POINT; |
|
757 |
} |
|
758 |
||
759 |
// ----------------------------------------------------------------------------- |
|
760 |
// CCalenUnifiedEditorControl::SetAllDayEvent |
|
761 |
// To Set AllDay field value |
|
762 |
// ----------------------------------------------------------------------------- |
|
763 |
// |
|
764 |
void CCalenUnifiedEditorControl::SetAllDayEventL( TBool aActive ) |
|
765 |
{ |
|
766 |
TRACE_ENTRY_POINT; |
|
767 |
||
768 |
iAllDayField->SetAllDayEvent( aActive ); |
|
769 |
//set defalut alarmtime when allday field is activated/deactivated |
|
770 |
if(iUnifiedEditor.EditorFields().IsAlarmActiveInForm()) |
|
771 |
{ |
|
772 |
iUnifiedEditor.EditorDataHandler().SetDefaultAlarmDateTimeL(); |
|
773 |
iReminderField->SetDataToEditorL(); |
|
774 |
} |
|
775 |
||
776 |
TRACE_EXIT_POINT |
|
777 |
} |
|
778 |
||
779 |
// ----------------------------------------------------------------------------- |
|
780 |
// CCalenUnifiedEditorControl::HandleControlStateChangeL |
|
781 |
// Handles a state change in the control with id aControlId. |
|
782 |
// ----------------------------------------------------------------------------- |
|
783 |
// |
|
784 |
void CCalenUnifiedEditorControl::HandleControlStateChangeL( TInt aControlId ) |
|
785 |
{ |
|
786 |
TRACE_ENTRY_POINT; |
|
787 |
||
788 |
switch( aControlId ) |
|
789 |
{ |
|
790 |
case ECalenEditorEventType: |
|
791 |
{ |
|
792 |
iEventTypeField->HandleControlStateChangeL( aControlId ); |
|
793 |
} |
|
794 |
break; |
|
795 |
case ECalenEditorReminder: |
|
796 |
{ |
|
797 |
iReminderField->HandleControlStateChangeL( aControlId ); |
|
798 |
} |
|
799 |
break; |
|
800 |
case ECalenEditorRepeat: |
|
801 |
{ |
|
802 |
iRepeatField->HandleControlStateChangeL( aControlId ); |
|
803 |
} |
|
804 |
break; |
|
805 |
case ECalenEditorDBName: |
|
806 |
{ |
|
807 |
iDbField->HandleControlStateChangeL( aControlId ); |
|
808 |
} |
|
809 |
break; |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
810 |
case EKoreanLunarTypeSelectSolarLunarLeap: |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
811 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
812 |
if (FeatureManager::FeatureSupported( KFeatureIdKorean )) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
813 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
814 |
iKoreanLunarTypeField->HandleControlStateChangeL( aControlId ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
815 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
816 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
817 |
break; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
818 |
case EKoreanLunarAniversityStart: |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
819 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
820 |
iKoreanLunarDateEditor->HandleControlStateChangeL( aControlId ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
821 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
822 |
|
30 | 823 |
default: |
824 |
break; |
|
825 |
} |
|
826 |
||
827 |
TRACE_EXIT_POINT; |
|
828 |
} |
|
829 |
||
830 |
// ----------------------------------------------------------------------------- |
|
831 |
// CCalenUnifiedEditorControl::PrepareForFocusTransitionL |
|
832 |
// Tries to change focus to the specified line. |
|
833 |
// ----------------------------------------------------------------------------- |
|
834 |
// |
|
835 |
void CCalenUnifiedEditorControl::PrepareForFocusTransitionL( TInt aFocusedId ) |
|
836 |
{ |
|
837 |
switch( aFocusedId ) |
|
838 |
{ |
|
839 |
case ECalenEditorSubject: |
|
840 |
{ |
|
841 |
ReadSubjectFromEditorL(); |
|
842 |
} |
|
843 |
break; |
|
844 |
case ECalenEditorEventType: |
|
845 |
{ |
|
846 |
iEventTypeField->PrepareForFocusTransitionL( aFocusedId ); |
|
847 |
} |
|
848 |
break; |
|
849 |
||
850 |
case ECalenEditorStartTime: |
|
851 |
case ECalenEditorStartDate: |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
852 |
case EKoreanLunarAniversityStart: |
30 | 853 |
{ |
854 |
ReadStartDateTimeFromEditorL( ETrue, aFocusedId ); |
|
855 |
UpdateMeetingDurationL(); |
|
856 |
} |
|
857 |
break; |
|
858 |
||
859 |
case ECalenEditorEndDate: |
|
860 |
case ECalenEditorEndTime: |
|
861 |
{ |
|
862 |
ReadEndDateTimeFromEditorL( ETrue ); |
|
863 |
UpdateMeetingDurationL(); |
|
864 |
} |
|
865 |
break; |
|
866 |
||
867 |
case ECalenEditorBirthDayYear: |
|
868 |
break; |
|
869 |
||
870 |
case ECalenEditorDueDate: |
|
871 |
break; |
|
872 |
||
873 |
// todo: Need to check, ECalenEditorDueDate can be removed? |
|
874 |
case ECalenEditorAllDayItem: |
|
875 |
{ |
|
876 |
iAllDayField->PrepareForFocusTransitionL( aFocusedId ); |
|
877 |
} |
|
878 |
break; |
|
879 |
||
880 |
case ECalenEditorPriority: |
|
881 |
{ |
|
882 |
iPriorityField->PrepareForFocusTransitionL( aFocusedId ); |
|
883 |
} |
|
884 |
break; |
|
885 |
||
886 |
case ECalenEditorPlace: |
|
887 |
{ |
|
888 |
ReadPlaceFieldFromEditorL( ETrue ); |
|
889 |
} |
|
890 |
break; |
|
891 |
||
892 |
case ECalenEditorRepeat: |
|
893 |
{ |
|
894 |
iRepeatField->PrepareForFocusTransitionL( aFocusedId ); |
|
895 |
} |
|
896 |
break; |
|
897 |
||
898 |
case ECalenEditorDBName: |
|
899 |
{ |
|
900 |
iDbField->PrepareForFocusTransitionL( aFocusedId ); |
|
901 |
} |
|
902 |
break; |
|
903 |
case ECalenEditorAttachment: |
|
904 |
break; |
|
905 |
case ECalenEditorDescription: |
|
906 |
break; |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
907 |
case EKoreanLunarTypeSelectSolarLunarLeap: |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
908 |
break; |
30 | 909 |
default: |
910 |
break; |
|
911 |
} |
|
912 |
||
913 |
iReminderField->PrepareForFocusTransitionL( aFocusedId ); |
|
914 |
||
915 |
} |
|
916 |
||
917 |
// ----------------------------------------------------------------------------- |
|
918 |
// CCalenUnifiedEditorControl::OnEventTypeChangedL |
|
919 |
// Handles event type changed |
|
920 |
// ----------------------------------------------------------------------------- |
|
921 |
// |
|
922 |
void CCalenUnifiedEditorControl::OnEventTypeChangedL( CCalEntry::TType aNewEventType ) |
|
923 |
{ |
|
924 |
TRACE_ENTRY_POINT; |
|
925 |
||
926 |
if(iUnifiedEditor.GetEntryType() != aNewEventType) |
|
927 |
{ |
|
928 |
// update Entry type of Edited entry |
|
929 |
iUnifiedEditor.Edited().SetEntryType( aNewEventType ); |
|
930 |
||
931 |
// Delete, previous entry type fields from editor |
|
932 |
DeletePreviousEntryTypeFieldsL(); |
|
933 |
||
934 |
// Add new fiedls to editor |
|
935 |
AddNewEntryTypeFieldsL( aNewEventType ); |
|
936 |
iUnifiedEditor.SetEntryType( aNewEventType ); |
|
937 |
||
938 |
// after changing the event type, update the fields with default values |
|
939 |
InitDefaultEditorsL(); |
|
940 |
SetDataToEditorL(); |
|
941 |
||
942 |
iUnifiedEditor.UpdateFormL(); |
|
943 |
} |
|
944 |
||
945 |
TRACE_EXIT_POINT; |
|
946 |
} |
|
947 |
||
948 |
// ----------------------------------------------------------------------------- |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
949 |
// CCalenUnifiedEditorControl::OnLunarTypeChangedL |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
950 |
// Handles lunar type changed |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
951 |
// ----------------------------------------------------------------------------- |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
952 |
// |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
953 |
void CCalenUnifiedEditorControl::OnLunarTypeChangedL( TLunarCalendarType aNewEventType ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
954 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
955 |
TRACE_ENTRY_POINT; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
956 |
if( FeatureManager::FeatureSupported( KFeatureIdKorean ) ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
957 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
958 |
TLunarCalendarType oldType = iUnifiedEditor.Edited().CalendarType(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
959 |
if(oldType != aNewEventType) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
960 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
961 |
iUnifiedEditor.Edited().SetCalendarTypeL(aNewEventType); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
962 |
if(aNewEventType == ESolar) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
963 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
964 |
iUnifiedEditor.DeleteLine(EKoreanLunarAniversityStart, ETrue); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
965 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
966 |
ECalenEditorStartDate, EKoreanLunarTypeSelectSolarLunarLeap ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
967 |
iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
968 |
R_QTN_CALEN_EDITOR_DATE_OF_BIRTH ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
969 |
SetDataToEditorL(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
970 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
971 |
else |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
972 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
973 |
if(oldType == ESolar) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
974 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
975 |
iUnifiedEditor.DeleteLine(ECalenEditorStartDate, ETrue); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
976 |
iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_DATE_EDITOR_LINE, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
977 |
EKoreanLunarAniversityStart, EKoreanLunarTypeSelectSolarLunarLeap ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
978 |
SetDataToEditorL(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
979 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
980 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
981 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
982 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
983 |
TRACE_EXIT_POINT; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
984 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
985 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
986 |
// ----------------------------------------------------------------------------- |
30 | 987 |
// CCalenUnifiedEditorControl::DeletePreviousEntryTypeFieldsL |
988 |
// Delete previous entry type fields on selcting |
|
989 |
// the new entry type |
|
990 |
// ----------------------------------------------------------------------------- |
|
991 |
// |
|
992 |
void CCalenUnifiedEditorControl::DeletePreviousEntryTypeFieldsL() |
|
993 |
{ |
|
994 |
TRACE_ENTRY_POINT; |
|
995 |
CCalEntry::TType previousEntryType = iUnifiedEditor.GetEntryType(); |
|
996 |
switch( previousEntryType ) |
|
997 |
{ |
|
998 |
case CCalEntry::EEvent: |
|
999 |
{ |
|
1000 |
// Delete AllDay, StartDate, EndDate, and Place fields |
|
1001 |
iUnifiedEditor.DeleteLine( ECalenEditorAllDayItem, EFalse ); |
|
1002 |
iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
|
1003 |
iUnifiedEditor.DeleteLine( ECalenEditorEndDate, EFalse ); |
|
1004 |
iUnifiedEditor.DeleteLine( ECalenEditorPlace, EFalse ); |
|
1005 |
} |
|
1006 |
break; |
|
1007 |
case CCalEntry::EAnniv: |
|
1008 |
{ |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1009 |
TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1010 |
if( type != ESolar && FeatureManager::FeatureSupported( KFeatureIdKorean ) ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1011 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1012 |
iUnifiedEditor.DeleteLine( EKoreanLunarAniversityStart, EFalse ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1013 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1014 |
else |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1015 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1016 |
iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1017 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1018 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1019 |
if(FeatureManager::FeatureSupported( KFeatureIdKorean )) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1020 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1021 |
iUnifiedEditor.DeleteLine( EKoreanLunarTypeSelectSolarLunarLeap, EFalse ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1022 |
} |
30 | 1023 |
} |
1024 |
break; |
|
1025 |
case CCalEntry::EAppt: |
|
1026 |
{ |
|
1027 |
if( iUnifiedEditor.Edited().IsAllDayEvent() ) |
|
1028 |
{ |
|
1029 |
// Delete, AllDay event fields from Editor |
|
1030 |
iUnifiedEditor.DeleteLine( ECalenEditorAllDayItem, EFalse ); |
|
1031 |
} |
|
1032 |
else |
|
1033 |
{ |
|
1034 |
// Delete, Non-AllDay event fields from Editor |
|
1035 |
iUnifiedEditor.DeleteLine( ECalenEditorAllDayItem, EFalse ); |
|
1036 |
iUnifiedEditor.DeleteLine( ECalenEditorStartTime, EFalse ); |
|
1037 |
iUnifiedEditor.DeleteLine( ECalenEditorEndTime, EFalse ); |
|
1038 |
} |
|
1039 |
iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
|
1040 |
iUnifiedEditor.DeleteLine( ECalenEditorEndDate, EFalse ); |
|
1041 |
iUnifiedEditor.DeleteLine( ECalenEditorPlace, EFalse ); |
|
1042 |
||
1043 |
||
1044 |
} |
|
1045 |
break; |
|
1046 |
case CCalEntry::ETodo: |
|
1047 |
{ |
|
1048 |
iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
|
1049 |
iUnifiedEditor.DeleteLine( ECalenEditorPriority, EFalse ); |
|
1050 |
} |
|
1051 |
break; |
|
1052 |
default: |
|
1053 |
break; |
|
1054 |
} |
|
1055 |
||
1056 |
// Delete, extra fields added to editor for more entry details |
|
1057 |
DeleteExtendedEntryFields( previousEntryType ); |
|
1058 |
||
1059 |
TRACE_EXIT_POINT; |
|
1060 |
} |
|
1061 |
||
1062 |
// ----------------------------------------------------------------------------- |
|
1063 |
// CCalenUnifiedEditorControl::DeleteExtendedEntryfields |
|
1064 |
// Delete previous entry type more information fields |
|
1065 |
// ----------------------------------------------------------------------------- |
|
1066 |
// |
|
1067 |
void CCalenUnifiedEditorControl::DeleteExtendedEntryFields( CCalEntry::TType aPreviousEntryType ) |
|
1068 |
{ |
|
1069 |
||
1070 |
// If Reminder field is in 'ON' state, delete Reminder Date, time fields |
|
1071 |
if( iReminderField->IsAlarmActiveInForm() ) |
|
1072 |
{ |
|
1073 |
CCoeControl* alarmDateCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorReminderDate ); |
|
1074 |
CCoeControl* alarmTimeCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorReminderTime ); |
|
1075 |
||
1076 |
if( alarmTimeCtrl ) |
|
1077 |
{ |
|
1078 |
iUnifiedEditor.DeleteLine( ECalenEditorReminderTime, EFalse ); |
|
1079 |
} |
|
1080 |
if( alarmDateCtrl ) |
|
1081 |
{ |
|
1082 |
iUnifiedEditor.DeleteLine( ECalenEditorReminderDate, EFalse ); |
|
1083 |
} |
|
1084 |
} |
|
1085 |
||
1086 |
iUnifiedEditor.DeleteLine( ECalenEditorReminder,EFalse ); |
|
1087 |
||
1088 |
/*CCoeControl* PeopleFieldCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorPeople ); |
|
1089 |
if( PeopleFieldCtrl ) |
|
1090 |
{ |
|
1091 |
iUnifiedEditor.DeleteLine( ECalenEditorPeople ); |
|
1092 |
} |
|
1093 |
*/ |
|
1094 |
CCoeControl* dbNameCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorDBName ); |
|
1095 |
if( dbNameCtrl ) |
|
1096 |
{ |
|
1097 |
iUnifiedEditor.DeleteLine( ECalenEditorDBName,EFalse ); |
|
1098 |
} |
|
1099 |
// TODO: Uncomment this when enabling attachment support |
|
1100 |
iUnifiedEditor.DeleteLine( ECalenEditorAttachment,EFalse ); |
|
1101 |
||
1102 |
iUnifiedEditor.DeleteLine( ECalenEditorDescription,EFalse ); |
|
1103 |
||
1104 |
// To-Do do not have place field |
|
1105 |
CCoeControl* editorPlaceCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorPlace ); |
|
1106 |
if( editorPlaceCtrl ) |
|
1107 |
{ |
|
1108 |
iUnifiedEditor.DeleteLine( ECalenEditorPlace,EFalse ); |
|
1109 |
} |
|
1110 |
||
1111 |
// Anniversary & To-Do entry, do not have Repeat field |
|
1112 |
if( ( aPreviousEntryType != CCalEntry::EAnniv ) || |
|
1113 |
( aPreviousEntryType != CCalEntry::ETodo ) ) |
|
1114 |
{ |
|
1115 |
// Delete Repeat field. |
|
1116 |
CCoeControl* repeatCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorRepeat ); |
|
1117 |
CCoeControl* repeatUntilCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorRepeatUntil ); |
|
1118 |
if( repeatCtrl ) |
|
1119 |
{ |
|
1120 |
iUnifiedEditor.DeleteLine( ECalenEditorRepeat,EFalse ); |
|
1121 |
} |
|
1122 |
if( repeatUntilCtrl ) |
|
1123 |
{ |
|
1124 |
iUnifiedEditor.DeleteLine( ECalenEditorRepeatUntil,EFalse ); |
|
1125 |
} |
|
1126 |
} |
|
1127 |
} |
|
1128 |
||
1129 |
// ----------------------------------------------------------------------------- |
|
1130 |
// CCalenUnifiedEditorControl::AddNewEntryTypeFieldsL |
|
1131 |
// Add new entry type's editor fields |
|
1132 |
// ----------------------------------------------------------------------------- |
|
1133 |
// |
|
1134 |
void CCalenUnifiedEditorControl::AddNewEntryTypeFieldsL( CCalEntry::TType aNewEventType ) |
|
1135 |
{ |
|
1136 |
TRACE_ENTRY_POINT; |
|
1137 |
||
1138 |
switch( aNewEventType ) |
|
1139 |
{ |
|
1140 |
case CCalEntry::EEvent: |
|
1141 |
case CCalEntry::EAppt: |
|
1142 |
{ |
|
1143 |
AddDefaultMeetingEditorL(); |
|
1144 |
} |
|
1145 |
break; |
|
1146 |
case CCalEntry::EAnniv: |
|
1147 |
{ |
|
1148 |
AddDefaultBirthDayEditorL(); |
|
1149 |
} |
|
1150 |
break; |
|
1151 |
case CCalEntry::ETodo: |
|
1152 |
{ |
|
1153 |
AddDefaultTodoEditorL(); |
|
1154 |
} |
|
1155 |
break; |
|
1156 |
default: |
|
1157 |
break; |
|
1158 |
} |
|
1159 |
TRACE_EXIT_POINT; |
|
1160 |
} |
|
1161 |
||
1162 |
// ----------------------------------------------------------------------------- |
|
1163 |
// CCalenUnifiedEditorControl::AskRepeatingNoteQueriesL |
|
1164 |
// Add new entry type's editor fields |
|
1165 |
// ----------------------------------------------------------------------------- |
|
1166 |
// |
|
1167 |
CCalenEditorDataHandler::TError CCalenUnifiedEditorControl::AskRepeatingNoteQueriesL( |
|
1168 |
CalCommon::TRecurrenceRange& aRepeatType ) |
|
1169 |
{ |
|
1170 |
TRACE_ENTRY_POINT; |
|
1171 |
TRACE_EXIT_POINT; |
|
1172 |
return iRepeatField->AskRepeatingNoteQueriesL( aRepeatType ); |
|
1173 |
||
1174 |
} |
|
1175 |
||
1176 |
// ----------------------------------------------------------------------------- |
|
1177 |
// CCalenUnifiedEditorControl::ReadDataFromEditorL |
|
1178 |
// Reads editor data mainly for collapsed editor |
|
1179 |
// ----------------------------------------------------------------------------- |
|
1180 |
// |
|
1181 |
void CCalenUnifiedEditorControl::ReadDataFromEditorL( TBool aContinueOnError ) |
|
1182 |
{ |
|
1183 |
TRACE_ENTRY_POINT; |
|
1184 |
// Read data from the editor |
|
1185 |
ReadSubjectFromEditorL(); |
|
1186 |
ReadStartDateTimeFromEditorL( aContinueOnError ); |
|
1187 |
ReadEndDateTimeFromEditorL( aContinueOnError ); |
|
1188 |
||
1189 |
// ToDo do not have Place field |
|
1190 |
if( iUnifiedEditor.GetEntryType() != CCalEntry::ETodo ) |
|
1191 |
{ |
|
1192 |
ReadPlaceFieldFromEditorL( aContinueOnError ); |
|
1193 |
} |
|
1194 |
||
1195 |
// TODO: Uncomment this when enabling attachment support |
|
1196 |
ReadAttachmentFieldFromEditorL( aContinueOnError ); |
|
1197 |
ReadDescriptionFieldFromEditorL( aContinueOnError ); |
|
1198 |
||
1199 |
iReminderField->ReadDataFromFormL( aContinueOnError ); |
|
1200 |
||
1201 |
if( iUnifiedEditor.GetEntryType() == CCalEntry::ETodo ) |
|
1202 |
{ |
|
1203 |
iUnifiedEditor.Edited().SetNonRepeatingL(); |
|
1204 |
iPriorityField->ReadDataFromFormL( aContinueOnError ); |
|
1205 |
} |
|
1206 |
else |
|
1207 |
{ |
|
1208 |
// Anniversary, Exceptional and Single instance of repeat enty |
|
1209 |
// do not have repeat field in editor |
|
1210 |
CCoeControl* repeatCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorRepeat ); |
|
1211 |
if( repeatCtrl ) |
|
1212 |
{ |
|
1213 |
iRepeatField->ReadDataFromFormL( aContinueOnError ); |
|
1214 |
} |
|
1215 |
} |
|
1216 |
||
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1217 |
if( iUnifiedEditor.GetEntryType() == CCalEntry::EAnniv |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1218 |
&& FeatureManager::FeatureSupported( KFeatureIdKorean ) ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1219 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1220 |
CCoeControl* lunarcaltype = iUnifiedEditor.ControlOrNull( EKoreanLunarTypeSelectSolarLunarLeap ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1221 |
if( lunarcaltype ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1222 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1223 |
iKoreanLunarTypeField->ReadDataFromFormL( aContinueOnError ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1224 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1225 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1226 |
|
30 | 1227 |
iDbField->ReadDataFromFormL( aContinueOnError ); |
1228 |
||
1229 |
TRACE_EXIT_POINT; |
|
1230 |
} |
|
1231 |
||
1232 |
// ----------------------------------------------------------------------------- |
|
1233 |
// CCalenUnifiedEditorControl::ReadSubjectFromEditorL |
|
1234 |
// Reads subject field from editor |
|
1235 |
// ----------------------------------------------------------------------------- |
|
1236 |
// |
|
1237 |
void CCalenUnifiedEditorControl::ReadSubjectFromEditorL() |
|
1238 |
{ |
|
1239 |
TRACE_ENTRY_POINT; |
|
1240 |
iUnifiedEditor.ReadSubjectFromEditorL(); |
|
1241 |
TRACE_ENTRY_POINT; |
|
1242 |
} |
|
1243 |
||
1244 |
// ----------------------------------------------------------------------------- |
|
1245 |
// CCalenUnifiedEditorControl::ReadStartDateTimeFromEditorL |
|
1246 |
// Reads start date time from the editor |
|
1247 |
// ----------------------------------------------------------------------------- |
|
1248 |
// |
|
1249 |
void CCalenUnifiedEditorControl::ReadStartDateTimeFromEditorL( TBool aContinueOnError , TInt /* aFocusedId */ ) |
|
1250 |
{ |
|
1251 |
TRACE_ENTRY_POINT; |
|
1252 |
||
1253 |
TTime start = iUnifiedEditor.Edited().StartDateTime(); |
|
1254 |
TDateTime startDT = start.DateTime(); |
|
1255 |
||
1256 |
// Reading time field leaves, if it contains empty values. |
|
1257 |
// When editors are forced to exit, we want to continue reading |
|
1258 |
// other fields, even if one time field contains empty values |
|
1259 |
if( aContinueOnError ) |
|
1260 |
{ |
|
1261 |
PIM_TRAPD_HANDLE( ( start = GetStartDateTimeL() ) ); |
|
1262 |
} |
|
1263 |
else |
|
1264 |
{ |
|
1265 |
// Allow this function to leave. |
|
1266 |
start = GetStartDateTimeL(); |
|
1267 |
} |
|
1268 |
startDT = start.DateTime(); |
|
1269 |
iUnifiedEditor.Edited().SetStartDateTimeL( start ); |
|
1270 |
||
1271 |
UpdateEndTimeL(); |
|
1272 |
||
1273 |
TRACE_EXIT_POINT; |
|
1274 |
} |
|
1275 |
||
1276 |
// ----------------------------------------------------------------------------- |
|
1277 |
// CCalenUnifiedEditorControl::ReadStartDateTimeFromEditorL |
|
1278 |
// Reads End date time from the editor |
|
1279 |
// ----------------------------------------------------------------------------- |
|
1280 |
// |
|
1281 |
void CCalenUnifiedEditorControl::ReadEndDateTimeFromEditorL( TBool aContinueOnError ) |
|
1282 |
{ |
|
1283 |
TRACE_ENTRY_POINT; |
|
1284 |
||
1285 |
TTime end; |
|
1286 |
TDateTime endDT; |
|
1287 |
||
1288 |
// Reading time field leaves, if it contains empty values. |
|
1289 |
// When editors are forced to exit, we want to continue reading |
|
1290 |
// other fields, even if one time field contains empty values |
|
1291 |
if( aContinueOnError ) |
|
1292 |
{ |
|
1293 |
PIM_TRAPD_HANDLE( ( end = GetEndDateTimeL() ) ); |
|
1294 |
} |
|
1295 |
else |
|
1296 |
{ |
|
1297 |
// Allow this function to leave. |
|
1298 |
end = GetEndDateTimeL(); |
|
1299 |
} |
|
1300 |
endDT = end.DateTime(); |
|
1301 |
||
1302 |
iUnifiedEditor.Edited().SetEndDateTimeL( end ); |
|
1303 |
||
1304 |
TRACE_EXIT_POINT; |
|
1305 |
} |
|
1306 |
||
1307 |
// ----------------------------------------------------------------------------- |
|
1308 |
// CCalenUnifiedEditorControl::GetStartDateTimeL |
|
1309 |
// Get start date time from editor |
|
1310 |
// ----------------------------------------------------------------------------- |
|
1311 |
// |
|
1312 |
TTime CCalenUnifiedEditorControl::GetStartDateTimeL() |
|
1313 |
{ |
|
1314 |
TRACE_ENTRY_POINT; |
|
1315 |
||
1316 |
TTime result = ReadTimeField( ECalenEditorStartDate ); |
|
1317 |
TDateTime resDT = result.DateTime(); |
|
1318 |
CCoeControl* startTimeCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorStartTime ); |
|
1319 |
||
1320 |
// For non-timed event and AllDay event StatTime field |
|
1321 |
// does n't exit, so do not read StartTime. |
|
1322 |
if( startTimeCtrl ) |
|
1323 |
{ |
|
1324 |
TTime timeOfDate = ReadTimeField( ECalenEditorStartTime ); |
|
1325 |
if( timeOfDate > 0 ) |
|
1326 |
{ |
|
1327 |
TDateTime timeOfDayTime = timeOfDate.DateTime(); |
|
1328 |
result += TTimeIntervalHours( timeOfDayTime.Hour() ); |
|
1329 |
result += TTimeIntervalMinutes( timeOfDayTime.Minute() ); |
|
1330 |
} |
|
1331 |
} |
|
1332 |
else |
|
1333 |
{ |
|
1334 |
// To set time as beginning of the day |
|
1335 |
result = CalenDateUtils::BeginningOfDay( result ); |
|
1336 |
} |
|
1337 |
||
1338 |
if( iAllDayField->IsAllDayEvent() ) |
|
1339 |
{ |
|
1340 |
TTime endDate = iUnifiedEditor.Edited().EndDateTime(); |
|
1341 |
endDate = CalenDateUtils::BeginningOfDay( endDate ); |
|
1342 |
iUnifiedEditor.Edited().SetEndDateTimeL(endDate); |
|
1343 |
} |
|
1344 |
||
1345 |
resDT = result.DateTime(); |
|
1346 |
TRACE_EXIT_POINT; |
|
1347 |
return result; |
|
1348 |
} |
|
1349 |
||
1350 |
// ----------------------------------------------------------------------------- |
|
1351 |
// CCalenUnifiedEditorControl::GetEndDateTimeL |
|
1352 |
// Get end date time from editor |
|
1353 |
// ----------------------------------------------------------------------------- |
|
1354 |
// |
|
1355 |
TTime CCalenUnifiedEditorControl::GetEndDateTimeL() |
|
1356 |
{ |
|
1357 |
TRACE_ENTRY_POINT; |
|
1358 |
TTime result; |
|
1359 |
CCoeControl* endDateCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorEndDate); |
|
1360 |
if( endDateCtrl ) |
|
1361 |
{ |
|
1362 |
result = ReadDateField( ECalenEditorEndDate ); |
|
1363 |
CCoeControl* endTimeCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorEndTime ); |
|
1364 |
// for AllDay event do not have EndTime |
|
1365 |
// so, do not read EndTime for them. |
|
1366 |
if( endTimeCtrl ) |
|
1367 |
{ |
|
1368 |
TTime timeOfDate = ReadTimeField( ECalenEditorEndTime ); |
|
1369 |
if( timeOfDate > 0 ) |
|
1370 |
{ |
|
1371 |
TDateTime timeOfDayTime = timeOfDate.DateTime(); |
|
1372 |
result += TTimeIntervalHours( timeOfDayTime.Hour() ); |
|
1373 |
result += TTimeIntervalMinutes( timeOfDayTime.Minute() ); |
|
1374 |
} |
|
1375 |
} |
|
1376 |
else |
|
1377 |
{ |
|
1378 |
// To set time as beginning of the day |
|
1379 |
result = CalenDateUtils::BeginningOfDay( result ); |
|
1380 |
} |
|
1381 |
||
1382 |
if( iAllDayField->IsAllDayEvent() ) |
|
1383 |
{ |
|
1384 |
// For allday (1 day) event Eg. "Start:- 12:00am, 15-08-2010 & End:-12:00am, 16-08-2010" |
|
1385 |
// In Editor it should be displayed as "StartDate: 15-08-2010 & EndDate:15-08-2010" |
|
1386 |
// But, while saving EndDate is saved as 12:00am, 16-08-2010. |
|
1387 |
TTime startDate = iUnifiedEditor.Edited().StartDateTime(); |
|
1388 |
startDate = CalenDateUtils::BeginningOfDay( startDate ); |
|
1389 |
iUnifiedEditor.Edited().SetStartDateTimeL(startDate); |
|
1390 |
||
1391 |
if( result >= startDate && (!iUnifiedEditor.iCheck ) || iUnifiedEditor.Edited().EntryType() == CCalEntry::EEvent) |
|
1392 |
{ |
|
1393 |
result += TTimeIntervalDays( KOneDay ); |
|
1394 |
} |
|
1395 |
} |
|
1396 |
||
1397 |
} |
|
1398 |
else |
|
1399 |
{ |
|
1400 |
// For entries Anniversary/Todo there is no EndDate field |
|
1401 |
// For them EndDate is same as StartDate |
|
1402 |
result = ReadDateField( ECalenEditorStartDate ); |
|
1403 |
} |
|
1404 |
||
1405 |
TRACE_EXIT_POINT; |
|
1406 |
return result; |
|
1407 |
} |
|
1408 |
||
1409 |
// ----------------------------------------------------------------------------- |
|
1410 |
// CCalenUnifiedEditorControl::ReadTimeField |
|
1411 |
// Reads time from editor |
|
1412 |
// ----------------------------------------------------------------------------- |
|
1413 |
// |
|
1414 |
TTime CCalenUnifiedEditorControl::ReadTimeField( TInt aControlId ) |
|
1415 |
{ |
|
1416 |
TRACE_ENTRY_POINT; |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1417 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1418 |
if(aControlId == ECalenEditorStartDate && FeatureManager::FeatureSupported( KFeatureIdKorean )) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1419 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1420 |
if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1421 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1422 |
TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1423 |
if( type != ESolar ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1424 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1425 |
aControlId = EKoreanLunarAniversityStart; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1426 |
TRACE_EXIT_POINT; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1427 |
return static_cast<CKoreanLunarDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1428 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1429 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1430 |
} |
30 | 1431 |
TRACE_EXIT_POINT; |
1432 |
return static_cast<CEikTTimeEditor*>( iUnifiedEditor.Control( aControlId ) )->GetTTime(); |
|
1433 |
} |
|
1434 |
||
1435 |
// ----------------------------------------------------------------------------- |
|
1436 |
// CCalenUnifiedEditorControl::ReadDateField |
|
1437 |
// Reads date from editor |
|
1438 |
// ----------------------------------------------------------------------------- |
|
1439 |
// |
|
1440 |
TTime CCalenUnifiedEditorControl::ReadDateField( TInt aControlId ) |
|
1441 |
{ |
|
1442 |
TRACE_ENTRY_POINT; |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1443 |
|
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1444 |
if(aControlId == ECalenEditorStartDate && FeatureManager::FeatureSupported( KFeatureIdKorean )) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1445 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1446 |
if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1447 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1448 |
TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1449 |
if( type != ESolar ) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1450 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1451 |
aControlId = EKoreanLunarAniversityStart; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1452 |
TRACE_EXIT_POINT; |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1453 |
return static_cast<CKoreanLunarDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1454 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1455 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1456 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1457 |
|
30 | 1458 |
TRACE_EXIT_POINT; |
1459 |
return static_cast<CEikDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date(); |
|
1460 |
} |
|
1461 |
||
1462 |
// ----------------------------------------------------------------------------- |
|
1463 |
// CCalenUnifiedEditorControl::ReadPlaceFieldFromEditorL |
|
1464 |
// Reads place field from editor |
|
1465 |
// ----------------------------------------------------------------------------- |
|
1466 |
// |
|
1467 |
void CCalenUnifiedEditorControl::ReadPlaceFieldFromEditorL( TBool /*aContinueOnError*/ ) |
|
1468 |
{ |
|
1469 |
TRACE_ENTRY_POINT; |
|
1470 |
||
1471 |
iUnifiedEditor.ReadPlaceFromEditorL(); |
|
1472 |
||
1473 |
TRACE_ENTRY_POINT; |
|
1474 |
} |
|
1475 |
||
1476 |
// ----------------------------------------------------------------------------- |
|
1477 |
// CCalenUnifiedEditorControl::ReadPeopleFieldFromEditorL |
|
1478 |
// Reads people field from editor |
|
1479 |
// ----------------------------------------------------------------------------- |
|
1480 |
// |
|
1481 |
void CCalenUnifiedEditorControl::ReadPeopleFieldFromEditorL( TBool /*aContinueOnError*/ ) |
|
1482 |
{ |
|
1483 |
TRACE_ENTRY_POINT; |
|
1484 |
||
1485 |
TRACE_ENTRY_POINT; |
|
1486 |
} |
|
1487 |
||
1488 |
// ----------------------------------------------------------------------------- |
|
1489 |
// CCalenUnifiedEditorControl::ReadAttachmentFieldFromEditorL |
|
1490 |
// Reads attachment field from editor |
|
1491 |
// ----------------------------------------------------------------------------- |
|
1492 |
// |
|
1493 |
void CCalenUnifiedEditorControl::ReadAttachmentFieldFromEditorL( TBool /*aContinueOnError*/ ) |
|
1494 |
{ |
|
1495 |
TRACE_ENTRY_POINT; |
|
1496 |
||
1497 |
TRACE_ENTRY_POINT; |
|
1498 |
} |
|
1499 |
||
1500 |
// ----------------------------------------------------------------------------- |
|
1501 |
// CCalenUnifiedEditorControl::ReadDescriptionFieldFromEditorL |
|
1502 |
// Reads description field from editor |
|
1503 |
// ----------------------------------------------------------------------------- |
|
1504 |
// |
|
1505 |
void CCalenUnifiedEditorControl::ReadDescriptionFieldFromEditorL( TBool /*aContinueOnError*/ ) |
|
1506 |
{ |
|
1507 |
TRACE_ENTRY_POINT; |
|
1508 |
||
1509 |
TRACE_ENTRY_POINT; |
|
1510 |
} |
|
1511 |
||
1512 |
// ----------------------------------------------------------------------------- |
|
1513 |
// CCalenUnifiedEditorControl::Description |
|
1514 |
// Access to the decription field |
|
1515 |
// ----------------------------------------------------------------------------- |
|
1516 |
// |
|
1517 |
CCalenDescription* CCalenUnifiedEditorControl::Description() |
|
1518 |
{ |
|
1519 |
TRACE_ENTRY_POINT; |
|
1520 |
TRACE_EXIT_POINT; |
|
1521 |
return iDescription; |
|
1522 |
} |
|
1523 |
||
1524 |
// ----------------------------------------------------------------------------- |
|
1525 |
// CCalenUnifiedEditorControl::UpdateLinesOnLocaleChangeL |
|
1526 |
// Update editor lines on environment change notifications |
|
1527 |
// ----------------------------------------------------------------------------- |
|
1528 |
// |
|
1529 |
void CCalenUnifiedEditorControl::UpdateLinesOnLocaleChangeL() |
|
1530 |
{ |
|
1531 |
TRACE_ENTRY_POINT; |
|
1532 |
||
1533 |
TInt lastFocusedItem = iUnifiedEditor.IdOfFocusedControl(); |
|
1534 |
switch( iUnifiedEditor.GetEntryType() ) |
|
1535 |
{ |
|
1536 |
case CCalEntry::EEvent: |
|
1537 |
{ |
|
1538 |
iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
|
1539 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
1540 |
ECalenEditorStartDate, ECalenEditorAllDayItem ); |
|
1541 |
||
1542 |
iUnifiedEditor.DeleteLine( ECalenEditorEndDate, EFalse ); |
|
1543 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_END_DATE_ITEM, |
|
1544 |
ECalenEditorEndDate, ECalenEditorStartDate ); |
|
1545 |
} |
|
1546 |
break; |
|
1547 |
||
1548 |
case CCalEntry::EAnniv: |
|
1549 |
{ |
|
31
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1550 |
TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType(); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1551 |
if( type != ESolar && FeatureManager::FeatureSupported( KFeatureIdKorean )) |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1552 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1553 |
iUnifiedEditor.DeleteLine( EKoreanLunarAniversityStart, EFalse ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1554 |
iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_DATE_EDITOR_LINE, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1555 |
EKoreanLunarAniversityStart, EKoreanLunarTypeSelectSolarLunarLeap ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1556 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1557 |
else |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1558 |
{ |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1559 |
iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1560 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1561 |
ECalenEditorStartDate, ECalenEditorEventType ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1562 |
// "Start Date" Label should be "Date of Birth" for Birthday |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1563 |
iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate, |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1564 |
R_QTN_CALEN_EDITOR_DATE_OF_BIRTH ); |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1565 |
} |
97232defd20e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
30
diff
changeset
|
1566 |
|
30 | 1567 |
} |
1568 |
break; |
|
1569 |
||
1570 |
case CCalEntry::EAppt: |
|
1571 |
{ |
|
1572 |
||
1573 |
if( iUnifiedEditor.Edited().IsAllDayEvent() ) |
|
1574 |
{ |
|
1575 |
iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
|
1576 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
1577 |
ECalenEditorStartDate, ECalenEditorAllDayItem ); |
|
1578 |
||
1579 |
iUnifiedEditor.DeleteLine( ECalenEditorEndDate, EFalse ); |
|
1580 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_END_DATE_ITEM, |
|
1581 |
ECalenEditorEndDate, ECalenEditorStartDate ); |
|
1582 |
} |
|
1583 |
else |
|
1584 |
{ |
|
1585 |
iUnifiedEditor.DeleteLine( ECalenEditorStartTime, EFalse ); |
|
1586 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_TIME_ITEM, |
|
1587 |
ECalenEditorStartTime, ECalenEditorAllDayItem ); |
|
1588 |
||
1589 |
iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
|
1590 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
1591 |
ECalenEditorStartDate, ECalenEditorStartTime ); |
|
1592 |
||
1593 |
iUnifiedEditor.DeleteLine( ECalenEditorEndTime, EFalse ); |
|
1594 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_END_TIME_ITEM, |
|
1595 |
ECalenEditorEndTime, ECalenEditorStartDate ); |
|
1596 |
||
1597 |
iUnifiedEditor.DeleteLine( ECalenEditorEndDate, EFalse ); |
|
1598 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_END_DATE_ITEM, |
|
1599 |
ECalenEditorEndDate, ECalenEditorEndTime ); |
|
1600 |
} |
|
1601 |
||
1602 |
} |
|
1603 |
break; |
|
1604 |
||
1605 |
case CCalEntry::ETodo: |
|
1606 |
{ |
|
1607 |
iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse ); |
|
1608 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM, |
|
1609 |
ECalenEditorStartDate, ECalenEditorEventType ); |
|
1610 |
||
1611 |
} |
|
1612 |
break; |
|
1613 |
default: |
|
1614 |
break; |
|
1615 |
} |
|
1616 |
||
1617 |
if( iUnifiedEditor.ControlOrNull( ECalenEditorReminderDate ) ) |
|
1618 |
{ |
|
1619 |
iUnifiedEditor.DeleteLine( ECalenEditorReminderDate, EFalse ); |
|
1620 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_DATE_ITEM, |
|
1621 |
ECalenEditorReminderDate, ECalenEditorReminder ); |
|
1622 |
||
1623 |
} |
|
1624 |
if( iUnifiedEditor.ControlOrNull( ECalenEditorReminderTime ) ) |
|
1625 |
{ |
|
1626 |
iUnifiedEditor.DeleteLine( ECalenEditorReminderTime, EFalse ); |
|
1627 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_TIME_ITEM, |
|
1628 |
ECalenEditorReminderTime, ECalenEditorReminderDate ); |
|
1629 |
} |
|
1630 |
if( iUnifiedEditor.ControlOrNull( ECalenEditorRepeatUntil ) ) |
|
1631 |
{ |
|
1632 |
iUnifiedEditor.DeleteLine( ECalenEditorRepeatUntil, EFalse ); |
|
1633 |
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REPEAT_UNTIL_ITEM, |
|
1634 |
ECalenEditorRepeatUntil, ECalenEditorRepeat ); |
|
1635 |
||
1636 |
} |
|
1637 |
||
1638 |
iUnifiedEditor.TryChangeFocusToL( lastFocusedItem ); |
|
1639 |
SetDataToEditorL(ETrue); |
|
1640 |
iUnifiedEditor.UpdateFormL(); |
|
1641 |
TRACE_EXIT_POINT; |
|
1642 |
} |
|
1643 |
||
1644 |
TInt CCalenUnifiedEditorControl::GetCalendarIndexForEntryL() |
|
1645 |
{ |
|
1646 |
TRACE_ENTRY_POINT; |
|
1647 |
TRACE_EXIT_POINT; |
|
1648 |
||
1649 |
return iDbField->GetCalendarIndexForEntryL(); |
|
1650 |
} |
|
1651 |
||
1652 |
// ----------------------------------------------------------------------------- |
|
1653 |
// CCalenUnifiedEditorControl::GetCalendarNameForEntryL() |
|
1654 |
// ----------------------------------------------------------------------------- |
|
1655 |
// |
|
1656 |
const TDesC& CCalenUnifiedEditorControl::GetCalendarNameForEntryL() |
|
1657 |
{ |
|
1658 |
TRACE_ENTRY_POINT; |
|
1659 |
TRACE_EXIT_POINT; |
|
1660 |
||
1661 |
return iDbField->GetCalendarNameForEntryL(); |
|
1662 |
} |
|
1663 |
||
1664 |
TInt CCalenUnifiedEditorControl::GetCalendarNameForEntryL(const TDesC& aCalendarFileName) |
|
1665 |
{ |
|
1666 |
TRACE_ENTRY_POINT; |
|
1667 |
TRACE_EXIT_POINT; |
|
1668 |
||
1669 |
return iDbField->GetCalendarNameForEntryL(aCalendarFileName); |
|
1670 |
} |
|
1671 |
||
1672 |
// ----------------------------------------------------------------------------- |
|
1673 |
// CCalenUnifiedEditorControl::UpdateMeetingDurationL() |
|
1674 |
// This function leaves if the end date/time is before the start date/time. |
|
1675 |
// (other items were commented in a header). |
|
1676 |
// ----------------------------------------------------------------------------- |
|
1677 |
// |
|
1678 |
void CCalenUnifiedEditorControl::UpdateMeetingDurationL() |
|
1679 |
{ |
|
1680 |
TRACE_ENTRY_POINT; |
|
1681 |
||
1682 |
TTime start = iUnifiedEditor.Edited().StartDateTime(); |
|
1683 |
TTime end = iUnifiedEditor.Edited().EndDateTime(); |
|
1684 |
User::LeaveIfError( |
|
1685 |
end.MinutesFrom(start, iMeetingInterval ) ); |
|
1686 |
||
1687 |
TRACE_EXIT_POINT; |
|
1688 |
} |
|
1689 |
||
1690 |
// ----------------------------------------------------------------------------- |
|
1691 |
// CCalenUnifiedEditorControl::UpdateEndTimeL() |
|
1692 |
// Updates the end date/time when the start date/time is changed. |
|
1693 |
// (other items were commented in a header). |
|
1694 |
// ----------------------------------------------------------------------------- |
|
1695 |
// |
|
1696 |
void CCalenUnifiedEditorControl::UpdateEndTimeL() |
|
1697 |
{ |
|
1698 |
TRACE_ENTRY_POINT; |
|
1699 |
||
1700 |
TTime start = iUnifiedEditor.Edited().StartDateTime(); |
|
1701 |
||
1702 |
// Update EndTime in the Editor for meeting Entry |
|
1703 |
TTime end = start; |
|
1704 |
end += iMeetingInterval; |
|
1705 |
end = CalenDateUtils::LimitToValidTime( end ); |
|
1706 |
||
1707 |
// update data model |
|
1708 |
iUnifiedEditor.Edited().SetEndDateTimeL( end ); |
|
1709 |
||
1710 |
// update form fields |
|
1711 |
UpdateMeetingDurationL(); |
|
1712 |
||
1713 |
if( iAllDayField->IsAllDayEvent() && |
|
1714 |
CCalEntry::EEvent == iUnifiedEditor.Edited().EntryType() ) |
|
1715 |
{ |
|
1716 |
// For allday (1 day) event Eg. "Start:- 12:00am, 15-08-2010 & End:-12:00am, 16-08-2010" |
|
1717 |
// In Editor it should be displayed as "StartDate: 15-08-2010 & EndDate:15-08-2010" |
|
1718 |
// No time filed is displayed. |
|
1719 |
end -= TTimeIntervalDays( KOneDay ); |
|
1720 |
if ( end < start ) |
|
1721 |
{ |
|
1722 |
end = start; |
|
1723 |
} |
|
1724 |
} |
|
1725 |
||
1726 |
SetDateField( ECalenEditorEndDate, end, ETrue ); |
|
1727 |
SetTimeField( ECalenEditorEndTime, end, ETrue ); |
|
1728 |
TRACE_EXIT_POINT; |
|
1729 |
} |
|
1730 |
||
1731 |
// ----------------------------------------------------------------------------- |
|
1732 |
// CCalenUnifiedEditorControl::ReadRrule() |
|
1733 |
// Checks the Rdates and RRule if there is any with the CCalEntry |
|
1734 |
// (other items were commented in a header). |
|
1735 |
// ----------------------------------------------------------------------------- |
|
1736 |
// |
|
1737 |
void CCalenUnifiedEditorControl::ReadRruleL(TTime& firstRdatestartTime, TTime& endTime) |
|
1738 |
{ |
|
1739 |
TRACE_ENTRY_POINT; |
|
1740 |
||
1741 |
RArray<TCalTime> rDateList; |
|
1742 |
CleanupClosePushL( rDateList ); |
|
1743 |
rDateList = iUnifiedEditor.Edited().GetRdatesL(); |
|
1744 |
||
1745 |
TInt count = rDateList.Count(); |
|
1746 |
TBool hasRDates = ( count > 0 ); |
|
1747 |
||
1748 |
// Get the firstRDate only if the entry has RDates. |
|
1749 |
if( hasRDates ) |
|
1750 |
{ |
|
1751 |
firstRdatestartTime = rDateList[ 0 ].TimeLocalL(); |
|
1752 |
TDateTime firstRDateTime = firstRdatestartTime.DateTime(); |
|
1753 |
||
1754 |
TTimeIntervalMinutes duration; |
|
1755 |
TTime entryStartTime = iUnifiedEditor.Edited().StartDateTime(); |
|
1756 |
TTime entryEndTime = iUnifiedEditor.Edited().EndDateTime(); |
|
1757 |
||
1758 |
User::LeaveIfError( entryEndTime.MinutesFrom( entryStartTime, duration ) ); |
|
1759 |
endTime= firstRdatestartTime + duration; |
|
1760 |
} |
|
1761 |
else |
|
1762 |
{ |
|
1763 |
firstRdatestartTime = iUnifiedEditor.Edited().StartDateTime(); |
|
1764 |
endTime = iUnifiedEditor.Edited().EndDateTime(); |
|
1765 |
} |
|
1766 |
||
1767 |
CleanupStack::PopAndDestroy(); |
|
1768 |
||
1769 |
TRACE_EXIT_POINT; |
|
1770 |
} |
|
1771 |
// ----------------------------------------------------------------------------- |
|
1772 |
// CCalenUnifiedEditorControl::HandleErrorL() |
|
1773 |
// Handles errors. This function may be called on saving note. |
|
1774 |
// (other items were commented in a header). |
|
1775 |
// ----------------------------------------------------------------------------- |
|
1776 |
// |
|
1777 |
void CCalenUnifiedEditorControl::HandleErrorL(const TInt& aError) |
|
1778 |
{ |
|
1779 |
TRACE_ENTRY_POINT; |
|
1780 |
if( aError == CCalenEditorDataHandler::EFormErrDurationGreaterThanRepeatInterval ) |
|
1781 |
{ |
|
1782 |
iUnifiedEditor.TryChangeFocusToL(ECalenEditorRepeat); |
|
1783 |
} |
|
1784 |
else if( aError == CCalenEditorDataHandler::EFormErrOutOfSequence ) |
|
1785 |
{ |
|
1786 |
iUnifiedEditor.TryChangeFocusToL(ECalenEditorStartDate); |
|
1787 |
} |
|
1788 |
else if( aError == CCalenEditorDataHandler::EFormErrOverlapsExistingInstance ) |
|
1789 |
{ |
|
1790 |
iUnifiedEditor.TryChangeFocusToL(ECalenEditorStartDate); |
|
1791 |
} |
|
1792 |
else |
|
1793 |
{ |
|
1794 |
if( aError == CCalenEditorDataHandler::EFormErrInstanceAlreadyExistsOnThisDay ) |
|
1795 |
{ |
|
1796 |
iUnifiedEditor.TryChangeFocusToL(ECalenEditorStartDate); |
|
1797 |
} |
|
1798 |
} |
|
1799 |
||
1800 |
if (iReminderField->HandleErrorL(aError) ) |
|
1801 |
{ |
|
1802 |
TRACE_EXIT_POINT; |
|
1803 |
return; |
|
1804 |
} |
|
1805 |
if ( iRepeatField->HandleErrorL(aError) ) |
|
1806 |
{ |
|
1807 |
TRACE_EXIT_POINT; |
|
1808 |
return; |
|
1809 |
} |
|
1810 |
||
1811 |
TRACE_EXIT_POINT; |
|
1812 |
} |
|
1813 |
// End of file |
|
1814 |
||
1815 |