1 /* |
|
2 * Copyright (c) 2008 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "creator_calendar.h" |
|
20 #include "creator_traces.h" |
|
21 #include "creator_scriptentry.h" |
|
22 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__) |
|
23 #include "creator_contactsetcache.h" |
|
24 #include "creator_virtualphonebook.h" |
|
25 #endif |
|
26 #include <e32base.h> |
|
27 #include <e32math.h> |
|
28 #include <calrrule.h> |
|
29 #include <calalarm.h> |
|
30 |
|
31 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__) |
|
32 #include <MVPbkFieldType.h> |
|
33 #include <MVPbkContactOperationBase.h> |
|
34 #include <MVPbkStoreContactFieldCollection.h> |
|
35 #include <MVPbkContactFieldTextData.h> |
|
36 #include <CVPbkContactManager.h> |
|
37 #include <MVPbkStoreContact.h> |
|
38 #include <CVPbkContactStoreUriArray.h> |
|
39 #include <TVPbkContactStoreUriPtr.h> |
|
40 #include <VPbkContactStoreUris.h> |
|
41 #include <MVPbkContactStoreList.h> |
|
42 #include <MVPbkContactStore.h> |
|
43 #include <MVPbkContactStoreProperties.h> |
|
44 #include <VPbkEng.rsg> |
|
45 #endif |
|
46 |
|
47 static const TInt KCalendarFieldLength = 128; |
|
48 |
|
49 |
|
50 CCreatorCalenderAttendee::CCreatorCalenderAttendee() |
|
51 {} |
|
52 |
|
53 CCreatorCalenderAttendee::~CCreatorCalenderAttendee() |
|
54 { |
|
55 delete iCommonName; |
|
56 delete iEmailAddress; |
|
57 } |
|
58 |
|
59 CCreatorCalenderAttendee* CCreatorCalenderAttendee::NewL() |
|
60 { |
|
61 CCreatorCalenderAttendee* self = new (ELeave) CCreatorCalenderAttendee; |
|
62 return self; |
|
63 } |
|
64 |
|
65 void CCreatorCalenderAttendee::SetCommonNameL(const TDesC& aName) |
|
66 { |
|
67 delete iCommonName; |
|
68 iCommonName = 0; |
|
69 iCommonName = HBufC::NewL(aName.Length()); |
|
70 iCommonName->Des().Copy(aName); |
|
71 } |
|
72 |
|
73 void CCreatorCalenderAttendee::SetEmailAddressL(const TDesC& aEmail) |
|
74 { |
|
75 delete iEmailAddress; |
|
76 iEmailAddress = 0; |
|
77 iEmailAddress = HBufC::NewL(aEmail.Length()); |
|
78 iEmailAddress->Des().Copy(aEmail); |
|
79 } |
|
80 |
|
81 void CCreatorCalenderAttendee::SetRole(CCalAttendee::TCalRole aRole) |
|
82 { |
|
83 iRole = aRole; |
|
84 } |
|
85 |
|
86 void CCreatorCalenderAttendee::SetStatus(CCalAttendee::TCalStatus aStatus) |
|
87 { |
|
88 iStatus = aStatus; |
|
89 } |
|
90 |
|
91 const TDesC& CCreatorCalenderAttendee::CommonName() const |
|
92 { |
|
93 if( iCommonName == 0 ) |
|
94 return iDummy; |
|
95 return *iCommonName; |
|
96 } |
|
97 |
|
98 const TDesC& CCreatorCalenderAttendee::EmailAddress() const |
|
99 { |
|
100 if( iEmailAddress == 0 ) |
|
101 return iDummy; |
|
102 |
|
103 return *iEmailAddress; |
|
104 } |
|
105 |
|
106 CCalAttendee::TCalRole CCreatorCalenderAttendee::Role() const |
|
107 { |
|
108 return iRole; |
|
109 } |
|
110 |
|
111 CCalAttendee::TCalStatus CCreatorCalenderAttendee::Status() const |
|
112 { |
|
113 return iStatus; |
|
114 } |
|
115 |
|
116 TBool CCalenderInterimParameters::IsAllowedEntryStatus(CCalEntry::TType aType, CCalEntry::TStatus aStatus) |
|
117 { |
|
118 if( aType == CCalEntry::ETodo ) |
|
119 { |
|
120 return aStatus == CCalEntry::ECancelled || |
|
121 aStatus == CCalEntry::ETodoNeedsAction || |
|
122 aStatus == CCalEntry::ETodoCompleted || |
|
123 aStatus == CCalEntry::ETodoInProcess; |
|
124 } |
|
125 |
|
126 return aStatus == CCalEntry::ETentative || |
|
127 aStatus == CCalEntry::EConfirmed || |
|
128 aStatus == CCalEntry::ECancelled; |
|
129 } |
|
130 |
|
131 //---------------------------------------------------------------------------- |
|
132 |
|
133 CCalenderInterimParameters::CCalenderInterimParameters ( ) |
|
134 { |
|
135 LOGSTRING("Creator: CCalenderInterimParameters::CCalenderInterimParameters"); |
|
136 |
|
137 iAppointmentLocation = HBufC::New (KCalendarFieldLength ); |
|
138 iAppointmentReason = HBufC::New (KCalendarFieldLength ); |
|
139 iEventReason = HBufC::New (KCalendarFieldLength ); |
|
140 iAnniversaryReason = HBufC::New (KCalendarFieldLength ); |
|
141 iTodoTask = HBufC::New (KCalendarFieldLength ); |
|
142 iReminderReason = HBufC::New (KCalendarFieldLength ); |
|
143 iDescription = HBufC::New (KCalendarFieldLength ); |
|
144 iSummary = HBufC::New (KCalendarFieldLength ); |
|
145 iLocation = HBufC::New (KCalendarFieldLength ); |
|
146 iOrganizerName = HBufC::New (KCalendarFieldLength ); |
|
147 iOrganizerEmail = HBufC::New (KCalendarFieldLength ); |
|
148 |
|
149 // set defaults, start date today and end date = today + 1 month |
|
150 iRandomModeStartTime.HomeTime ( ); |
|
151 iRandomModeEndTime = iRandomModeStartTime; |
|
152 iRandomModeEndTime += TTimeIntervalMonths (1 ); |
|
153 iAlarmTime = Time::NullTTime(); |
|
154 iUseRandomAlarmTime = EFalse; |
|
155 iStatus = CCalEntry::ENullStatus; |
|
156 } |
|
157 |
|
158 CCalenderInterimParameters::~CCalenderInterimParameters ( ) |
|
159 { |
|
160 LOGSTRING("Creator: CCalenderInterimParameters::~CCalenderInterimParameters"); |
|
161 |
|
162 delete iTodoTask; |
|
163 delete iAnniversaryReason; |
|
164 delete iEventReason; |
|
165 delete iAppointmentReason; |
|
166 delete iAppointmentLocation; |
|
167 delete iReminderReason; |
|
168 delete iDescription; |
|
169 delete iSummary; |
|
170 delete iLocation; |
|
171 delete iOrganizerName; |
|
172 delete iOrganizerEmail; |
|
173 iAttendees.ResetAndDestroy(); |
|
174 iAttendees.Close(); |
|
175 iAttendeeLinkIds.Reset(); |
|
176 iAttendeeLinkIds.Close(); |
|
177 } |
|
178 |
|
179 void CCalenderInterimParameters::ParseL (CCommandParser* parser, |
|
180 TParseParams aCase ) |
|
181 { |
|
182 LOGSTRING("Creator: CCalenderInterimParameters::ParseL"); |
|
183 |
|
184 HBufC* tempBuf= NULL; |
|
185 |
|
186 switch (aCase ) |
|
187 { |
|
188 |
|
189 case MCreatorModuleBaseParameters::ECalendarTodo: |
|
190 { |
|
191 |
|
192 parser->StrParserL (tempBuf, '|' ); |
|
193 |
|
194 CleanupStack::PushL (tempBuf ); |
|
195 |
|
196 this->iTodoDueTime = TTime (tempBuf->Des ( ) ); |
|
197 |
|
198 parser->StrParserL (this->iTodoTask, '|' ); |
|
199 |
|
200 parser->StrParserL (tempBuf, ';' ); |
|
201 this->iTodoPriority = 2; |
|
202 if (tempBuf->Compare (_L("LOW") ) == 0 ) |
|
203 this->iTodoPriority = 3; |
|
204 else |
|
205 if (tempBuf->Compare (_L("HIGH") ) == 0 ) |
|
206 this->iTodoPriority = 1; |
|
207 |
|
208 CleanupStack::PopAndDestroy (tempBuf ); |
|
209 |
|
210 } |
|
211 |
|
212 case MCreatorModuleBaseParameters::ECalendarMemo: |
|
213 { |
|
214 |
|
215 parser->StrParserL (tempBuf, '|' ); |
|
216 |
|
217 this->iStartTime = TTime (tempBuf->Des ( ) ); |
|
218 |
|
219 parser->StrParserL (tempBuf, '|' ); |
|
220 this->iEndTime = TTime (tempBuf->Des ( ) ); |
|
221 |
|
222 parser->StrParserL (this->iDescription, ';' ); |
|
223 |
|
224 CleanupStack::PopAndDestroy (tempBuf ); |
|
225 } |
|
226 |
|
227 case MCreatorModuleBaseParameters::ECalendarMeeting: |
|
228 { |
|
229 |
|
230 parser->StrParserL (tempBuf, '|' ); |
|
231 |
|
232 CleanupStack::PushL (tempBuf ); |
|
233 |
|
234 this->iStartTime = TTime (tempBuf->Des ( ) ); |
|
235 |
|
236 parser->StrParserL (tempBuf, '|' ); |
|
237 this->iEndTime = TTime (tempBuf->Des ( ) ); |
|
238 |
|
239 parser->StrParserL (this->iLocation, '|' ); |
|
240 parser->StrParserL (this->iDescription, ';' ); |
|
241 |
|
242 CleanupStack::PopAndDestroy (tempBuf ); |
|
243 } |
|
244 |
|
245 case MCreatorModuleBaseParameters::ECalendarAnniv: |
|
246 { |
|
247 |
|
248 parser->StrParserL (tempBuf, '|' ); |
|
249 |
|
250 CleanupStack::PushL (tempBuf ); |
|
251 |
|
252 this->iStartTime = TTime (tempBuf->Des ( ) ); |
|
253 |
|
254 parser->StrParserL (this->iDescription, ';' ); |
|
255 |
|
256 CleanupStack::PopAndDestroy (tempBuf ); |
|
257 |
|
258 } |
|
259 default: |
|
260 { |
|
261 //implement |
|
262 } |
|
263 } |
|
264 } |
|
265 //---------------------------------------------------------------------------- |
|
266 |
|
267 CCreatorInterimCalendar* CCreatorInterimCalendar::NewL (CCreatorEngine* aEngine ) |
|
268 { |
|
269 CCreatorInterimCalendar* self = CCreatorInterimCalendar::NewLC (aEngine ); |
|
270 CleanupStack::Pop (self ); |
|
271 return self; |
|
272 } |
|
273 |
|
274 CCreatorInterimCalendar* CCreatorInterimCalendar::NewLC (CCreatorEngine* aEngine ) |
|
275 { |
|
276 CCreatorInterimCalendar* self = new (ELeave) CCreatorInterimCalendar; |
|
277 CleanupStack::PushL (self ); |
|
278 self->ConstructL (aEngine ); |
|
279 return self; |
|
280 } |
|
281 |
|
282 CCreatorInterimCalendar::CCreatorInterimCalendar ( ) |
|
283 { |
|
284 } |
|
285 |
|
286 void CCreatorInterimCalendar::ConstructL (CCreatorEngine* aEngine ) |
|
287 { |
|
288 LOGSTRING("Creator: CCreatorInterimCalendar::ConstructL"); |
|
289 |
|
290 iEngine = aEngine; |
|
291 |
|
292 // set defaults, start date today and end date = today + 1 month |
|
293 iRandomModeStartTime.HomeTime ( ); |
|
294 iRandomModeEndTime = iRandomModeStartTime; |
|
295 iRandomModeEndTime += TTimeIntervalMonths (1 ); |
|
296 |
|
297 iCalSession = CCalSession::NewL ( ); |
|
298 // Create and open a calendar file |
|
299 const TDesC& fileName = iCalSession->DefaultFileNameL ( );//default filename is: "C:Calendar" |
|
300 TRAPD(err, iCalSession->CreateCalFileL(fileName)) |
|
301 ; |
|
302 // ignore KErrAlreadyExists leave code |
|
303 if (err != KErrAlreadyExists ) |
|
304 { |
|
305 User::LeaveIfError (err ); |
|
306 } |
|
307 // Open the calendar file |
|
308 iCalSession->OpenL (fileName ); |
|
309 iCalEntryView = CCalEntryView::NewL (*iCalSession, *this ); |
|
310 iNumberRepeatingEntries = 0; |
|
311 iNumberOfAttendees = 0; //iEngine->RandomNumber(2, 15); |
|
312 iSetAlarm = EFalse; |
|
313 iWaiter = CAsyncWaiter::NewL(); |
|
314 } |
|
315 |
|
316 CCreatorInterimCalendar::~CCreatorInterimCalendar ( ) |
|
317 { |
|
318 LOGSTRING("Creator: CCreatorInterimCalendar::~CCreatorInterimCalendar"); |
|
319 |
|
320 if ( iEngine && iEntryIds.Count() ) |
|
321 { |
|
322 TRAP_IGNORE( iEngine->WriteEntryIdsToStoreL( iEntryIds, KUidDictionaryUidCalendar ) ); |
|
323 } |
|
324 |
|
325 iEntryIds.Reset(); |
|
326 iEntryIds.Close(); |
|
327 |
|
328 if (iParameters ) |
|
329 { |
|
330 delete iParameters; |
|
331 } |
|
332 |
|
333 if (iCalEntryView ) |
|
334 { |
|
335 delete iCalEntryView; |
|
336 } |
|
337 |
|
338 if (iCalSession ) |
|
339 { |
|
340 delete iCalSession; |
|
341 } |
|
342 delete iSoundFileArray; |
|
343 delete iWaiter; |
|
344 delete iTmpCN; |
|
345 delete iTmpEmail; |
|
346 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__) |
|
347 delete iExistingContacts; |
|
348 delete iTempContact; |
|
349 delete iContactManager; |
|
350 #endif |
|
351 } |
|
352 |
|
353 //---------------------------------------------------------------------------- |
|
354 |
|
355 TBool CCreatorInterimCalendar::AskDataFromUserL (TInt aCommand, |
|
356 TInt& aNumberOfEntries ) |
|
357 { |
|
358 LOGSTRING("Creator: CCreatorInterimCalendar::AskDataFromUserL"); |
|
359 |
|
360 if( aCommand == ECmdDeleteCalendarEntries ) |
|
361 { |
|
362 return iEngine->YesNoQueryDialogL(_L("Delete all calendar entries?") ); |
|
363 } |
|
364 if( aCommand == ECmdDeleteCreatorCalendarEntries ) |
|
365 { |
|
366 return iEngine->YesNoQueryDialogL(_L("Delete all calendar entries created with Creator?") ); |
|
367 } |
|
368 |
|
369 // display queries |
|
370 if (iEngine->EntriesQueryDialogL (aNumberOfEntries, _L("How many entries to create?") ) ) // ask number of entries to create |
|
371 { |
|
372 if( aCommand == ECmdCreateCalendarEntryEvents || |
|
373 aCommand == ECmdCreateCalendarEntryAppointments) |
|
374 { |
|
375 _LIT(KRepeatingNum, "How many repeating (weekly) entries"); |
|
376 if( !iEngine->EntriesQueryDialogL(iNumberRepeatingEntries, KRepeatingNum, ETrue)) |
|
377 { |
|
378 return EFalse; |
|
379 } |
|
380 _LIT(KAttendeesNum, "How many attendees to create"); |
|
381 if( !iEngine->EntriesQueryDialogL(iNumberOfAttendees, KAttendeesNum, ETrue)) |
|
382 { |
|
383 return EFalse; |
|
384 } |
|
385 } |
|
386 if (iEngine->TimeQueryDialogL (iRandomModeStartTime, R_START_DATE_QUERY ) ) // ask start date |
|
387 { |
|
388 if (iEngine->TimeQueryDialogL (iRandomModeEndTime, R_END_DATE_QUERY ) ) // ask end date |
|
389 { |
|
390 if (iRandomModeStartTime > iRandomModeEndTime ) // check end date is ok |
|
391 { |
|
392 CAknInformationNote* note = new (ELeave) CAknInformationNote; |
|
393 note->ExecuteLD (_L("End date must be after start date") ); |
|
394 |
|
395 return EFalse; |
|
396 } |
|
397 else |
|
398 { |
|
399 if( iEngine->YesNoQueryDialogL(_L("Add default alarm?"))) |
|
400 { |
|
401 iSetAlarm = ETrue; |
|
402 } |
|
403 } |
|
404 return ETrue; |
|
405 } |
|
406 else |
|
407 return EFalse; |
|
408 } |
|
409 else |
|
410 return EFalse; |
|
411 } |
|
412 else |
|
413 return EFalse; |
|
414 } |
|
415 |
|
416 //---------------------------------------------------------------------------- |
|
417 |
|
418 TInt CCreatorInterimCalendar::CreateAppointmentEntryL ( |
|
419 CCreatorModuleBaseParameters *aParameters ) |
|
420 { |
|
421 LOGSTRING("Creator: CCreatorInterimCalendar::CreateAppointmentEntryL"); |
|
422 |
|
423 delete iParameters; |
|
424 iParameters = 0; |
|
425 |
|
426 CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters; |
|
427 |
|
428 if( !parameters ) |
|
429 { |
|
430 iParameters = new(ELeave) CCalenderInterimParameters; |
|
431 parameters = iParameters; |
|
432 parameters->iRandomModeStartTime = iRandomModeStartTime; |
|
433 parameters->iRandomModeEndTime = iRandomModeEndTime; |
|
434 |
|
435 // difference between start and end times |
|
436 TTimeIntervalMinutes differenceInMinutes; |
|
437 parameters->iRandomModeEndTime.MinutesFrom ( |
|
438 parameters->iRandomModeStartTime, differenceInMinutes ); |
|
439 |
|
440 // start time (= something between the period start and end date) |
|
441 parameters->iStartTime = parameters->iRandomModeStartTime; |
|
442 parameters->iStartTime |
|
443 += TTimeIntervalMinutes (iEngine->RandomNumber (differenceInMinutes.Int ( ) ) ); |
|
444 // set end time (= start time + some random time) |
|
445 parameters->iEndTime = parameters->iStartTime; |
|
446 parameters->iEndTime |
|
447 += TTimeIntervalMinutes (iEngine->RandomNumber (5, 500 ) ); |
|
448 |
|
449 |
|
450 // strings |
|
451 parameters->iLocation->Des ( ) |
|
452 = iEngine->RandomString (CCreatorEngine::EMeetingPlace ); |
|
453 parameters->iDescription->Des ( ) |
|
454 = iEngine->RandomString (CCreatorEngine::EMeetingReason ); |
|
455 |
|
456 parameters->iSummary->Des() |
|
457 = parameters->iDescription->Des(); |
|
458 |
|
459 parameters->iNumberRepeatingEntries = iNumberRepeatingEntries; |
|
460 parameters->iNumberOfAttendees = iNumberOfAttendees; |
|
461 } |
|
462 |
|
463 TInt err = KErrNone; |
|
464 HBufC8* guid = HBufC8::NewLC (255 ); |
|
465 TPtr8 uidP=guid->Des ( ); |
|
466 GenerateRandomId (uidP ); |
|
467 CCalEntry* entry = CCalEntry::NewL (CCalEntry::EAppt, guid, |
|
468 CCalEntry::EMethodAdd, 0 ); |
|
469 CleanupStack::PushL (entry ); |
|
470 |
|
471 //Using same text as description and summary |
|
472 entry->SetDescriptionL (parameters->iDescription->Des ( ) ); |
|
473 entry->SetSummaryL (parameters->iSummary->Des ( ) ); |
|
474 entry->SetLocationL (parameters->iLocation->Des ( ) ); |
|
475 |
|
476 TCalTime startTime; |
|
477 TCalTime endTime; |
|
478 // Set the start and end times using time values local to the current system time zone |
|
479 TInt month = (TInt) parameters->iStartTime.DateTime().Month(); |
|
480 TInt date = parameters->iStartTime.DateTime().Day(); |
|
481 startTime.SetTimeLocalL (parameters->iStartTime ); |
|
482 endTime.SetTimeLocalL (parameters->iEndTime ); |
|
483 entry->SetStartAndEndTimeL (startTime, endTime ); |
|
484 |
|
485 if( parameters->IsAllowedEntryStatus(CCalEntry::EAppt, parameters->iStatus)) |
|
486 { |
|
487 LOGSTRING2("Creator: CCreatorInterimCalendar::CreateAppointmentEntryL setting entry status: %d", parameters->iStatus); |
|
488 entry->SetStatusL(parameters->iStatus); |
|
489 } |
|
490 |
|
491 // Repeating times: |
|
492 AddRepeatingRuleL(startTime, *entry, parameters); |
|
493 SetOrganizerL(*entry, parameters); |
|
494 |
|
495 // Alarm: |
|
496 if( iSetAlarm || parameters->iUseRandomAlarmTime ) |
|
497 { |
|
498 SetRandomAlarmL(*entry); |
|
499 } |
|
500 else |
|
501 { |
|
502 SetAlarmL(*entry, parameters); |
|
503 } |
|
504 |
|
505 // Add attendees: |
|
506 AddAttendeesL(*entry, parameters); |
|
507 |
|
508 RPointerArray<CCalEntry> array; |
|
509 CleanupClosePushL (array ); |
|
510 array.AppendL (entry ); |
|
511 |
|
512 TInt success(0); |
|
513 //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed |
|
514 iCalEntryView->StoreL (array, success ); |
|
515 |
|
516 // id has been generated, store it for being able to delete |
|
517 // entries created only with Creator |
|
518 iEntryIds.Append( entry->LocalUidL() ); |
|
519 |
|
520 //One item should be added at time |
|
521 if (success != 1 ) |
|
522 { |
|
523 err = 1; |
|
524 } |
|
525 |
|
526 CleanupStack::PopAndDestroy (&array ); |
|
527 CleanupStack::PopAndDestroy (entry ); |
|
528 CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid |
|
529 |
|
530 return err; |
|
531 } |
|
532 |
|
533 void CCreatorInterimCalendar::SetOrganizerL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters ) |
|
534 { |
|
535 HBufC* orgName = 0; |
|
536 HBufC* orgEmail = 0; |
|
537 _LIT(KSpace, " "); |
|
538 |
|
539 // |
|
540 // Common name |
|
541 // |
|
542 if( parameters == 0 || |
|
543 parameters->iOrganizerName == 0 || |
|
544 parameters->iOrganizerName->Length() == 0 ) |
|
545 { |
|
546 // Random: |
|
547 TPtrC firstname = iEngine->RandomString(CCreatorEngine::EFirstName); |
|
548 TPtrC lastname = iEngine->RandomString(CCreatorEngine::ESurname); |
|
549 orgName = HBufC::NewL(firstname.Length() + lastname.Length() + 1 ); |
|
550 CleanupStack::PushL(orgName); |
|
551 orgName->Des().Copy(firstname); |
|
552 orgName->Des().Append(KSpace); |
|
553 orgName->Des().Append(lastname); |
|
554 } |
|
555 else |
|
556 { |
|
557 orgName = HBufC::NewL(parameters->iOrganizerName->Length()); |
|
558 CleanupStack::PushL(orgName); |
|
559 orgName->Des().Copy(parameters->iOrganizerName->Des()); |
|
560 } |
|
561 |
|
562 // |
|
563 // Email |
|
564 // |
|
565 if( parameters == 0 || |
|
566 parameters->iOrganizerEmail == 0 || |
|
567 parameters->iOrganizerEmail->Length() == 0 ) |
|
568 { |
|
569 // Random: |
|
570 TDesC* tmp = iEngine->CreateEmailAddressLC(); |
|
571 orgEmail = HBufC::NewL(tmp->Length()); |
|
572 orgEmail->Des().Copy(*tmp); |
|
573 CleanupStack::PopAndDestroy(); // tmp |
|
574 CleanupStack::PushL(orgEmail); |
|
575 } |
|
576 else |
|
577 { |
|
578 orgEmail = HBufC::NewL(parameters->iOrganizerEmail->Length()); |
|
579 CleanupStack::PushL(orgEmail); |
|
580 orgEmail->Des().Copy(parameters->iOrganizerEmail->Des()); |
|
581 } |
|
582 |
|
583 SetOrganizerL(aCalEntry, orgName->Des(), orgEmail->Des(), orgEmail->Des()); |
|
584 CleanupStack::PopAndDestroy(); // orgName |
|
585 CleanupStack::PopAndDestroy(); // orgEmail |
|
586 } |
|
587 |
|
588 void CCreatorInterimCalendar::AddRepeatingRuleL(const TCalTime& aStartTime, CCalEntry& aCalEntry, CCalenderInterimParameters* parameters ) |
|
589 { |
|
590 RArray<TDay> days; |
|
591 CleanupClosePushL(days); |
|
592 |
|
593 // Recurrence rule. Weekly event. |
|
594 if( parameters->iNumberRepeatingEntries > 0 ) |
|
595 { |
|
596 TCalRRule calRepeat(TCalRRule::EWeekly); |
|
597 calRepeat.SetDtStart(aStartTime); |
|
598 calRepeat.SetCount(parameters->iNumberRepeatingEntries); |
|
599 calRepeat.SetInterval(1); |
|
600 //days.AppendL((TDay) iEngine->RandomNumber((TInt)EMonday, (TInt) ESunday)); |
|
601 TDay tempDay(aStartTime.TimeLocalL().DayNoInWeek()); |
|
602 days.AppendL(tempDay); |
|
603 calRepeat.SetByDay(days); |
|
604 aCalEntry.SetRRuleL(calRepeat); |
|
605 } |
|
606 else if(parameters->iRecurrentFrequency > TCalRRule::EInvalid) |
|
607 { |
|
608 TCalTime calTime; |
|
609 // Recurrent frequency |
|
610 TCalRRule calRepeat(parameters->iRecurrentFrequency); |
|
611 // Recurrent start |
|
612 calRepeat.SetDtStart(aStartTime); |
|
613 if( parameters->iRecurrentFrequency == TCalRRule::EWeekly ) |
|
614 { |
|
615 TDay tempDay(aStartTime.TimeLocalL().DayNoInWeek()); |
|
616 days.AppendL(tempDay); |
|
617 calRepeat.SetByDay(days); |
|
618 } |
|
619 else if( parameters->iRecurrentFrequency == TCalRRule::EMonthly ) |
|
620 { |
|
621 RArray< TInt > daysInMonth; |
|
622 CleanupClosePushL(daysInMonth); |
|
623 daysInMonth.AppendL(aStartTime.TimeLocalL().DayNoInMonth()); |
|
624 calRepeat.SetByMonthDay(daysInMonth); |
|
625 CleanupStack::PopAndDestroy(&daysInMonth); |
|
626 } |
|
627 else if( parameters->iRecurrentFrequency == TCalRRule::EYearly) |
|
628 { |
|
629 RArray< TMonth > monthsInYear; |
|
630 CleanupClosePushL(monthsInYear); |
|
631 monthsInYear.AppendL(aStartTime.TimeLocalL().DateTime().Month()); |
|
632 calRepeat.SetByMonth(monthsInYear); |
|
633 CleanupStack::PopAndDestroy(&monthsInYear); |
|
634 } |
|
635 |
|
636 // Recurrent interval |
|
637 if( parameters->iRecurrentInterval > 0 ) |
|
638 calRepeat.SetInterval(parameters->iRecurrentInterval); |
|
639 |
|
640 // Recurrent end. End can be given as a number of repeating entries or as an end date. |
|
641 // End date must be later than the start date, otherwise CCalEntry::SetRRuleL() panics. |
|
642 if( parameters->iRepeatingCount > 0 ) |
|
643 { |
|
644 calRepeat.SetCount(parameters->iRepeatingCount); |
|
645 aCalEntry.SetRRuleL(calRepeat); |
|
646 } |
|
647 else |
|
648 { |
|
649 TCalTime endTime; |
|
650 endTime.SetTimeLocalL(parameters->iRecurrentEndTime); |
|
651 if( endTime.TimeLocalL() > aStartTime.TimeLocalL()) |
|
652 { |
|
653 calRepeat.SetUntil(endTime); |
|
654 aCalEntry.SetRRuleL(calRepeat); |
|
655 } |
|
656 } |
|
657 } |
|
658 CleanupStack::PopAndDestroy(&days); |
|
659 } |
|
660 |
|
661 void CCreatorInterimCalendar::SetAlarmL(CCalEntry& aCalEntry, CCalenderInterimParameters* params) |
|
662 { |
|
663 if( params->iAlarmTime != Time::NullTTime() ) |
|
664 { |
|
665 CCalAlarm* alarm = CCalAlarm::NewL(); |
|
666 CleanupStack::PushL(alarm); |
|
667 //if( params->iAlarmTime <= params->iStartTime ) |
|
668 // { |
|
669 TTimeIntervalMinutes diff; |
|
670 TInt err = params->iStartTime.MinutesFrom(params->iAlarmTime, diff); |
|
671 if( err == KErrNone) |
|
672 { |
|
673 alarm->SetTimeOffset(diff); |
|
674 TRAP(err, aCalEntry.SetAlarmL(alarm)); |
|
675 if( err != KErrNone && err != KErrNotSupported ) |
|
676 { |
|
677 User::Leave(err); |
|
678 } |
|
679 } |
|
680 // } |
|
681 CleanupStack::PopAndDestroy(alarm); |
|
682 } |
|
683 } |
|
684 |
|
685 void CCreatorInterimCalendar::SetRandomAlarmL(CCalEntry& aCalEntry) |
|
686 { |
|
687 CCalAlarm* alarm = CCalAlarm::NewL(); |
|
688 CleanupStack::PushL(alarm); |
|
689 alarm->SetTimeOffset(TTimeIntervalMinutes(iEngine->RandomNumber(0, 60))); |
|
690 |
|
691 TRAPD(err, aCalEntry.SetAlarmL(alarm)); |
|
692 if( err != KErrNone && err != KErrNotSupported ) |
|
693 { |
|
694 User::Leave(err); |
|
695 } |
|
696 CleanupStack::PopAndDestroy(alarm); |
|
697 } |
|
698 |
|
699 void CCreatorInterimCalendar::SetPhoneOwnerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy ) |
|
700 { |
|
701 CCalUser* phOwner = CCalUser::NewL(aEmail, aSentBy); |
|
702 CleanupStack::PushL(phOwner); |
|
703 TRAPD(err, aCalEntry.SetPhoneOwnerL(phOwner)); |
|
704 CleanupStack::Pop(phOwner); |
|
705 if( err == KErrNone ) |
|
706 { |
|
707 phOwner->SetCommonNameL(aCN); |
|
708 } |
|
709 else |
|
710 { |
|
711 delete phOwner; |
|
712 } |
|
713 } |
|
714 |
|
715 void CCreatorInterimCalendar::SetOrganizerL(CCalEntry& aCalEntry, const TDesC& aCN, const TDesC& aEmail, const TDesC& aSentBy) |
|
716 { |
|
717 CCalUser* organizer = CCalUser::NewL(aEmail, aSentBy); |
|
718 CleanupStack::PushL(organizer); |
|
719 TRAPD(err, aCalEntry.SetOrganizerL(organizer)); |
|
720 CleanupStack::Pop(organizer); |
|
721 if( err == KErrNone ) |
|
722 { |
|
723 organizer->SetCommonNameL(aCN); |
|
724 } |
|
725 else |
|
726 { |
|
727 delete organizer; |
|
728 } |
|
729 } |
|
730 |
|
731 void CCreatorInterimCalendar::AddAttendeesL(CCalEntry& aCalEntry, CCalenderInterimParameters* parameters ) |
|
732 { |
|
733 if( !parameters ) |
|
734 return; |
|
735 |
|
736 // Random attendees: |
|
737 TInt numOfAttendees = parameters->iNumberOfAttendees; |
|
738 for( TInt i = 0; i < numOfAttendees; ++i ) |
|
739 { |
|
740 TPtrC firstname = iEngine->RandomString(CCreatorEngine::EFirstName); |
|
741 TPtrC lastname = iEngine->RandomString(CCreatorEngine::ESurname); |
|
742 TPtrC company = iEngine->RandomString(CCreatorEngine::ECompany); |
|
743 _LIT(KCountry, "com"); |
|
744 TDesC* emailAddr = iEngine->CreateEmailAddressLC(firstname, lastname, company, KCountry); |
|
745 CCalAttendee* attendee = CCalAttendee::NewL(*emailAddr); |
|
746 CleanupStack::PushL(attendee); |
|
747 aCalEntry.AddAttendeeL(attendee); |
|
748 CleanupStack::Pop(attendee); |
|
749 attendee->SetCommonNameL(firstname); |
|
750 |
|
751 // Set phone owner: |
|
752 if( i == 1 ) |
|
753 { |
|
754 SetPhoneOwnerL(aCalEntry, firstname, *emailAddr, *emailAddr); |
|
755 attendee->SetRoleL(CCalAttendee::EReqParticipant); |
|
756 } |
|
757 // Set organizer: |
|
758 else if ( i == 0 ) |
|
759 { |
|
760 // Organizer is the chairman of the meeting: |
|
761 SetOrganizerL(aCalEntry, firstname, *emailAddr, *emailAddr); |
|
762 attendee->SetRoleL(CCalAttendee::EChair); |
|
763 } |
|
764 else if( i % 3 == 0 ) |
|
765 { |
|
766 // every third attendee is optional: |
|
767 attendee->SetRoleL(CCalAttendee::EOptParticipant); |
|
768 } |
|
769 else |
|
770 { |
|
771 // Others are required attendees: |
|
772 attendee->SetRoleL(CCalAttendee::EReqParticipant); |
|
773 } |
|
774 |
|
775 TInt attStatus = iEngine->RandomNumber(0,5); |
|
776 attendee->SetStatusL((CCalAttendee::TCalStatus) attStatus); |
|
777 |
|
778 CleanupStack::PopAndDestroy(emailAddr); |
|
779 } |
|
780 |
|
781 // Explicit attendees: |
|
782 for( TInt i = 0; i < parameters->iAttendees.Count(); ++i ) |
|
783 { |
|
784 CCreatorCalenderAttendee* attendeeInfo = parameters->iAttendees[i]; |
|
785 if( attendeeInfo && attendeeInfo->EmailAddress().Length() > 0) |
|
786 { |
|
787 CCalAttendee* attendee = CCalAttendee::NewL(attendeeInfo->EmailAddress()); |
|
788 CleanupStack::PushL(attendee); |
|
789 if( attendeeInfo->CommonName().Length() > 0 ) |
|
790 attendee->SetCommonNameL(attendeeInfo->CommonName()); |
|
791 attendee->SetRoleL(attendeeInfo->Role()); |
|
792 attendee->SetStatusL(attendeeInfo->Status()); |
|
793 attendee->SetResponseRequested(ETrue); |
|
794 aCalEntry.AddAttendeeL(attendee); |
|
795 CleanupStack::Pop(); // attendee |
|
796 } |
|
797 } |
|
798 |
|
799 // Linked attendees: |
|
800 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__) |
|
801 |
|
802 CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC(); |
|
803 uriArray->AppendL( TVPbkContactStoreUriPtr(VPbkContactStoreUris::DefaultCntDbUri())); |
|
804 |
|
805 if( iContactManager == 0 ) |
|
806 { |
|
807 iContactManager = CVPbkContactManager::NewL( *uriArray, &CCoeEnv::Static()->FsSession()); |
|
808 } |
|
809 CleanupStack::PopAndDestroy(uriArray); |
|
810 |
|
811 if( iContactManager ) |
|
812 { |
|
813 MVPbkContactStoreList& storeList = iContactManager->ContactStoresL(); |
|
814 storeList.OpenAllL(*this); |
|
815 iWaiter->StartAndWait(); |
|
816 |
|
817 // Sum number of existing contacts: |
|
818 for( TInt i = 0; i < parameters->iAttendeeLinkIds.Count(); ++i ) |
|
819 { |
|
820 TLinkIdParam id = parameters->iAttendeeLinkIds[i]; |
|
821 parameters->iNumberOfExistingAttendees += ContactLinkCache::Instance()->ContactSet(id.iLinkId).NumberOfExistingContacts(); |
|
822 } |
|
823 |
|
824 // Existing attendees: |
|
825 if( parameters->iNumberOfExistingAttendees > 0 ) |
|
826 { |
|
827 _LIT(dbUri, "cntdb://c:contacts.cdb"); |
|
828 TVPbkContactStoreUriPtr uri(dbUri); |
|
829 MVPbkContactStore* store = storeList.Find(uri); |
|
830 if( store ) |
|
831 { |
|
832 const MVPbkFieldTypeList& fieldList = store->StoreProperties().SupportedFields(); |
|
833 |
|
834 // get contacts, results will be set to iContactResults |
|
835 MVPbkContactOperationBase* operation = iContactManager->FindL(_L(""), fieldList , *this); |
|
836 if (operation) |
|
837 { |
|
838 CleanupDeletePushL( operation ); |
|
839 iWaiter->StartAndWait();//Making asynchronous FindL to synchronous |
|
840 CleanupStack::Pop(operation); |
|
841 delete operation; |
|
842 } |
|
843 if( iExistingContacts ) |
|
844 { |
|
845 for( TInt i = 0; i < iExistingContacts->Count() && i < parameters->iNumberOfExistingAttendees; ++i ) |
|
846 { |
|
847 MVPbkContactOperationBase* operation = iContactManager->RetrieveContactL( iExistingContacts->At(i), *this ); |
|
848 |
|
849 if (operation) |
|
850 { |
|
851 CleanupDeletePushL( operation ); |
|
852 iWaiter->StartAndWait(); // Making asynchronous RetrieveContactL to synchronous |
|
853 CleanupStack::Pop(); // operation |
|
854 delete operation; |
|
855 operation = 0; |
|
856 HandleSingleContactResultL(); |
|
857 CCalAttendee* attendee = 0; |
|
858 if( iTmpEmail && iTmpEmail->Length() > 0 ) |
|
859 { |
|
860 attendee = CCalAttendee::NewL(*iTmpEmail); |
|
861 } |
|
862 else |
|
863 { |
|
864 _LIT(KDummy, ""); |
|
865 attendee = CCalAttendee::NewL(KDummy); |
|
866 } |
|
867 CleanupStack::PushL(attendee); |
|
868 if( iTmpCN && iTmpCN->Length() > 0 ) |
|
869 { |
|
870 attendee->SetCommonNameL(*iTmpCN); |
|
871 } |
|
872 attendee->SetRoleL(CCalAttendee::EReqParticipant); |
|
873 attendee->SetStatusL(CCalAttendee::EAccepted); |
|
874 attendee->SetResponseRequested(ETrue); |
|
875 aCalEntry.AddAttendeeL(attendee); |
|
876 CleanupStack::Pop(attendee); |
|
877 } |
|
878 } |
|
879 } |
|
880 } |
|
881 } |
|
882 |
|
883 for( TInt i = 0; i < parameters->iAttendeeLinkIds.Count(); ++i ) |
|
884 { |
|
885 TLinkIdParam id = parameters->iAttendeeLinkIds[i]; |
|
886 RPointerArray<MVPbkContactLink>& links = ContactLinkCache::Instance()->ContactLinks(id.iLinkId); |
|
887 for( TInt j = 0; j < links.Count() && (id.iLinkAmount < 0 || j < id.iLinkAmount); ++j ) |
|
888 { |
|
889 MVPbkContactOperationBase* operation = iContactManager->RetrieveContactL( *(links[j]), *this ); |
|
890 if (operation) |
|
891 { |
|
892 CleanupDeletePushL( operation ); |
|
893 iWaiter->StartAndWait(); // Making asynchronous RetrieveContactL to synchronous |
|
894 CleanupStack::Pop(operation); |
|
895 delete operation; |
|
896 operation = 0; |
|
897 HandleSingleContactResultL(); |
|
898 CCalAttendee* attendee = 0; |
|
899 if( iTmpEmail && iTmpEmail->Length() > 0 ) |
|
900 { |
|
901 attendee = CCalAttendee::NewL(*iTmpEmail); |
|
902 } |
|
903 else |
|
904 { |
|
905 _LIT(KDummy, ""); |
|
906 attendee = CCalAttendee::NewL(KDummy); |
|
907 } |
|
908 CleanupStack::PushL(attendee); |
|
909 if( iTmpCN && iTmpCN->Length() > 0 ) |
|
910 { |
|
911 attendee->SetCommonNameL(*iTmpCN); |
|
912 } |
|
913 attendee->SetRoleL(CCalAttendee::EReqParticipant); |
|
914 attendee->SetStatusL(CCalAttendee::EAccepted); |
|
915 attendee->SetResponseRequested(ETrue); |
|
916 aCalEntry.AddAttendeeL(attendee); |
|
917 CleanupStack::Pop(attendee); |
|
918 } |
|
919 } |
|
920 } |
|
921 |
|
922 storeList.CloseAll(*this); |
|
923 } |
|
924 #endif |
|
925 } |
|
926 //---------------------------------------------------------------------------- |
|
927 |
|
928 TInt CCreatorInterimCalendar::CreateEventEntryL ( |
|
929 CCreatorModuleBaseParameters *aParameters ) |
|
930 { |
|
931 LOGSTRING("Creator: CCreatorInterimCalendar::CreateEventEntryL"); |
|
932 |
|
933 delete iParameters; |
|
934 iParameters = 0; |
|
935 |
|
936 CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters; |
|
937 |
|
938 // random data needed if no predefined data available |
|
939 if (!parameters ) |
|
940 { |
|
941 iParameters = new(ELeave) CCalenderInterimParameters; |
|
942 |
|
943 iParameters->iRandomModeStartTime = iRandomModeStartTime; |
|
944 iParameters->iRandomModeEndTime = iRandomModeEndTime; |
|
945 iParameters->iNumberRepeatingEntries = iNumberRepeatingEntries; |
|
946 iParameters->iNumberOfAttendees = iNumberOfAttendees; |
|
947 |
|
948 // difference between start and end times |
|
949 TTimeIntervalMinutes differenceInMinutes; |
|
950 iParameters->iRandomModeEndTime.MinutesFrom ( |
|
951 iParameters->iRandomModeStartTime, differenceInMinutes ); |
|
952 |
|
953 // start time (= something between the period start and end date) |
|
954 iParameters->iStartTime = iParameters->iRandomModeStartTime; |
|
955 iParameters->iStartTime |
|
956 += TTimeIntervalMinutes (iEngine->RandomNumber (differenceInMinutes.Int ( ) ) ); |
|
957 |
|
958 // set end time (= start time + some random time) |
|
959 iParameters->iEndTime = iParameters->iStartTime; |
|
960 iParameters->iEndTime |
|
961 += TTimeIntervalMinutes (iEngine->RandomNumber (5, 500 ) ); |
|
962 |
|
963 // strings |
|
964 iParameters->iDescription->Des() |
|
965 = iEngine->RandomString (CCreatorEngine::EMemoText ); |
|
966 |
|
967 iParameters->iSummary->Des() = iParameters->iDescription->Des(); |
|
968 |
|
969 // Random event status: |
|
970 iParameters->iStatus = |
|
971 (CCalEntry::TStatus) iEngine->RandomNumber(0, (TInt) CCalEntry::ECancelled); |
|
972 |
|
973 parameters = iParameters; |
|
974 } |
|
975 |
|
976 TInt err = KErrNone; |
|
977 HBufC8* guid = HBufC8::NewLC (255 ); |
|
978 TPtr8 uidP=guid->Des ( ); |
|
979 GenerateRandomId (uidP ); |
|
980 CCalEntry* entry = CCalEntry::NewL (CCalEntry::EEvent, guid, |
|
981 CCalEntry::EMethodAdd, 0 ); |
|
982 CleanupStack::PushL (entry ); |
|
983 // iEntryUids->AppendL( *guid->Alloc() ); |
|
984 |
|
985 entry->SetDescriptionL (parameters->iDescription->Des ( ) ); |
|
986 entry->SetSummaryL (parameters->iSummary->Des ( ) ); |
|
987 |
|
988 TCalTime startTime; |
|
989 TCalTime endTime; |
|
990 // Set the start and end times using time values local to the current system time zone |
|
991 startTime.SetTimeLocalL (parameters->iStartTime ); |
|
992 endTime.SetTimeLocalL (parameters->iEndTime ); |
|
993 entry->SetStartAndEndTimeL (startTime, endTime ); |
|
994 |
|
995 // Repeating times: |
|
996 AddRepeatingRuleL(startTime, *entry, parameters); |
|
997 |
|
998 if( iSetAlarm || parameters->iUseRandomAlarmTime ) |
|
999 { |
|
1000 SetRandomAlarmL(*entry); |
|
1001 } |
|
1002 else |
|
1003 { |
|
1004 SetAlarmL(*entry, parameters); |
|
1005 } |
|
1006 |
|
1007 // Add attendees: |
|
1008 AddAttendeesL(*entry, parameters); |
|
1009 |
|
1010 if( parameters->IsAllowedEntryStatus(CCalEntry::EEvent, parameters->iStatus)) |
|
1011 { |
|
1012 LOGSTRING2("Creator: CCreatorInterimCalendar::CreateEventEntryL setting entry status: %d", parameters->iStatus); |
|
1013 entry->SetStatusL(parameters->iStatus); |
|
1014 } |
|
1015 |
|
1016 RPointerArray<CCalEntry> array; |
|
1017 CleanupClosePushL (array ); |
|
1018 array.AppendL (entry ); |
|
1019 |
|
1020 TInt success(0); |
|
1021 //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed |
|
1022 iCalEntryView->StoreL (array, success ); |
|
1023 |
|
1024 // id has been generated, store it for being able to delete |
|
1025 // entries created only with Creator |
|
1026 iEntryIds.Append( entry->LocalUidL() ); |
|
1027 |
|
1028 //One item should be added at time |
|
1029 if (success != 1 ) |
|
1030 { |
|
1031 err = 1; |
|
1032 } |
|
1033 |
|
1034 CleanupStack::PopAndDestroy (&array ); |
|
1035 CleanupStack::PopAndDestroy (entry ); |
|
1036 CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid |
|
1037 return err; |
|
1038 |
|
1039 } |
|
1040 |
|
1041 //---------------------------------------------------------------------------- |
|
1042 |
|
1043 |
|
1044 TInt CCreatorInterimCalendar::CreateReminderEntryL ( |
|
1045 CCreatorModuleBaseParameters *aParameters ) |
|
1046 { |
|
1047 LOGSTRING("Creator: CCreatorInterimCalendar::CreateReminderEntryL"); |
|
1048 |
|
1049 delete iParameters; |
|
1050 iParameters = NULL; |
|
1051 |
|
1052 CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters; |
|
1053 |
|
1054 // random data needed if no predefined data available |
|
1055 if (!parameters ) |
|
1056 { |
|
1057 iParameters = new(ELeave) CCalenderInterimParameters; |
|
1058 |
|
1059 iParameters->iRandomModeStartTime = iRandomModeStartTime; |
|
1060 iParameters->iRandomModeEndTime = iRandomModeEndTime; |
|
1061 |
|
1062 // difference between start and end times |
|
1063 TTimeIntervalDays |
|
1064 differenceInDays = iParameters->iRandomModeEndTime.DaysFrom (iParameters->iRandomModeStartTime ); |
|
1065 |
|
1066 // due time (= something between the period start and end date) |
|
1067 iParameters->iStartTime = iParameters->iRandomModeStartTime; |
|
1068 iParameters->iStartTime |
|
1069 += TTimeIntervalDays (iEngine->RandomNumber (differenceInDays.Int ( ) ) ); |
|
1070 |
|
1071 // strings |
|
1072 iParameters->iDescription->Des() |
|
1073 = iEngine->RandomString (CCreatorEngine::EReminderText ); |
|
1074 |
|
1075 iParameters->iSummary->Des() = iParameters->iDescription->Des(); |
|
1076 |
|
1077 parameters = iParameters; |
|
1078 } |
|
1079 |
|
1080 TInt err = KErrNone; |
|
1081 |
|
1082 HBufC8* guid = HBufC8::NewLC (255 ); |
|
1083 TPtr8 uidP=guid->Des ( ); |
|
1084 GenerateRandomId (uidP ); |
|
1085 |
|
1086 CCalEntry* entry = CCalEntry::NewL (CCalEntry::EReminder, guid, |
|
1087 CCalEntry::EMethodAdd, 0 ); |
|
1088 CleanupStack::PushL (entry ); |
|
1089 |
|
1090 //Using same text as description and summary |
|
1091 entry->SetDescriptionL (parameters->iDescription->Des ( ) ); |
|
1092 entry->SetSummaryL (parameters->iSummary->Des ( ) ); |
|
1093 |
|
1094 TCalTime startTime; |
|
1095 TCalTime endTime; |
|
1096 // Set the start and end times using time values local to the current system time zone |
|
1097 startTime.SetTimeLocalL (parameters->iStartTime ); |
|
1098 TTime nullTime = Time::NullTTime ( ); |
|
1099 endTime.SetTimeLocalL (nullTime ); |
|
1100 entry->SetStartAndEndTimeL (startTime, endTime ); |
|
1101 |
|
1102 if( parameters->IsAllowedEntryStatus(CCalEntry::EReminder, parameters->iStatus)) |
|
1103 { |
|
1104 LOGSTRING2("Creator: CCreatorInterimCalendar::CreateReminderEntryL setting entry status: %d", parameters->iStatus); |
|
1105 entry->SetStatusL(parameters->iStatus); |
|
1106 } |
|
1107 |
|
1108 if( iSetAlarm || parameters->iUseRandomAlarmTime ) |
|
1109 { |
|
1110 SetRandomAlarmL(*entry); |
|
1111 } |
|
1112 else |
|
1113 { |
|
1114 SetAlarmL(*entry, parameters); |
|
1115 } |
|
1116 |
|
1117 RPointerArray<CCalEntry> array; |
|
1118 CleanupClosePushL (array ); |
|
1119 array.AppendL (entry ); |
|
1120 |
|
1121 TInt success(0); |
|
1122 //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed |
|
1123 iCalEntryView->StoreL (array, success ); |
|
1124 |
|
1125 // id has been generated, store it for being able to delete |
|
1126 // entries created only with Creator |
|
1127 iEntryIds.Append( entry->LocalUidL() ); |
|
1128 |
|
1129 //One item should be added at time |
|
1130 if (success != 1 ) |
|
1131 { |
|
1132 err = 1; |
|
1133 } |
|
1134 |
|
1135 CleanupStack::PopAndDestroy (&array ); |
|
1136 CleanupStack::PopAndDestroy (entry ); |
|
1137 CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid |
|
1138 |
|
1139 return err; |
|
1140 } |
|
1141 |
|
1142 //---------------------------------------------------------------------------- |
|
1143 |
|
1144 TInt CCreatorInterimCalendar::CreateAnniversaryEntryL ( |
|
1145 CCreatorModuleBaseParameters *aParameters ) |
|
1146 { |
|
1147 LOGSTRING("Creator: CCreatorInterimCalendar::CreateAnniversaryEntryL"); |
|
1148 |
|
1149 delete iParameters; |
|
1150 iParameters = NULL; |
|
1151 |
|
1152 CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters; |
|
1153 |
|
1154 // random data needed if no predefined data available |
|
1155 if (!parameters ) |
|
1156 { |
|
1157 iParameters = new(ELeave) CCalenderInterimParameters; |
|
1158 |
|
1159 iParameters->iRandomModeStartTime = iRandomModeStartTime; |
|
1160 iParameters->iRandomModeEndTime = iRandomModeEndTime; |
|
1161 |
|
1162 // difference between start and end times |
|
1163 TTimeIntervalDays differenceInDays = iParameters->iRandomModeEndTime.DaysFrom(iParameters->iRandomModeStartTime); |
|
1164 |
|
1165 // start time (= something between the period start and end date) |
|
1166 iParameters->iStartTime = iParameters->iRandomModeStartTime; |
|
1167 iParameters->iStartTime += TTimeIntervalDays( iEngine->RandomNumber(differenceInDays.Int()) ); |
|
1168 |
|
1169 // strings |
|
1170 iParameters->iDescription->Des().Copy (iEngine->RandomString (CCreatorEngine::EFirstName ) ); |
|
1171 iParameters->iDescription->Des().Append ( _L("'s ") ); |
|
1172 iParameters->iDescription->Des().Append (iEngine->RandomString (CCreatorEngine::EAnniversaryReason ) ); |
|
1173 iParameters->iSummary->Des() = iParameters->iDescription->Des(); |
|
1174 parameters = iParameters; |
|
1175 } |
|
1176 |
|
1177 TInt err = KErrNone; |
|
1178 |
|
1179 HBufC8* guid = HBufC8::NewLC (255 ); |
|
1180 TPtr8 uidP=guid->Des ( ); |
|
1181 GenerateRandomId (uidP ); |
|
1182 |
|
1183 CCalEntry* entry = CCalEntry::NewL (CCalEntry::EAnniv, guid, |
|
1184 CCalEntry::EMethodNone, 0 ); |
|
1185 CleanupStack::PushL (entry ); |
|
1186 |
|
1187 //Using same text as description and summary |
|
1188 entry->SetDescriptionL (parameters->iDescription->Des ( ) ); |
|
1189 entry->SetSummaryL (parameters->iSummary->Des ( ) ); |
|
1190 |
|
1191 TCalTime startTime; |
|
1192 TCalTime endTime; |
|
1193 TTime nullTime = Time::NullTTime ( ); |
|
1194 endTime.SetTimeLocalL (nullTime ); |
|
1195 |
|
1196 // Set the start time using time value local to the current system time zone |
|
1197 startTime.SetTimeLocalL (parameters->iStartTime ); |
|
1198 |
|
1199 entry->SetStartAndEndTimeL (startTime, endTime ); |
|
1200 |
|
1201 if( iSetAlarm || parameters->iUseRandomAlarmTime ) |
|
1202 { |
|
1203 SetRandomAlarmL(*entry); |
|
1204 } |
|
1205 else |
|
1206 { |
|
1207 SetAlarmL(*entry, parameters); |
|
1208 } |
|
1209 |
|
1210 //set repeating rule |
|
1211 TCalRRule yearlyRptRule(TCalRRule::EYearly); |
|
1212 yearlyRptRule.SetDtStart (startTime ); |
|
1213 //Set repeating until forever, not setting it to stop |
|
1214 //yearlyRptRule.SetUntil(endTime); |
|
1215 entry->SetRRuleL (yearlyRptRule ); |
|
1216 |
|
1217 RPointerArray<CCalEntry> array; |
|
1218 CleanupClosePushL (array ); |
|
1219 array.AppendL (entry ); |
|
1220 |
|
1221 TInt success(0); |
|
1222 //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed |
|
1223 iCalEntryView->StoreL (array, success ); |
|
1224 |
|
1225 // id has been generated, store it for being able to delete |
|
1226 // entries created only with Creator |
|
1227 iEntryIds.Append( entry->LocalUidL() ); |
|
1228 |
|
1229 //One item should be added at time |
|
1230 if (success != 1 ) |
|
1231 { |
|
1232 err = 1; |
|
1233 } |
|
1234 |
|
1235 CleanupStack::PopAndDestroy (&array ); |
|
1236 CleanupStack::PopAndDestroy (entry ); |
|
1237 CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid |
|
1238 |
|
1239 return err; |
|
1240 } |
|
1241 |
|
1242 //---------------------------------------------------------------------------- |
|
1243 |
|
1244 TInt CCreatorInterimCalendar::CreateTodoEntryL ( |
|
1245 CCreatorModuleBaseParameters *aParameters ) |
|
1246 { |
|
1247 LOGSTRING("Creator: CCreatorInterimCalendar::CreateTodoEntryL"); |
|
1248 |
|
1249 delete iParameters; |
|
1250 iParameters = NULL; |
|
1251 |
|
1252 CCalenderInterimParameters* parameters = (CCalenderInterimParameters*)aParameters; |
|
1253 |
|
1254 // random data needed if no predefined data available |
|
1255 if (!parameters ) |
|
1256 { |
|
1257 iParameters = new(ELeave) CCalenderInterimParameters; |
|
1258 |
|
1259 iParameters->iRandomModeStartTime = iRandomModeStartTime; |
|
1260 iParameters->iRandomModeEndTime = iRandomModeEndTime; |
|
1261 |
|
1262 // difference between start and end times |
|
1263 TTimeIntervalDays |
|
1264 differenceInDays = iParameters->iRandomModeEndTime.DaysFrom (iParameters->iRandomModeStartTime ); |
|
1265 |
|
1266 // due time (= something between the period start and end date) |
|
1267 iParameters->iTodoDueTime = iParameters->iRandomModeStartTime; |
|
1268 iParameters->iTodoDueTime |
|
1269 += TTimeIntervalDays (iEngine->RandomNumber (differenceInDays.Int ( ) ) ); |
|
1270 |
|
1271 // strings |
|
1272 iParameters->iDescription->Des ( ) |
|
1273 = iEngine->RandomString (CCreatorEngine::EToDoText ); |
|
1274 |
|
1275 iParameters->iSummary->Des() = iParameters->iDescription->Des(); |
|
1276 |
|
1277 //priority |
|
1278 iParameters->iTodoPriority = iEngine->RandomNumber (1, 3 ); |
|
1279 iParameters->iStatus = (CCalEntry::TStatus) iEngine->RandomNumber((TInt) CCalEntry::ETodoNeedsAction, (TInt) CCalEntry::ETodoInProcess); |
|
1280 parameters = iParameters; |
|
1281 |
|
1282 } |
|
1283 |
|
1284 TInt err = KErrNone; |
|
1285 |
|
1286 HBufC8* guid = HBufC8::NewLC (255 ); |
|
1287 TPtr8 uidP=guid->Des ( ); |
|
1288 GenerateRandomId (uidP ); |
|
1289 |
|
1290 CCalEntry* entry = CCalEntry::NewL (CCalEntry::ETodo, guid, |
|
1291 CCalEntry::EMethodAdd, 0 ); |
|
1292 CleanupStack::PushL (entry ); |
|
1293 |
|
1294 //Using same text as description and summary |
|
1295 entry->SetDescriptionL (parameters->iDescription->Des ( ) ); |
|
1296 entry->SetSummaryL (parameters->iSummary->Des ( ) ); |
|
1297 |
|
1298 entry->SetPriorityL (parameters->iTodoPriority ); |
|
1299 |
|
1300 if( parameters->IsAllowedEntryStatus(CCalEntry::ETodo, parameters->iStatus)) |
|
1301 { |
|
1302 LOGSTRING2("Creator: CCreatorInterimCalendar::CreateTodoEntryL setting entry status: %d", parameters->iStatus); |
|
1303 entry->SetStatusL(parameters->iStatus); |
|
1304 } |
|
1305 |
|
1306 TCalTime startTime; |
|
1307 TCalTime endTime; |
|
1308 // Set the start and end times using time values local to the current system time zone |
|
1309 startTime.SetTimeLocalL (parameters->iTodoDueTime ); |
|
1310 endTime.SetTimeLocalL (parameters->iTodoDueTime ); |
|
1311 entry->SetStartAndEndTimeL (startTime, endTime ); |
|
1312 |
|
1313 if( iSetAlarm || parameters->iUseRandomAlarmTime ) |
|
1314 { |
|
1315 SetRandomAlarmL(*entry); |
|
1316 } |
|
1317 else |
|
1318 { |
|
1319 SetAlarmL(*entry, parameters); |
|
1320 } |
|
1321 |
|
1322 RPointerArray<CCalEntry> array; |
|
1323 CleanupClosePushL (array ); |
|
1324 array.AppendL (entry ); |
|
1325 |
|
1326 TInt success(0); |
|
1327 //If StoreL() leaves, 'success' contains the number of entries that were stored before it failed |
|
1328 iCalEntryView->StoreL (array, success ); |
|
1329 |
|
1330 // id has been generated, store it for being able to delete |
|
1331 // entries created only with Creator |
|
1332 iEntryIds.Append( entry->LocalUidL() ); |
|
1333 |
|
1334 //One item should be added at time |
|
1335 if (success != 1 ) |
|
1336 { |
|
1337 err = 1; |
|
1338 } |
|
1339 |
|
1340 CleanupStack::PopAndDestroy (&array ); |
|
1341 CleanupStack::PopAndDestroy (entry ); |
|
1342 CleanupStack::Pop (guid );//guid has been destroyed by entry, which has ownership to guid |
|
1343 |
|
1344 return err; |
|
1345 } |
|
1346 |
|
1347 //---------------------------------------------------------------------------- |
|
1348 |
|
1349 void CCreatorInterimCalendar::Progress (TInt /*aPercentageCompleted*/) |
|
1350 { |
|
1351 //Not really needed but observer need to be implement |
|
1352 } |
|
1353 |
|
1354 void CCreatorInterimCalendar::Completed (TInt aError ) |
|
1355 { |
|
1356 //Not really needed but observer need to be implement |
|
1357 LOGSTRING2("Creator: CCreatorInterimCalendar::Completed err=%d", aError); |
|
1358 } |
|
1359 |
|
1360 TBool CCreatorInterimCalendar::NotifyProgress ( ) |
|
1361 { |
|
1362 //Not really needed but observer need to be implement |
|
1363 return NULL; |
|
1364 } |
|
1365 |
|
1366 //---------------------------------------------------------------------------- |
|
1367 |
|
1368 |
|
1369 void CCreatorInterimCalendar::GenerateRandomId (TDes8& aText ) |
|
1370 { |
|
1371 LOGSTRING("Creator: CCreatorInterimCalendar::GenerateRandomId"); |
|
1372 |
|
1373 aText.Zero ( ); |
|
1374 |
|
1375 TTime now; |
|
1376 now.UniversalTime ( ); |
|
1377 TInt64 time = now.Int64 ( ); |
|
1378 |
|
1379 // The number of characters in the guid should be |
|
1380 // more than 8 (to ensure the guids are not too small) |
|
1381 // less than 255 (this is the maximum length of a guid) |
|
1382 // less than MaxLength of the descriptor passed in |
|
1383 TInt numChar(0); |
|
1384 do |
|
1385 { |
|
1386 numChar = Math::Rand (time ) % (aText.MaxLength ( ) - 1); |
|
1387 } |
|
1388 while (numChar > 255|| numChar < 8 ); |
|
1389 |
|
1390 for (TInt i(0); i < numChar ; ++i ) |
|
1391 { |
|
1392 TInt character = Math::Rand (time )%6; |
|
1393 character = Math::Rand (time ) % 26+ ((character == 2) ? 'A' : 'a'); |
|
1394 aText.Append (character ); |
|
1395 } |
|
1396 |
|
1397 } |
|
1398 |
|
1399 //---------------------------------------------------------------------------- |
|
1400 void CCreatorInterimCalendar::DeleteAllL() |
|
1401 { |
|
1402 LOGSTRING("Creator: CCreatorInterimCalendar::DeleteAllL"); |
|
1403 TCalTime zeroTime; |
|
1404 zeroTime.SetTimeUtcL( TCalTime::MinTime() ); |
|
1405 RArray<TUint32> allIds; |
|
1406 CleanupClosePushL( allIds ); |
|
1407 iCalEntryView->GetIdsModifiedSinceDateL( zeroTime, allIds ); |
|
1408 if ( allIds.Count() ) |
|
1409 { |
|
1410 TInt successCount( KErrNotFound ); |
|
1411 iCalEntryView->DeleteL( allIds, successCount ); |
|
1412 if ( successCount != allIds.Count() ) |
|
1413 { |
|
1414 User::Leave( KErrGeneral ); |
|
1415 } |
|
1416 } |
|
1417 CleanupStack::PopAndDestroy( &allIds ); |
|
1418 |
|
1419 // reset must be done here, because iEntryIds is stored in destructor |
|
1420 iEntryIds.Reset(); |
|
1421 |
|
1422 // all entries deleted, remove the Calendar related registry |
|
1423 iEngine->RemoveStoreL( KUidDictionaryUidCalendar ); |
|
1424 } |
|
1425 |
|
1426 //---------------------------------------------------------------------------- |
|
1427 void CCreatorInterimCalendar::DeleteAllCreatedByCreatorL() |
|
1428 { |
|
1429 LOGSTRING("Creator: CCreatorInterimCalendar::DeleteAllCreatedByCreatorL"); |
|
1430 iEntryIds.Reset(); |
|
1431 |
|
1432 // fetch ids of entries created by Creator |
|
1433 iEngine->ReadEntryIdsFromStoreL( iEntryIds, KUidDictionaryUidCalendar ); |
|
1434 |
|
1435 // delete entries |
|
1436 TInt successCount(0); // ignore |
|
1437 TRAP_IGNORE( iCalEntryView->DeleteL( iEntryIds, successCount ) ); |
|
1438 |
|
1439 // reset must be done here, because iEntryIds is stored in destructor |
|
1440 iEntryIds.Reset(); |
|
1441 |
|
1442 // all entries deleted, remove the Calendar related registry |
|
1443 iEngine->RemoveStoreL( KUidDictionaryUidCalendar ); |
|
1444 } |
|
1445 |
|
1446 |
|
1447 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__) |
|
1448 void CCreatorInterimCalendar::VPbkSingleContactOperationComplete( |
|
1449 MVPbkContactOperationBase& /*aOperation*/, |
|
1450 MVPbkStoreContact* aContact ) |
|
1451 { |
|
1452 LOGSTRING("Creator: CCreatorInterimCalendar::VPbkSingleContactOperationComplete" ); |
|
1453 iWaiter->Cancel(); |
|
1454 delete iTempContact; |
|
1455 iTempContact = aContact; |
|
1456 } |
|
1457 void CCreatorInterimCalendar::HandleSingleContactResultL() |
|
1458 { |
|
1459 if( iTempContact ) |
|
1460 { |
|
1461 TPtrC firstName; |
|
1462 TPtrC lastName; |
|
1463 TPtrC email; |
|
1464 |
|
1465 // Put contact's name to temporary member: |
|
1466 delete iTmpCN; |
|
1467 iTmpCN = 0; |
|
1468 delete iTmpEmail; |
|
1469 iTmpEmail = 0; |
|
1470 |
|
1471 MVPbkStoreContactFieldCollection& fields = iTempContact->Fields(); |
|
1472 TInt fieldCount = fields.FieldCount(); |
|
1473 for (TInt i = 0; i < fieldCount; ++i) |
|
1474 { |
|
1475 MVPbkStoreContactField& field = fields.FieldAt(i); |
|
1476 MVPbkContactFieldData& fieldData = field.FieldData(); |
|
1477 const MVPbkFieldType* fieldType = field.BestMatchingFieldType(); |
|
1478 |
|
1479 if( fieldType ) |
|
1480 { |
|
1481 TInt fieldId( fieldType->FieldTypeResId() ); |
|
1482 |
|
1483 TVPbkFieldStorageType dataType = fieldData.DataType(); |
|
1484 if( dataType == EVPbkFieldStorageTypeText) |
|
1485 { |
|
1486 MVPbkContactFieldTextData& textData = MVPbkContactFieldTextData::Cast(fieldData); |
|
1487 if( fieldId == R_VPBK_FIELD_TYPE_FIRSTNAME ) |
|
1488 { |
|
1489 firstName.Set(textData.Text()); |
|
1490 } |
|
1491 else if( fieldId == R_VPBK_FIELD_TYPE_LASTNAME ) |
|
1492 { |
|
1493 lastName.Set(textData.Text()); |
|
1494 } |
|
1495 else if( fieldId == R_VPBK_FIELD_TYPE_EMAILGEN || |
|
1496 fieldId == R_VPBK_FIELD_TYPE_EMAILHOME || |
|
1497 fieldId == R_VPBK_FIELD_TYPE_EMAILWORK ) |
|
1498 { |
|
1499 email.Set(textData.Text()); |
|
1500 } |
|
1501 } |
|
1502 } |
|
1503 } |
|
1504 if( firstName.Length() > 0 && lastName.Length() > 0 ) |
|
1505 { |
|
1506 _LIT(KSpace, " "); |
|
1507 TRAPD(err, iTmpCN = HBufC::NewL(firstName.Length() + lastName.Length() + 1 )); |
|
1508 if( err == KErrNone ) |
|
1509 { |
|
1510 iTmpCN->Des().Copy(firstName); |
|
1511 iTmpCN->Des().Append(KSpace); |
|
1512 iTmpCN->Des().Append(lastName); |
|
1513 } |
|
1514 } |
|
1515 else if( firstName.Length() > 0 ) |
|
1516 { |
|
1517 TRAPD(err, iTmpCN = HBufC::NewL(firstName.Length())); |
|
1518 if( err == KErrNone ) |
|
1519 { |
|
1520 iTmpCN->Des().Copy(firstName); |
|
1521 } |
|
1522 } |
|
1523 else if( lastName.Length() > 0 ) |
|
1524 { |
|
1525 TRAPD(err, iTmpCN = HBufC::NewL(lastName.Length())); |
|
1526 if( err == KErrNone ) |
|
1527 { |
|
1528 iTmpCN->Des().Copy(lastName); |
|
1529 } |
|
1530 } |
|
1531 |
|
1532 if( email.Length() > 0 ) |
|
1533 { |
|
1534 TRAPD(err, iTmpEmail = HBufC::NewL(email.Length())); |
|
1535 if( err == KErrNone ) |
|
1536 { |
|
1537 iTmpEmail->Des().Copy(email); |
|
1538 } |
|
1539 } |
|
1540 delete iTempContact; |
|
1541 iTempContact = 0; |
|
1542 } |
|
1543 } |
|
1544 |
|
1545 void CCreatorInterimCalendar::VPbkSingleContactOperationFailed( |
|
1546 MVPbkContactOperationBase& /*aOperation*/, |
|
1547 TInt aError ) |
|
1548 { |
|
1549 LOGSTRING2("Creator: CCreatorInterimCalendar::VPbkSingleContactOperationFailed - Error: %d", aError ); |
|
1550 iWaiter->Cancel(); |
|
1551 delete iTempContact; |
|
1552 iTempContact = 0; |
|
1553 } |
|
1554 |
|
1555 |
|
1556 |
|
1557 void CCreatorInterimCalendar::OpenComplete() |
|
1558 { |
|
1559 LOGSTRING("Creator: CreatorInterimCalendar::OpenComplete()"); |
|
1560 iWaiter->Cancel(); |
|
1561 } |
|
1562 |
|
1563 void CCreatorInterimCalendar::StoreReady(MVPbkContactStore& /*aContactStore*/) |
|
1564 { |
|
1565 LOGSTRING("Creator: CreatorInterimCalendar::StoreReady()"); |
|
1566 iWaiter->Cancel(); |
|
1567 } |
|
1568 |
|
1569 void CCreatorInterimCalendar::StoreUnavailable(MVPbkContactStore& /*aContactStore*/, |
|
1570 TInt /*aReason*/) |
|
1571 { |
|
1572 LOGSTRING("Creator: CreatorInterimCalendar::StoreUnavailable()"); |
|
1573 iWaiter->Cancel(); |
|
1574 } |
|
1575 |
|
1576 |
|
1577 void CCreatorInterimCalendar::HandleStoreEventL( |
|
1578 MVPbkContactStore& /*aContactStore*/, |
|
1579 TVPbkContactStoreEvent /*aStoreEvent*/) |
|
1580 { |
|
1581 LOGSTRING("Creator: CreatorInterimCalendar::HandleStoreEventL()"); |
|
1582 iWaiter->Cancel(); |
|
1583 } |
|
1584 |
|
1585 void CCreatorInterimCalendar::FindCompleteL( MVPbkContactLinkArray* aResults ) |
|
1586 { |
|
1587 LOGSTRING("Creator: CreatorInterimCalendar::FindCompleteL()"); |
|
1588 iWaiter->Cancel(); |
|
1589 iExistingContacts = aResults; |
|
1590 } |
|
1591 |
|
1592 void CCreatorInterimCalendar::FindFailed( TInt aError ) |
|
1593 { |
|
1594 LOGSTRING2("Creator: CreatorInterimCalendar::FindFailed() - Error: %d", aError); |
|
1595 iWaiter->Cancel(); |
|
1596 delete iExistingContacts; |
|
1597 iExistingContacts = 0; |
|
1598 } |
|
1599 #endif |
|
1600 //---------------------------------------------------------------------------- |
|
1601 |
|