230 // (other items were commented in a header). |
278 // (other items were commented in a header). |
231 // ----------------------------------------------------------------------------- |
279 // ----------------------------------------------------------------------------- |
232 CCalenGlobalData::~CCalenGlobalData() |
280 CCalenGlobalData::~CCalenGlobalData() |
233 { |
281 { |
234 TRACE_ENTRY_POINT; |
282 TRACE_ENTRY_POINT; |
235 |
283 |
236 delete iInterimUtils; |
284 delete iSend; |
237 delete iEntryView; |
285 delete iInterimUtils; |
238 delete iInstanceView; |
286 delete iUtilsAs; |
239 delete iEntryViewCreation; |
287 delete iMailboxUtils; |
240 delete iInstanceViewCreation; |
288 delete iMRUtils; |
|
289 |
|
290 if (iInstanceView) |
|
291 { |
|
292 delete iInstanceView; |
|
293 iInstanceView = NULL; |
|
294 } |
|
295 |
|
296 if (iInstanceViewCreation) |
|
297 { |
|
298 delete iInstanceViewCreation; |
|
299 iInstanceViewCreation = NULL; |
|
300 } |
|
301 |
|
302 if (iEntryViewCreation) |
|
303 { |
|
304 delete iEntryViewCreation; |
|
305 iEntryViewCreation = NULL; |
|
306 } |
|
307 |
|
308 if (iNewInstanceView) |
|
309 { |
|
310 delete iNewInstanceView; |
|
311 iNewInstanceView = NULL; |
|
312 iNewInstanceViewCreation = NULL; |
|
313 } |
|
314 |
|
315 if (iNewInstanceViewCreation) |
|
316 { |
|
317 delete iNewInstanceViewCreation; |
|
318 iNewInstanceViewCreation = NULL; |
|
319 } |
|
320 |
241 delete iContext; |
321 delete iContext; |
242 |
322 |
243 if (iGlobalDataOwnsCalSession) |
323 if(iGlobalDataOwnsEntryView) |
|
324 { |
|
325 if(iEntryView) |
|
326 { |
|
327 delete iEntryView; |
|
328 iEntryView = NULL; |
|
329 } |
|
330 } |
|
331 |
|
332 if (iGlobalDataOwnsCalSession) |
244 { |
333 { |
245 delete iCalSession; |
334 delete iCalSession; |
246 } |
335 } |
247 |
336 |
248 --iRefCount; |
337 if (iCalendarInfoList.Count()) |
249 |
338 { |
250 // The controller owns its own instance of the services, therefore the |
339 iCalendarInfoList.ResetAndDestroy(); |
251 // reference count will be one, immediatley before deletion. |
340 } |
252 if (iRefCount == 1) |
341 |
253 { |
342 if( iFileMappingArray.Count() ) |
254 delete this; |
343 { |
255 } |
344 iFileMappingArray.ResetAndDestroy(); |
|
345 } |
|
346 |
|
347 iKeyQueue.Reset(); |
|
348 |
|
349 iHashDbidIndexMap.Close(); |
256 |
350 |
257 Dll::SetTls(NULL); |
351 Dll::SetTls(NULL); |
258 |
352 |
259 TRACE_EXIT_POINT; |
353 if (iCalendarsSession) |
260 } |
354 { |
261 |
355 delete iCalendarsSession; |
|
356 iCalendarsSession = NULL; |
|
357 } |
|
358 |
|
359 TRACE_EXIT_POINT; |
|
360 } |
|
361 |
|
362 // ----------------------------------------------------------------------------- |
|
363 // CCalenGlobalData::MailboxUtilsL |
|
364 // Create MailBoxUtils if necessary and returns a reference |
|
365 // (other items were commented in a header). |
|
366 // ----------------------------------------------------------------------------- |
|
367 EXPORT_C CMRMailboxUtils& CCalenGlobalData::MRMailboxUtilsL() |
|
368 { |
|
369 TRACE_ENTRY_POINT; |
|
370 |
|
371 if (!iMailboxUtils) |
|
372 { |
|
373 if (InterimUtilsL().MRViewersEnabledL()) |
|
374 { |
|
375 iMailboxUtils = CMRMailboxUtils::NewL(); |
|
376 } |
|
377 else |
|
378 { |
|
379 User::Leave(KErrNotSupported); |
|
380 } |
|
381 } |
|
382 |
|
383 TRACE_EXIT_POINT; |
|
384 return *iMailboxUtils; |
|
385 } |
262 |
386 |
263 // ----------------------------------------------------------------------------- |
387 // ----------------------------------------------------------------------------- |
264 // CCalenGlobalData::CalSessionL |
388 // CCalenGlobalData::CalSessionL |
265 // Create a Calendar session if necessary and return a reference |
389 // Create a Calendar session if necessary and return a reference |
266 // (other items were commented in a header). |
390 // (other items were commented in a header). |
267 // ----------------------------------------------------------------------------- |
391 // ----------------------------------------------------------------------------- |
268 EXPORT_C CCalSession& CCalenGlobalData::CalSessionL() |
392 EXPORT_C CCalSession& CCalenGlobalData::CalSessionL() |
269 { |
393 { |
270 TRACE_ENTRY_POINT; |
394 TRACE_ENTRY_POINT; |
271 |
395 |
272 if (!iCalSession) |
396 if (!iCalSession) |
273 { |
397 { |
274 iGlobalDataOwnsCalSession = ETrue; |
398 iGlobalDataOwnsCalSession = ETrue; |
275 iCalSession = CCalSession::NewL(); |
399 iCalSession = CCalSession::NewL(); |
276 |
400 |
277 TRAPD( err, iCalSession->OpenL(KCalendarDatabaseFilePath)); |
401 TRAPD( err, iCalSession->OpenL(KCalendarDatabaseFilePath)); |
278 if ( err == KErrNotFound ) |
402 if (err == KErrNotFound) |
279 { |
403 { |
280 iCalSession->CreateCalFileL(KCalendarDatabaseFilePath); |
404 CCalCalendarInfo* calendarInfo = GetDefaultCalendarInfoL(); |
281 iCalSession->OpenL(KCalendarDatabaseFilePath); // not trapped anymore |
405 CleanupStack::PushL(calendarInfo); |
|
406 iCalSession->CreateCalFileL( KCalendarDatabaseFilePath, |
|
407 *calendarInfo); |
|
408 iCalSession->OpenL(KCalendarDatabaseFilePath); |
|
409 CleanupStack::PopAndDestroy(calendarInfo); |
|
410 } |
|
411 else if(err == KErrNone) |
|
412 { |
|
413 // temp solution...need to handle this case |
|
414 CCalCalendarInfo* calendarInfo = iCalSession->CalendarInfoL(); |
|
415 CleanupStack::PushL(calendarInfo); |
|
416 if( !calendarInfo->NameL().Compare(KNullDesC) && |
|
417 !calendarInfo->Enabled() ) |
|
418 { |
|
419 calendarInfo->SetNameL(KExtCalendar); |
|
420 calendarInfo->SetColor(KRgbBlack.Value()); |
|
421 iCalSession->SetCalendarInfoL(*calendarInfo); |
|
422 } |
|
423 CleanupStack::PopAndDestroy(calendarInfo); |
|
424 |
282 } |
425 } |
283 else |
426 else |
284 { |
427 { |
285 User::LeaveIfError( err ); |
428 User::LeaveIfError( err ); |
286 } |
429 } |
287 |
|
288 } |
430 } |
289 |
431 |
290 TRACE_EXIT_POINT; |
432 TRACE_EXIT_POINT; |
291 return *iCalSession; |
433 return *iCalSession; |
|
434 } |
|
435 |
|
436 // ----------------------------------------------------------------------------- |
|
437 // CCalenGlobalData::CalSessionL |
|
438 // Based on the calendar name return already cached session from iFileMappingArray |
|
439 // (other items were commented in a header). |
|
440 // ----------------------------------------------------------------------------- |
|
441 EXPORT_C CCalSession& CCalenGlobalData::CalSessionL(const TDesC& aCalendar) |
|
442 { |
|
443 TRACE_ENTRY_POINT; |
|
444 CCalSession* session = NULL; |
|
445 HBufC* calendarFileName = aCalendar.AllocLC(); |
|
446 TInt index = iFileMappingArray.Find( |
|
447 *calendarFileName,CCalenGlobalData::CalenInfoIdentifierL); |
|
448 CleanupStack::PopAndDestroy(calendarFileName); |
|
449 if(KErrNotFound != index) |
|
450 { |
|
451 session = iFileMappingArray[index]->GetSessionPtr(); |
|
452 } |
|
453 else |
|
454 { |
|
455 User::LeaveIfError(KErrNotFound); |
|
456 } |
|
457 |
|
458 TRACE_EXIT_POINT; |
|
459 return *session; |
292 } |
460 } |
293 |
461 |
294 // ----------------------------------------------------------------------------- |
462 // ----------------------------------------------------------------------------- |
295 // CCalenGlobalData::InstanceViewL |
463 // CCalenGlobalData::InstanceViewL |
296 // Create an instance view if necessary and returns a reference. Creating an |
464 // Create an instance view if necessary and returns a reference. Creating an |
337 // (other items were commented in a header). |
524 // (other items were commented in a header). |
338 // ----------------------------------------------------------------------------- |
525 // ----------------------------------------------------------------------------- |
339 EXPORT_C CCalEntryView* CCalenGlobalData::EntryViewL() |
526 EXPORT_C CCalEntryView* CCalenGlobalData::EntryViewL() |
340 { |
527 { |
341 TRACE_ENTRY_POINT; |
528 TRACE_ENTRY_POINT; |
342 |
529 |
343 if (!iEntryView && !iEntryViewCreation) |
530 if (!iEntryView && !iEntryViewCreation) |
344 { |
531 { |
345 if ( iInstanceViewCreation ) |
532 if ( iInstanceViewCreation ) |
346 { |
533 { |
347 /* We need queueing to avoid two immediate instance and entry view creation requests to symbian. |
|
348 * Though symbian handle two immediate requests ,this we require because we have only one observer |
|
349 * for callback and we would not be able to differentiate whether instance view got created or entry view got created. |
|
350 * If we dont queue the second request, we may end up giving incomplete object to the caller function. |
|
351 */ |
|
352 iQueued = &CreateEntryViewL; |
534 iQueued = &CreateEntryViewL; |
353 } |
535 } |
354 else |
536 else |
355 { |
537 { |
356 CreateEntryViewL(); |
538 CreateEntryViewL(); |
357 } |
539 } |
358 } |
540 } |
359 TRACE_EXIT_POINT; |
541 |
|
542 TRACE_EXIT_POINT; |
360 return iEntryView; |
543 return iEntryView; |
361 } |
544 } |
362 |
545 |
|
546 |
|
547 // ----------------------------------------------------------------------------- |
|
548 // CCalenGlobalData::EntryViewL |
|
549 // Based on collection id array Create an entry view if necessary and returns a reference. |
|
550 // Creating an entry view is an asynchronous operation, but this call returns |
|
551 // synchronously. When the view is created, Completed() is called, which stops |
|
552 // iAs allowing this function to complete. |
|
553 // Leaves with KErrInUse if this class is in the process of creating the |
|
554 // entry view |
|
555 // (other items were commented in a header). |
|
556 // ----------------------------------------------------------------------------- |
|
557 EXPORT_C CCalEntryView* CCalenGlobalData::EntryViewL( |
|
558 const TCalCollectionId aCollectionId) |
|
559 { |
|
560 TRACE_ENTRY_POINT; |
|
561 __ASSERT_ALWAYS(aCollectionId > 0 ,User::Panic(_L("CCalenGlobalData"),-1)); |
|
562 |
|
563 CCalEntryView* entryView = NULL; |
|
564 |
|
565 TInt index = iHashDbidIndexMap.FindL(aCollectionId); |
|
566 if(index != KErrNotFound) |
|
567 { |
|
568 entryView = iFileMappingArray[index]->GetEntryView(); |
|
569 } |
|
570 |
|
571 if(!entryView) |
|
572 { |
|
573 User::LeaveIfNull(entryView); |
|
574 } |
|
575 |
|
576 TRACE_EXIT_POINT; |
|
577 return entryView; |
|
578 } |
|
579 |
|
580 // ----------------------------------------------------------------------------- |
|
581 // CCalenGlobalData::RegisterEntryViewObserver |
|
582 // Add observer into view observers entry observer list. |
|
583 // (other items were commented in a header). |
|
584 // ----------------------------------------------------------------------------- |
|
585 EXPORT_C TBool CCalenGlobalData::EntryViewExists() |
|
586 { |
|
587 TRACE_ENTRY_POINT; |
|
588 TRACE_EXIT_POINT; |
|
589 return ( iEntryView != NULL ); |
|
590 } |
|
591 |
|
592 // ----------------------------------------------------------------------------- |
|
593 // CCalenGlobalData::MeetingRequestUtilsL |
|
594 // Create MR Utils if necessary and returns a reference |
|
595 // (other items were commented in a header). |
|
596 // ----------------------------------------------------------------------------- |
|
597 EXPORT_C CMRUtils& CCalenGlobalData::MeetingRequestUtilsL() |
|
598 { |
|
599 TRACE_ENTRY_POINT; |
|
600 |
|
601 iCreateError = KErrNone; |
|
602 if (!iUtilsAs) |
|
603 { |
|
604 iUtilsAs = new (ELeave) CActiveSchedulerWait; |
|
605 } |
|
606 if (!iMRUtils) |
|
607 { |
|
608 if (InterimUtilsL().MRViewersEnabledL()) |
|
609 { |
|
610 if (iUtilsAs->IsStarted()) |
|
611 { |
|
612 User::Leave(KErrInUse); |
|
613 } |
|
614 else |
|
615 { |
|
616 //Get the currently selected mailbox |
|
617 CMRMailboxUtils::TMailboxInfo defaultMailbox; |
|
618 MRMailboxUtilsL().GetDefaultMRMailBoxL(defaultMailbox); |
|
619 //CMRUtils resolves meeting request utilities based on mtm uid |
|
620 TBuf8<KMaxUidName> mrMtm; |
|
621 CnvUtfConverter::ConvertFromUnicodeToUtf8(mrMtm, defaultMailbox.iMtmUid.Name()); |
|
622 iMRUtils = CMRUtils::NewL(mrMtm, *this, CalSessionL(), NULL); |
|
623 iUtilsAs->Start(); |
|
624 User::LeaveIfError(iCreateError); |
|
625 } |
|
626 } |
|
627 else |
|
628 { |
|
629 User::Leave(KErrNotSupported); |
|
630 } |
|
631 } |
|
632 |
|
633 TRACE_EXIT_POINT; |
|
634 return *iMRUtils; |
|
635 } |
|
636 |
|
637 // ----------------------------------------------------------------------------- |
|
638 // CCalenGlobalData::InterimUtilsL |
|
639 // Create a CCalenInterimUtils object if neccessary and return a reference |
|
640 // (other items were commented in a header). |
|
641 // ----------------------------------------------------------------------------- |
|
642 EXPORT_C CCalenInterimUtils2& CCalenGlobalData::InterimUtilsL() |
|
643 { |
|
644 TRACE_ENTRY_POINT; |
|
645 |
|
646 if(!iInterimUtils) |
|
647 { |
|
648 iInterimUtils = CCalenInterimUtils2::NewL(); |
|
649 } |
|
650 |
|
651 TRACE_EXIT_POINT; |
|
652 return *iInterimUtils; |
|
653 } |
|
654 |
|
655 // ----------------------------------------------------------------------------- |
|
656 // CCalenGlobalData::CalenSendL |
|
657 // Create a CCalenSend object if neccessary and return a reference |
|
658 // (other items were commented in a header). |
|
659 // ----------------------------------------------------------------------------- |
|
660 EXPORT_C CCalenSend& CCalenGlobalData::CalenSendL() |
|
661 { |
|
662 TRACE_ENTRY_POINT; |
|
663 |
|
664 if( !iSend ) |
|
665 { |
|
666 iSend = CCalenSend::NewL( ECalenSend, CalSessionL() ); |
|
667 } |
|
668 |
|
669 TRACE_EXIT_POINT; |
|
670 return *iSend; |
|
671 } |
|
672 |
|
673 // ----------------------------------------------------------------------------- |
|
674 // CCalenGlobalData::Context |
|
675 // Return a reference to the CCalenContext object |
|
676 // (other items were commented in a header). |
|
677 // ----------------------------------------------------------------------------- |
|
678 EXPORT_C MCalenContext& CCalenGlobalData::Context() |
|
679 { |
|
680 TRACE_ENTRY_POINT; |
|
681 TRACE_EXIT_POINT; |
|
682 return *iContext; |
|
683 } |
|
684 |
|
685 // ----------------------------------------------------------------------------- |
|
686 // CCalenEditUi::AttemptToRetrieveDefaultMailboxL |
|
687 // Check to see if we have any mailboxes defined, and if we have a default |
|
688 // mailbox. If we don't, inform the user and return EFalse. This function |
|
689 // returns ETrue if aDefaultMailbox was initialised, and it is OK to create |
|
690 // a new MR. |
|
691 // (other items were commented in a header). |
|
692 // ----------------------------------------------------------------------------- |
|
693 EXPORT_C TBool CCalenGlobalData::AttemptToRetrieveDefaultMailboxL( CMRMailboxUtils::TMailboxInfo& aDefaultMailbox) |
|
694 { |
|
695 TRACE_ENTRY_POINT; |
|
696 |
|
697 CMRMailboxUtils& mbUtils = MRMailboxUtilsL(); |
|
698 // Get the currently defined mailboxes. |
|
699 RArray<CMRMailboxUtils::TMailboxInfo> mailboxes; |
|
700 CleanupClosePushL(mailboxes); |
|
701 mbUtils.ListMailBoxesL(mailboxes); |
|
702 |
|
703 TBool canCreateMeetingRequest=EFalse; |
|
704 TInt mbCount = mailboxes.Count(); |
|
705 |
|
706 // The following 'if-else' block should always initialise |
|
707 // defaultMailBox if canCreateMeetingRequest comes out as ETrue. |
|
708 if(mbCount > 0) |
|
709 { |
|
710 TInt res = KErrNone; |
|
711 TRAPD(err, res = mbUtils.GetDefaultMRMailBoxL(aDefaultMailbox)); |
|
712 if( res == KErrNone && err == KErrNone) |
|
713 { |
|
714 canCreateMeetingRequest = ETrue; |
|
715 } |
|
716 else |
|
717 { |
|
718 // We have one or more mailboxes defined, but failed to get a default. |
|
719 // Ask user to answer "Select default mailbox" query. The available mailboxes must |
|
720 // first be reduced to only show mailboxes with an associated meetnig request solution |
|
721 RImplInfoPtrArrayOwn implArray; |
|
722 CleanupClosePushL( implArray ); |
|
723 //Get all MRViewers Implementation |
|
724 const TUid mrViewersIface = {KMRViewersInterfaceUID}; |
|
725 REComSession::ListImplementationsL(mrViewersIface, implArray ); |
|
726 |
|
727 for (TInt i = mailboxes.Count() - 1; i >= 0; --i) |
|
728 { |
|
729 //See if any meeting request implementation matches this mailbox |
|
730 for (TInt j=0; j<implArray.Count(); ++j) |
|
731 { |
|
732 TBuf16<KMaxUidName> mbName; |
|
733 CnvUtfConverter::ConvertToUnicodeFromUtf8( mbName, implArray[j]->DataType() ); |
|
734 if(mailboxes[i].iMtmUid.Name().CompareF(mbName) == 0) |
|
735 { |
|
736 //Found a match |
|
737 break; |
|
738 } |
|
739 //Mailbox has no matching meeting request solution |
|
740 //remove from list |
|
741 mailboxes.Remove(i); |
|
742 } |
|
743 } |
|
744 CleanupStack::PopAndDestroy(); //implArray |
|
745 |
|
746 TInt selected = PromptToSelectDefaultMailboxL(mailboxes); |
|
747 |
|
748 if(selected >= KErrNone) |
|
749 { |
|
750 mbUtils.SetDefaultMRMailBoxL( mailboxes[selected].iEntryId ); |
|
751 canCreateMeetingRequest = ETrue; |
|
752 __ASSERT_ALWAYS((mbUtils.GetDefaultMRMailBoxL( aDefaultMailbox ) == KErrNone), User::Invariant()); // so we don't return ref to local variable. |
|
753 } |
|
754 } |
|
755 } |
|
756 else |
|
757 { |
|
758 // Force the check of MR Impl existing |
|
759 InterimUtilsL().MRViewersEnabledL(ETrue); //ignore result |
|
760 } |
|
761 |
|
762 CleanupStack::PopAndDestroy(); // mailboxes |
|
763 |
|
764 TRACE_EXIT_POINT; |
|
765 return canCreateMeetingRequest; |
|
766 } |
|
767 |
|
768 // ----------------------------------------------------------------------------- |
|
769 // CCalenGlobalData::ResetKeyEventQueue |
|
770 // Reset Keyevents queue |
|
771 // (other items were commented in a header). |
|
772 // ----------------------------------------------------------------------------- |
|
773 EXPORT_C void CCalenGlobalData::ResetKeyEventQueue() |
|
774 { |
|
775 TRACE_ENTRY_POINT; |
|
776 iKeyQueue.Reset(); |
|
777 TRACE_EXIT_POINT; |
|
778 } |
|
779 |
|
780 // ----------------------------------------------------------------------------- |
|
781 // CCalenGlobalData::QueueKeyEvent |
|
782 // Queue key press event in a queue |
|
783 // (other items were commented in a header). |
|
784 // ----------------------------------------------------------------------------- |
|
785 EXPORT_C TBool CCalenGlobalData::QueueKeyEvent(const TKeyEvent& aEvent, |
|
786 TEventCode aType) |
|
787 { |
|
788 TRACE_ENTRY_POINT; |
|
789 TBool result(EFalse); |
|
790 TQueuedKeyEvent item; |
|
791 item.iType = aType; |
|
792 item.iEvent = aEvent; |
|
793 if( iKeyQueue.Insert(item, iKeyQueue.Count()) == KErrNone) // add to last |
|
794 { |
|
795 result = ETrue; |
|
796 } |
|
797 TRACE_EXIT_POINT; |
|
798 return result; |
|
799 } |
|
800 |
|
801 // ----------------------------------------------------------------------------- |
|
802 // CCalenGlobalData::GetQueueKeyEvent |
|
803 // Get 1 queued event from the queue |
|
804 // (other items were commented in a header). |
|
805 // ----------------------------------------------------------------------------- |
|
806 EXPORT_C TBool CCalenGlobalData::GetQueuedKeyEvent(TKeyEvent& aEvent, TEventCode& aType) |
|
807 { |
|
808 TRACE_ENTRY_POINT; |
|
809 TBool result(EFalse); |
|
810 if(iKeyQueue.Count() > 0) |
|
811 { |
|
812 TQueuedKeyEvent item; |
|
813 item = iKeyQueue[0];// get first |
|
814 aEvent = item.iEvent; |
|
815 aType = item.iType; |
|
816 iKeyQueue.Remove(0); // remove first |
|
817 result = ETrue; |
|
818 iKeyQueue.Compress(); |
|
819 } |
|
820 TRACE_EXIT_POINT; |
|
821 return result; |
|
822 } |
|
823 |
|
824 // ----------------------------------------------------------------------------- |
|
825 // CCalenGlobalData::ConstructFileMappingL |
|
826 // Constructs mapping between symbian calendar file and metabd info |
|
827 // ----------------------------------------------------------------------------- |
|
828 EXPORT_C TBool CCalenGlobalData::ConstructFileMappingL() |
|
829 { |
|
830 TRACE_ENTRY_POINT; |
|
831 iCalendarsSession = CCalSession::NewL(); |
|
832 |
|
833 ConstructCalendarsListL(); |
|
834 |
|
835 iFileMappingArray.Reset(); |
|
836 |
|
837 for(TInt index = 0; index < iCalendarInfoList.Count(); index++) |
|
838 { |
|
839 TPtrC calendarFileName = iCalendarInfoList[index]->FileNameL(); |
|
840 CCalenFileMapping* filemap = CCalenFileMapping::NewL(); |
|
841 CleanupStack::PushL(filemap); |
|
842 filemap->SetCalendarFileNameL(calendarFileName); |
|
843 |
|
844 iNewEntryView = NULL; |
|
845 iNewEntryViewCreation = NULL; |
|
846 CCalenDbChangeNotifier* dbChangeNotifier = NULL; |
|
847 if(iCalSession) |
|
848 { |
|
849 iNewCalSession = NULL; |
|
850 CCalCalendarInfo* calendarInfo = iCalendarInfoList[index]; |
|
851 |
|
852 CCalSession& tempSession = CreateNewSessionL( calendarFileName, |
|
853 *calendarInfo ); |
|
854 filemap->SetSessionPtr(&tempSession); |
|
855 filemap->SetCollectionId(tempSession.CollectionIdL()); |
|
856 CreateEntryViewL(tempSession); |
|
857 filemap->SetEntryView( iNewEntryView ); |
|
858 dbChangeNotifier = CCalenDbChangeNotifier::NewL( tempSession ); |
|
859 dbChangeNotifier->RegisterObserverL(*iDBChangeNotifier); |
|
860 filemap->SetDBChangeNotifier(dbChangeNotifier); |
|
861 } |
|
862 else |
|
863 { |
|
864 CCalSession& tempSession = CalSessionL(); |
|
865 filemap->SetSessionPtr(&tempSession); |
|
866 filemap->SetCollectionId(tempSession.CollectionIdL()); |
|
867 CreateEntryViewL(tempSession); |
|
868 filemap->SetEntryView( iNewEntryView ); |
|
869 iGlobalDataOwnsEntryView = EFalse; |
|
870 iGlobalDataOwnsCalSession = EFalse; |
|
871 dbChangeNotifier = CCalenDbChangeNotifier::NewL( tempSession ); |
|
872 dbChangeNotifier->RegisterObserverL(*iDBChangeNotifier); |
|
873 filemap->SetDBChangeNotifier(dbChangeNotifier); |
|
874 } |
|
875 iFileMappingArray.Append(filemap); |
|
876 CleanupStack::Pop(filemap); |
|
877 } |
|
878 |
|
879 for(TInt index = 0; index < iFileMappingArray.Count(); index++) |
|
880 { |
|
881 iHashDbidIndexMap.InsertL( iFileMappingArray[index]->GetCollectionId(), |
|
882 index); |
|
883 } |
|
884 |
|
885 TRACE_EXIT_POINT |
|
886 return ETrue; |
|
887 } |
|
888 |
|
889 // ----------------------------------------------------------------------------- |
|
890 // CCalenGlobalData::InitializeGlobalDataL |
|
891 // Initializes multiple db related objects |
|
892 // ----------------------------------------------------------------------------- |
|
893 EXPORT_C void CCalenGlobalData::InitializeGlobalDataL() |
|
894 { |
|
895 TRACE_ENTRY_POINT |
|
896 |
|
897 ConstructFileMappingL(); |
|
898 |
|
899 TRACE_EXIT_POINT |
|
900 } |
|
901 |
|
902 // ----------------------------------------------------------------------------- |
|
903 // CCalenGlobalData::PromptToSelectDefaultMailboxL |
|
904 // Prompts the user to select the default mailbox. If the user cancels, the |
|
905 // function returns KErrCancel, otherwise it returns the index of the selected |
|
906 // mailbox. This function does not set the default mailbox, but rather returns |
|
907 // the index of the given array to which the default should be set. |
|
908 // (other items were commented in a header). |
|
909 // ----------------------------------------------------------------------------- |
|
910 TInt CCalenGlobalData::PromptToSelectDefaultMailboxL( RArray<CMRMailboxUtils::TMailboxInfo>& aMailboxes ) |
|
911 { |
|
912 TRACE_ENTRY_POINT; |
|
913 |
|
914 TInt mbCount = aMailboxes.Count(); |
|
915 |
|
916 TInt selected; |
|
917 if (mbCount > 0) |
|
918 { |
|
919 CAknSinglePopupMenuStyleListBox* list = |
|
920 new (ELeave) CAknSinglePopupMenuStyleListBox; |
|
921 CleanupStack::PushL(list); |
|
922 |
|
923 CAknPopupList* popupList = CAknPopupList::NewL(list, R_AVKON_SOFTKEYS_OK_CANCEL); |
|
924 CleanupStack::PushL(popupList); |
|
925 |
|
926 list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect); |
|
927 list->CreateScrollBarFrameL(ETrue); |
|
928 list->ScrollBarFrame()->SetScrollBarVisibilityL( |
|
929 CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); |
|
930 |
|
931 CEikonEnv* eikEnv = CEikonEnv::Static(); |
|
932 |
|
933 CDesCArrayFlat* items = new (ELeave)CDesCArrayFlat(mbCount); |
|
934 CleanupStack::PushL(items); |
|
935 for(TInt i=0; i<mbCount; ++i) |
|
936 { |
|
937 items->AppendL( aMailboxes[i].iName ); |
|
938 } |
|
939 CleanupStack::Pop(items); |
|
940 CTextListBoxModel* model = list->Model(); |
|
941 |
|
942 //Pass ownersip of items to model |
|
943 model->SetItemTextArray(items); |
|
944 |
|
945 HBufC* title = StringLoader::LoadLC(R_CALEN_SELECT_MAILBOX, eikEnv); |
|
946 popupList->SetTitleL(*title); |
|
947 CleanupStack::PopAndDestroy(title); |
|
948 |
|
949 TBool accepted = popupList->ExecuteLD(); |
|
950 CleanupStack::Pop(); // popupList |
|
951 |
|
952 if(accepted) |
|
953 { |
|
954 selected = list->CurrentItemIndex(); |
|
955 } |
|
956 else |
|
957 { |
|
958 selected = KErrCancel; |
|
959 } |
|
960 |
|
961 CleanupStack::PopAndDestroy(); // list |
|
962 } |
|
963 else |
|
964 { |
|
965 //No mailboxes defined. Could prompt user to define one here? |
|
966 selected = KErrCancel; |
|
967 } |
|
968 |
|
969 TRACE_EXIT_POINT; |
|
970 return selected; |
|
971 } |
|
972 |
|
973 // ----------------------------------------------------------------------------- |
|
974 // CCalenGlobalData::HandleCalEngStatus |
|
975 // Called when Meeting Request utils are creation is complete. |
|
976 // Stops the CActiveSchedulerWait, allowing MeetingRequestUtilsL() to complete |
|
977 // (other items were commented in a header). |
|
978 // ----------------------------------------------------------------------------- |
|
979 void CCalenGlobalData::HandleCalEngStatus( TMRUtilsCalEngStatus aStatus ) |
|
980 { |
|
981 TRACE_ENTRY_POINT; |
|
982 |
|
983 ASSERT(iUtilsAs); |
|
984 |
|
985 switch (aStatus) |
|
986 { |
|
987 case ENotReady: |
|
988 { |
|
989 //Keep waiting |
|
990 } |
|
991 break; |
|
992 case EAvailableWithoutTombs: |
|
993 case EAvailable: |
|
994 { |
|
995 //Ready for use. Stop the CActiveSchedulerWait and return |
|
996 iUtilsAs->AsyncStop(); |
|
997 iCreateError = KErrNone; |
|
998 } |
|
999 break; |
|
1000 case ENotAvailable: |
|
1001 { |
|
1002 //Somethings gone wrong. Stop the CActiveSchedulerWait but force |
|
1003 //MeetingRequestUtilsL to leave. |
|
1004 //We'll use KErrNotFound for now but we don't know what the problem is. |
|
1005 iUtilsAs->AsyncStop(); |
|
1006 iCreateError = KErrNotFound; |
|
1007 } |
|
1008 break; |
|
1009 default: |
|
1010 { |
|
1011 //Shouldn't ever get called. |
|
1012 iUtilsAs->AsyncStop(); |
|
1013 iCreateError = KErrArgument; |
|
1014 } |
|
1015 break; |
|
1016 } |
|
1017 |
|
1018 TRACE_EXIT_POINT; |
|
1019 } |
|
1020 |
|
1021 // ----------------------------------------------------------------------------- |
|
1022 // CCalenGlobalData::HandleNotification |
|
1023 // Handle any notification if registered for |
|
1024 // ----------------------------------------------------------------------------- |
|
1025 void CCalenGlobalData::HandleNotification(const TCalenNotification aNotification ) |
|
1026 { |
|
1027 TRACE_ENTRY_POINT; |
|
1028 |
|
1029 switch(aNotification) |
|
1030 { |
|
1031 case ECalenNotifyEntryInstanceViewCreated: |
|
1032 { |
|
1033 ViewCreationCompleted( ETrue ); |
|
1034 } |
|
1035 break; |
|
1036 case ECalenNotifyEntryInstanceViewCreationFailed: |
|
1037 { |
|
1038 ViewCreationCompleted( EFalse ); |
|
1039 } |
|
1040 break; |
|
1041 case ECalenNotifyDeleteInstanceView: |
|
1042 { |
|
1043 //InstanceView has to be deleted since deleting any session(Calendar) |
|
1044 //entryView and instanceView has to be deleted before deleting session. |
|
1045 if(iNewInstanceView) |
|
1046 { |
|
1047 delete iNewInstanceView; |
|
1048 iNewInstanceViewCreation = iNewInstanceView = NULL; |
|
1049 } |
|
1050 |
|
1051 //If InstanceView is called by any component single instanceView |
|
1052 // without the knowledge of multi session (calendar). |
|
1053 //This instance also should be deleted for deleting the session. |
|
1054 if(iInstanceView) |
|
1055 { |
|
1056 delete iInstanceView; |
|
1057 iInstanceView = iInstanceViewCreation = NULL; |
|
1058 } |
|
1059 } |
|
1060 break; |
|
1061 case ECalenNotifyRealExit: |
|
1062 { |
|
1063 iCalendarForcedExit = ETrue; |
|
1064 } |
|
1065 break; |
|
1066 case ECalenNotifyCalendarInfoCreated: |
|
1067 { |
|
1068 TRAP_IGNORE(HandleCalendarInfoCreatedL()); |
|
1069 } |
|
1070 break; |
|
1071 case ECalenNotifyCalendarInfoUpdated: |
|
1072 { |
|
1073 TRAP_IGNORE(HandleCalendarInfoUpdatedL()); |
|
1074 } |
|
1075 break; |
|
1076 case ECalenNotifyCalendarFileDeleted: |
|
1077 { |
|
1078 TRAP_IGNORE(HandleCalendarFileDeletedL()); |
|
1079 } |
|
1080 break; |
|
1081 default: |
|
1082 break; |
|
1083 } |
|
1084 |
|
1085 TRACE_EXIT_POINT; |
|
1086 } |
|
1087 |
|
1088 // ----------------------------------------------------------------------------- |
|
1089 // CCalenGlobalData::CreateEntryViewL |
|
1090 // ----------------------------------------------------------------------------- |
363 void CCalenGlobalData::CreateEntryViewL() |
1091 void CCalenGlobalData::CreateEntryViewL() |
364 { |
1092 { |
365 TRACE_ENTRY_POINT; |
1093 TRACE_ENTRY_POINT; |
366 iEntryViewCreation = CCalEntryView::NewL( CalSessionL(), iCalCallBack ); |
1094 |
367 TRACE_EXIT_POINT; |
1095 HBufC* calendarFileName = KCalendarDatabaseFilePath().AllocLC(); |
368 } |
1096 TInt index = iFileMappingArray.Find( |
369 |
1097 *calendarFileName, CCalenGlobalData::CalenInfoIdentifierL); |
|
1098 CleanupStack::PopAndDestroy(calendarFileName); |
|
1099 if(index != KErrNotFound) |
|
1100 { |
|
1101 iEntryView = iFileMappingArray[index]->GetEntryView(); |
|
1102 } |
|
1103 |
|
1104 if(!iEntryView) |
|
1105 { |
|
1106 User::LeaveIfNull(iEntryView); |
|
1107 } |
|
1108 |
|
1109 TRACE_EXIT_POINT; |
|
1110 } |
|
1111 |
|
1112 // ----------------------------------------------------------------------------- |
|
1113 // CCalenGlobalData::CreateEntryViewL |
|
1114 // ----------------------------------------------------------------------------- |
|
1115 void CCalenGlobalData::CreateEntryViewL(CCalSession& session) |
|
1116 { |
|
1117 TRACE_ENTRY_POINT; |
|
1118 iNewEntryViewCreation = CCalEntryView::NewL( session, iCalCallBack ); |
|
1119 |
|
1120 if(iNewEntryViewCreation) |
|
1121 { |
|
1122 iNewEntryView = iNewEntryViewCreation; |
|
1123 } |
|
1124 |
|
1125 TRACE_EXIT_POINT; |
|
1126 } |
|
1127 |
|
1128 // ----------------------------------------------------------------------------- |
|
1129 // CCalenGlobalData::CreateInstanceViewL |
|
1130 // ----------------------------------------------------------------------------- |
370 void CCalenGlobalData::CreateInstanceViewL() |
1131 void CCalenGlobalData::CreateInstanceViewL() |
371 { |
1132 { |
372 TRACE_ENTRY_POINT; |
1133 TRACE_ENTRY_POINT; |
373 iInstanceViewCreation = CCalInstanceView::NewL( CalSessionL(), iCalCallBack ); |
1134 iInstanceViewCreation = CCalInstanceView::NewL( CalSessionL(), iCalCallBack ); |
|
1135 if(iInstanceViewCreation) |
|
1136 { |
|
1137 iInstanceView = iInstanceViewCreation; |
|
1138 } |
|
1139 TRACE_EXIT_POINT; |
|
1140 } |
|
1141 |
|
1142 // ----------------------------------------------------------------------------- |
|
1143 // CCalenGlobalData::CreateEntryViewL |
|
1144 // ----------------------------------------------------------------------------- |
|
1145 void CCalenGlobalData::CreateInstanceViewL(const RArray<TInt>& aCollectionIds) |
|
1146 { |
|
1147 TRACE_ENTRY_POINT; |
|
1148 |
|
1149 RPointerArray<CCalSession> sessionArray; |
|
1150 |
|
1151 for(TInt i = 0; i < aCollectionIds.Count() ; i++) |
|
1152 { |
|
1153 TInt index = iHashDbidIndexMap.FindL(aCollectionIds[i]); |
|
1154 if(index != KErrNotFound) |
|
1155 { |
|
1156 CCalSession* sessionPtr = iFileMappingArray[index]->GetSessionPtr(); |
|
1157 sessionArray.AppendL(sessionPtr); |
|
1158 } |
|
1159 } |
|
1160 |
|
1161 if(sessionArray.Count()) |
|
1162 { |
|
1163 iNewInstanceViewCreation = CCalInstanceView::NewL( sessionArray, iCalCallBack ); |
|
1164 if(iNewInstanceViewCreation) |
|
1165 { |
|
1166 iNewInstanceView = iNewInstanceViewCreation; |
|
1167 } |
|
1168 } |
|
1169 |
|
1170 sessionArray.Reset(); |
374 TRACE_EXIT_POINT; |
1171 TRACE_EXIT_POINT; |
375 } |
1172 } |
376 |
1173 |
377 // ----------------------------------------------------------------------------- |
1174 // ----------------------------------------------------------------------------- |
378 // CEntryViewObserver::ViewCreationCompleted |
1175 // CEntryViewObserver::ViewCreationCompleted |
385 TRACE_ENTRY_POINT; |
1182 TRACE_ENTRY_POINT; |
386 |
1183 |
387 if ( !aSuccess ) |
1184 if ( !aSuccess ) |
388 { |
1185 { |
389 // Something has gone wrong |
1186 // Something has gone wrong |
390 delete iEntryViewCreation; |
1187 if (iEntryViewCreation) |
391 delete iInstanceViewCreation; |
1188 { |
|
1189 delete iEntryViewCreation; |
|
1190 iEntryViewCreation = NULL; |
|
1191 } |
|
1192 if (iInstanceViewCreation) |
|
1193 { |
|
1194 delete iInstanceViewCreation; |
|
1195 iInstanceViewCreation = NULL; |
|
1196 } |
|
1197 |
|
1198 if (iNewEntryViewCreation) |
|
1199 { |
|
1200 delete iNewEntryViewCreation; |
|
1201 iNewEntryViewCreation = NULL; |
|
1202 |
|
1203 HBufC* fileName = iContext->GetCalendarFileNameL().AllocLC(); |
|
1204 TInt index = iFileMappingArray.Find(*fileName, |
|
1205 CCalenGlobalData::CalenInfoIdentifierL); |
|
1206 CleanupStack::PopAndDestroy(fileName); |
|
1207 |
|
1208 if (index != KErrNotFound) |
|
1209 { |
|
1210 iFileMappingArray[index]->SetEntryView(NULL); |
|
1211 } |
|
1212 } |
|
1213 |
|
1214 if (iNewInstanceViewCreation) |
|
1215 { |
|
1216 delete iNewInstanceViewCreation; |
|
1217 iNewInstanceViewCreation = NULL; |
|
1218 } |
|
1219 |
392 } |
1220 } |
393 else |
1221 else |
394 { |
1222 { |
395 if ( iEntryViewCreation ) |
1223 if ( iEntryViewCreation ) |
396 { |
1224 { |
397 iEntryView = iEntryViewCreation; |
1225 iEntryView = iEntryViewCreation; |
398 } |
1226 } |
399 else if ( iInstanceViewCreation ) |
1227 else if ( iInstanceViewCreation ) |
400 { |
1228 { |
401 iInstanceView = iInstanceViewCreation; |
1229 iInstanceView = iInstanceViewCreation; |
|
1230 } |
|
1231 |
|
1232 if ( iNewEntryViewCreation ) |
|
1233 { |
|
1234 iNewEntryView = iNewEntryViewCreation; |
|
1235 } |
|
1236 else if ( iNewInstanceViewCreation ) |
|
1237 { |
|
1238 iNewInstanceView = iNewInstanceViewCreation; |
402 } |
1239 } |
403 } |
1240 } |
404 |
1241 |
405 iEntryViewCreation = NULL; |
1242 iEntryViewCreation = NULL; |
406 iInstanceViewCreation = NULL; |
1243 iInstanceViewCreation = NULL; |
407 |
1244 iNewEntryViewCreation = NULL; |
|
1245 iNewInstanceViewCreation = NULL; |
|
1246 |
408 if ( iQueued ) |
1247 if ( iQueued ) |
409 { |
1248 { |
410 (this->*iQueued)(); |
1249 (this->*iQueued)(); |
411 iQueued = NULL; |
1250 iQueued = NULL; |
412 } |
1251 } |
413 |
1252 |
414 TRACE_EXIT_POINT; |
1253 TRACE_EXIT_POINT; |
415 } |
1254 } |
416 |
1255 |
417 // ----------------------------------------------------------------------------- |
1256 // ----------------------------------------------------------------------------- |
418 // CCalenGlobalData::RegisterEntryViewObserver |
1257 // CCalenGlobalData::CreateNewSessionL |
419 // Add observer into view observers entry observer list. |
1258 // Create a Calendar session if necessary and return a reference |
420 // (other items were commented in a header). |
1259 // (other items were commented in a header). |
421 // ----------------------------------------------------------------------------- |
1260 // ----------------------------------------------------------------------------- |
422 EXPORT_C TBool CCalenGlobalData::EntryViewExists() |
1261 CCalSession& CCalenGlobalData::CreateNewSessionL( const TDesC& aCalendar ) |
423 { |
1262 { |
424 TRACE_ENTRY_POINT; |
1263 TRACE_ENTRY_POINT; |
425 TRACE_EXIT_POINT; |
1264 |
426 return ( iEntryView != NULL ); |
1265 if(!iNewCalSession) |
427 } |
1266 { |
428 |
1267 iNewCalSession = CCalSession::NewL(*iCalSession); |
429 |
1268 |
430 // ----------------------------------------------------------------------------- |
1269 TRAPD( err, iNewCalSession->OpenL(aCalendar)); |
431 // CCalenGlobalData::Context |
1270 if ( err == KErrNotFound ) |
432 // Return a reference to the CCalenContext object |
1271 { |
433 // (other items were commented in a header). |
1272 iNewCalSession->CreateCalFileL(aCalendar); |
434 // ----------------------------------------------------------------------------- |
1273 iNewCalSession->OpenL(aCalendar); // not trapped anymore |
435 EXPORT_C MCalenContext& CCalenGlobalData::Context() |
1274 } |
436 { |
1275 else |
437 TRACE_ENTRY_POINT; |
1276 { |
438 TRACE_EXIT_POINT; |
1277 User::LeaveIfError( err ); |
439 return *iContext; |
1278 } |
440 } |
1279 } |
441 |
1280 TRACE_EXIT_POINT; |
442 void CCalenGlobalData::HandleNotification(const TCalenNotification aNotification ) |
1281 return *iNewCalSession; |
443 { |
1282 } |
444 TRACE_ENTRY_POINT; |
1283 |
445 |
1284 // ----------------------------------------------------------------------------- |
446 if ( aNotification == ECalenNotifyEntryInstanceViewCreated ) |
1285 // CCalenGlobalData::CalenInfoIdentifierL |
447 { |
1286 // ----------------------------------------------------------------------------- |
448 ViewCreationCompleted( ETrue ); |
1287 // |
449 } |
1288 TBool CCalenGlobalData::CalenInfoIdentifierL( const HBufC* aName, |
450 else if (aNotification == ECalenNotifyEntryInstanceViewCreationFailed ) |
1289 const CCalenFileMapping& aFileMapping) |
451 { |
1290 { |
452 ViewCreationCompleted( EFalse ); |
1291 TRACE_ENTRY_POINT; |
453 } |
1292 TPtrC calendarFileName = aFileMapping.GetCalendarFileName(); |
454 |
1293 TRACE_EXIT_POINT; |
455 TRACE_EXIT_POINT; |
1294 return (!calendarFileName.CompareF(*aName)); |
456 } |
1295 } |
457 |
1296 |
458 // Enf of file |
1297 // ----------------------------------------------------------------------------- |
|
1298 // CCalenGlobalData::AddCalendarL |
|
1299 // adds new calendar file and sets calendar info to it |
|
1300 // ----------------------------------------------------------------------------- |
|
1301 // |
|
1302 EXPORT_C void CCalenGlobalData::AddCalendarL(CCalCalendarInfo* aCalendarInfo) |
|
1303 { |
|
1304 TRACE_ENTRY_POINT; |
|
1305 CleanupStack::PushL(aCalendarInfo); |
|
1306 |
|
1307 CCalenFileMapping* fileMapping = CCalenFileMapping::NewL(); |
|
1308 CleanupStack::PushL(fileMapping); |
|
1309 |
|
1310 HBufC* calendarFileName = CCalenMultiCalUtil::GetNextAvailableCalFileL(); |
|
1311 CleanupStack::PushL(calendarFileName); |
|
1312 fileMapping->SetCalendarFileNameL(calendarFileName->Des()); |
|
1313 CleanupStack::PopAndDestroy(calendarFileName); |
|
1314 if(iCalSession) |
|
1315 { |
|
1316 iNewCalSession = NULL; |
|
1317 iNewEntryView = NULL; |
|
1318 iNewEntryViewCreation = NULL; |
|
1319 TPtrC calFileName = fileMapping->GetCalendarFileName(); |
|
1320 CCalSession& tempSession = CreateNewSessionL( calFileName, |
|
1321 *aCalendarInfo ); |
|
1322 fileMapping->SetSessionPtr(&tempSession); |
|
1323 fileMapping->SetCollectionId(tempSession.CollectionIdL()); |
|
1324 |
|
1325 if(!iCalendarForcedExit) |
|
1326 { |
|
1327 CreateEntryViewL(tempSession); |
|
1328 } |
|
1329 fileMapping->SetEntryView( iNewEntryView ); |
|
1330 CCalenDbChangeNotifier* dbChangeNotifier = CCalenDbChangeNotifier::NewL( tempSession ); |
|
1331 dbChangeNotifier->RegisterObserverL(*iDBChangeNotifier); |
|
1332 fileMapping->SetDBChangeNotifier(dbChangeNotifier); |
|
1333 iCalendarInfoList.Append(tempSession.CalendarInfoL()); |
|
1334 } |
|
1335 |
|
1336 CleanupStack::Pop(fileMapping); |
|
1337 iFileMappingArray.Append(fileMapping); |
|
1338 |
|
1339 iHashDbidIndexMap.Close(); |
|
1340 for(TInt index = 0; index < iFileMappingArray.Count(); index++) |
|
1341 { |
|
1342 iHashDbidIndexMap.InsertL( iFileMappingArray[index]->GetCollectionId(), |
|
1343 index); |
|
1344 } |
|
1345 |
|
1346 CleanupStack::PopAndDestroy(aCalendarInfo); |
|
1347 aCalendarInfo = NULL; |
|
1348 |
|
1349 TRACE_EXIT_POINT |
|
1350 } |
|
1351 |
|
1352 // ----------------------------------------------------------------------------- |
|
1353 // CCalenGlobalData::RemoveDeadCalendarsL |
|
1354 // removes dead calendar files from the file system |
|
1355 // ----------------------------------------------------------------------------- |
|
1356 // |
|
1357 EXPORT_C void CCalenGlobalData::RemoveDeadCalendarsL() |
|
1358 { |
|
1359 TRACE_ENTRY_POINT; |
|
1360 CCalCalendarIterator* calendarIterator = |
|
1361 CCalCalendarIterator::NewL(*iCalendarsSession); |
|
1362 CleanupStack::PushL(calendarIterator); |
|
1363 |
|
1364 for( CCalCalendarInfo* calendarInfo = calendarIterator->FirstL(); |
|
1365 calendarInfo!=NULL;calendarInfo = calendarIterator->NextL()) |
|
1366 { |
|
1367 CleanupStack::PushL(calendarInfo); |
|
1368 HBufC* filename = calendarInfo->FileNameL().AllocLC(); |
|
1369 TInt index = iFileMappingArray.Find( *filename, |
|
1370 CCalenGlobalData::CalenInfoIdentifierL); |
|
1371 if(KErrNotFound == index) |
|
1372 { |
|
1373 CCalSession* session = CCalSession::NewL(*iCalSession); |
|
1374 CleanupStack::PushL(session); |
|
1375 TRAP_IGNORE(session->DeleteCalFileL( *filename )); |
|
1376 CleanupStack::PopAndDestroy(session); |
|
1377 } |
|
1378 CleanupStack::PopAndDestroy(filename); |
|
1379 CleanupStack::PopAndDestroy(calendarInfo); |
|
1380 } |
|
1381 CleanupStack::PopAndDestroy(calendarIterator); |
|
1382 TRACE_EXIT_POINT; |
|
1383 } |
|
1384 |
|
1385 // ----------------------------------------------------------------------------- |
|
1386 // CCalenGlobalData::RemoveCalendarL |
|
1387 // removes calendar file from the file system |
|
1388 // ----------------------------------------------------------------------------- |
|
1389 // |
|
1390 EXPORT_C void CCalenGlobalData::RemoveCalendarL(const TDesC& aCalendarFileName) |
|
1391 { |
|
1392 TRACE_ENTRY_POINT; |
|
1393 |
|
1394 HBufC* calendarFilename = aCalendarFileName.AllocLC(); |
|
1395 TInt index = iFileMappingArray.Find( *calendarFilename, |
|
1396 CCalenGlobalData::CalenInfoIdentifierL); |
|
1397 |
|
1398 if( KErrNotFound == index ) |
|
1399 { |
|
1400 CleanupStack::PopAndDestroy(calendarFilename); |
|
1401 // reconstruct the calendar list using the iterator |
|
1402 ConstructCalendarsListL(); |
|
1403 |
|
1404 TRACE_EXIT_POINT; |
|
1405 return; |
|
1406 } |
|
1407 |
|
1408 if( index >= 0 ) |
|
1409 { |
|
1410 CCalenFileMapping* filemap = iFileMappingArray.operator [](index); |
|
1411 CCalSession* session = filemap->GetSessionPtr(); |
|
1412 if(session) |
|
1413 { |
|
1414 TRAPD(err, session->DeleteCalFileL(aCalendarFileName)); |
|
1415 if( err == KErrInUse ) |
|
1416 { |
|
1417 //Calendar file is opened by other application. |
|
1418 //Mark the file as deleted. Try delete the file at later time. |
|
1419 // Get the CalFile |
|
1420 CCalCalendarInfo* caleninfo = session->CalendarInfoL(); |
|
1421 CleanupStack::PushL(caleninfo); |
|
1422 |
|
1423 // Mark the CalFile as Hidden |
|
1424 caleninfo->SetEnabled( EFalse ); |
|
1425 |
|
1426 |
|
1427 TBuf8<KBuffLength> keyBuff; |
|
1428 |
|
1429 // Set the modification time as home time. |
|
1430 keyBuff.Zero(); |
|
1431 keyBuff.AppendNum(EModificationTime); |
|
1432 TTime modificationTime; |
|
1433 modificationTime.HomeTime(); |
|
1434 TPckgC<TTime> pkgModificationTime(modificationTime); |
|
1435 caleninfo->SetPropertyL(keyBuff, pkgModificationTime); |
|
1436 |
|
1437 // Set the SyncStatus to False |
|
1438 keyBuff.Zero(); |
|
1439 keyBuff.AppendNum( ESyncStatus ); |
|
1440 TBool syncstatus( EFalse ); |
|
1441 TPckgC<TBool> pckgSyncStatusValue( syncstatus ); |
|
1442 caleninfo->SetPropertyL( keyBuff, pckgSyncStatusValue ); |
|
1443 |
|
1444 // Mark the meta property as SoftDeleted |
|
1445 keyBuff.Zero(); |
|
1446 keyBuff.AppendNum(EMarkAsDelete); |
|
1447 TPckgC<TBool> pkgSoftDelete( ETrue ); |
|
1448 caleninfo->SetPropertyL(keyBuff, pkgSoftDelete); |
|
1449 |
|
1450 session->SetCalendarInfoL( *caleninfo ); |
|
1451 CleanupStack::PopAndDestroy(caleninfo); |
|
1452 } |
|
1453 |
|
1454 TRAP_IGNORE(DeleteCalendarMissedAlarmsL(aCalendarFileName)); |
|
1455 |
|
1456 TInt infoListIndex = iCalendarInfoList.Find(*calendarFilename, |
|
1457 CCalenGlobalData::CalenCalendarInfoIdentiferL); |
|
1458 |
|
1459 CCalCalendarInfo* calendarInfo = iCalendarInfoList[infoListIndex]; |
|
1460 iCalendarInfoList.Remove(infoListIndex); |
|
1461 delete calendarInfo; |
|
1462 calendarInfo = NULL; |
|
1463 |
|
1464 iHashDbidIndexMap.Close(); |
|
1465 |
|
1466 iFileMappingArray.Remove(index); |
|
1467 delete filemap; |
|
1468 for(TInt index = 0; index < iFileMappingArray.Count(); index++) |
|
1469 { |
|
1470 iHashDbidIndexMap.InsertL(iFileMappingArray[index]->GetCollectionId(), index); |
|
1471 } |
|
1472 } |
|
1473 } |
|
1474 |
|
1475 |
|
1476 CleanupStack::PopAndDestroy(calendarFilename); |
|
1477 TRACE_EXIT_POINT; |
|
1478 } |
|
1479 |
|
1480 // ----------------------------------------------------------------------------- |
|
1481 // CCalenGlobalData::UpdateCalendarL |
|
1482 // updates calendar info for the calendar file |
|
1483 // ----------------------------------------------------------------------------- |
|
1484 // |
|
1485 EXPORT_C void CCalenGlobalData::UpdateCalendarL(CCalCalendarInfo* aCalendarInfo) |
|
1486 { |
|
1487 TRACE_ENTRY_POINT; |
|
1488 |
|
1489 HBufC* calendar = aCalendarInfo->FileNameL().AllocLC(); |
|
1490 TInt index = iFileMappingArray.Find( *calendar, |
|
1491 CCalenGlobalData::CalenInfoIdentifierL); |
|
1492 |
|
1493 if(index != KErrNotFound) |
|
1494 { |
|
1495 CCalSession* session = iFileMappingArray[index]->GetSessionPtr(); |
|
1496 if(session) |
|
1497 { |
|
1498 session->SetCalendarInfoL(*aCalendarInfo); |
|
1499 } |
|
1500 } |
|
1501 CleanupStack::PopAndDestroy(calendar); |
|
1502 |
|
1503 TRACE_EXIT_POINT; |
|
1504 } |
|
1505 |
|
1506 // ----------------------------------------------------------------------------- |
|
1507 // CCalenGlobalData::GetCalFileNameForCollectionId |
|
1508 // Get Calendar file name for the given collectionid |
|
1509 // ----------------------------------------------------------------------------- |
|
1510 // |
|
1511 EXPORT_C const TDesC& CCalenGlobalData::GetCalFileNameForCollectionId( |
|
1512 const TCalCollectionId aColId) |
|
1513 { |
|
1514 TRACE_ENTRY_POINT; |
|
1515 |
|
1516 TInt index = iFileMappingArray.Find( aColId, |
|
1517 CCalenGlobalData::CalenFileMapIdentifierForColId ); |
|
1518 |
|
1519 if(index != KErrNotFound) |
|
1520 { |
|
1521 TRACE_EXIT_POINT; |
|
1522 return iFileMappingArray[index]->GetCalendarFileName(); |
|
1523 } |
|
1524 else |
|
1525 { |
|
1526 TRACE_EXIT_POINT; |
|
1527 return KNullDesC; |
|
1528 } |
|
1529 } |
|
1530 |
|
1531 // ----------------------------------------------------------------------------- |
|
1532 // CCalenGlobalData::GetAllCalendarInfoL |
|
1533 // Get all available calendar info |
|
1534 // ----------------------------------------------------------------------------- |
|
1535 // |
|
1536 EXPORT_C void CCalenGlobalData::GetAllCalendarInfoL( |
|
1537 RPointerArray<CCalCalendarInfo>& aCalendarInfoList ) |
|
1538 { |
|
1539 TRACE_ENTRY_POINT; |
|
1540 CleanupClosePushL(aCalendarInfoList); |
|
1541 RFs fsSession; |
|
1542 CleanupClosePushL( fsSession ); |
|
1543 RResourceFile resourceFile; |
|
1544 CleanupClosePushL( resourceFile ); |
|
1545 User::LeaveIfError( fsSession.Connect() ); |
|
1546 TFileName resourceFileName( KMissedAlarmResourceFile ); |
|
1547 |
|
1548 BaflUtils::NearestLanguageFile( fsSession, resourceFileName ); |
|
1549 resourceFile.OpenL(fsSession, resourceFileName ); |
|
1550 resourceFile.ConfirmSignatureL( 0 ); |
|
1551 for(TInt index=0;index < iCalendarInfoList.Count();index++) |
|
1552 { |
|
1553 |
|
1554 TPtrC calendarNamePtr = iCalendarInfoList[index]->NameL(); |
|
1555 if(calendarNamePtr.Compare(KPersonal) == 0) |
|
1556 { |
|
1557 HBufC8* personalBuffer = resourceFile.AllocReadLC( R_CALE_DB_PERSONAL ); |
|
1558 const TPtrC16 ptrPBuffer(( TText16*) personalBuffer->Ptr(), |
|
1559 ( personalBuffer->Length()+1 )>>1 ); |
|
1560 HBufC *personalCalendar = ptrPBuffer.AllocL(); |
|
1561 CleanupStack::PushL(personalCalendar); |
|
1562 iCalendarInfoList[index]->SetNameL(*personalCalendar); |
|
1563 CleanupStack::PopAndDestroy( 2,personalBuffer ); |
|
1564 } |
|
1565 |
|
1566 |
|
1567 aCalendarInfoList.AppendL(iCalendarInfoList[index]); |
|
1568 |
|
1569 } |
|
1570 CleanupStack::PopAndDestroy(2); |
|
1571 CleanupStack::Pop(&aCalendarInfoList); |
|
1572 TRACE_EXIT_POINT; |
|
1573 } |
|
1574 |
|
1575 // ----------------------------------------------------------------------------- |
|
1576 // CCalenGlobalData::CreateNewSessionL |
|
1577 // Create new session with metadata |
|
1578 // ----------------------------------------------------------------------------- |
|
1579 // |
|
1580 CCalSession& CCalenGlobalData::CreateNewSessionL( const TDesC& aCalendar, |
|
1581 const CCalCalendarInfo& aCalendarInfo ) |
|
1582 { |
|
1583 TRACE_ENTRY_POINT; |
|
1584 |
|
1585 if(!iNewCalSession) |
|
1586 { |
|
1587 iNewCalSession = CCalSession::NewL(*iCalSession); |
|
1588 |
|
1589 TRAPD( err, iNewCalSession->OpenL(aCalendar)); |
|
1590 if ( err == KErrNotFound ) |
|
1591 { |
|
1592 iNewCalSession->CreateCalFileL( aCalendar, aCalendarInfo ); |
|
1593 iNewCalSession->OpenL(aCalendar); // not trapped anymore |
|
1594 } |
|
1595 else |
|
1596 { |
|
1597 User::LeaveIfError( err ); |
|
1598 } |
|
1599 } |
|
1600 TRACE_EXIT_POINT; |
|
1601 return *iNewCalSession; |
|
1602 } |
|
1603 |
|
1604 // ----------------------------------------------------------------------------- |
|
1605 // CCalenGlobalData::CalenFileMapIdentifierForColId |
|
1606 // Search for filemap index based on collection id |
|
1607 // ----------------------------------------------------------------------------- |
|
1608 // |
|
1609 TBool CCalenGlobalData::CalenFileMapIdentifierForColId(const TCalCollectionId* aId, |
|
1610 const CCalenFileMapping& aFileMapping ) |
|
1611 { |
|
1612 TRACE_ENTRY_POINT; |
|
1613 TRACE_EXIT_POINT; |
|
1614 return (*aId == (aFileMapping.GetCollectionId())); |
|
1615 } |
|
1616 |
|
1617 // ----------------------------------------------------------------------------- |
|
1618 // CCalenGlobalData::CalenCalendarInfoIdentiferL |
|
1619 // Construct calendar list from the calendar iterator |
|
1620 // ----------------------------------------------------------------------------- |
|
1621 // |
|
1622 TBool CCalenGlobalData::CalenCalendarInfoIdentiferL(const HBufC* aFileName, |
|
1623 const CCalCalendarInfo& aCalendarInfo) |
|
1624 { |
|
1625 TRACE_ENTRY_POINT |
|
1626 TPtrC calendarFileName = aCalendarInfo.FileNameL(); |
|
1627 TRACE_EXIT_POINT |
|
1628 return (!calendarFileName.CompareF(*aFileName) ); |
|
1629 } |
|
1630 |
|
1631 // ----------------------------------------------------------------------------- |
|
1632 // CCalenGlobalData::ConstructCalendarsListL |
|
1633 // Construct calendar list from the calendar iterator |
|
1634 // ----------------------------------------------------------------------------- |
|
1635 // |
|
1636 void CCalenGlobalData::ConstructCalendarsListL() |
|
1637 { |
|
1638 TRACE_ENTRY_POINT; |
|
1639 |
|
1640 iCalendarInfoList.ResetAndDestroy(); |
|
1641 CCalCalendarIterator* calendarIterator = |
|
1642 CCalCalendarIterator::NewL(*iCalendarsSession); |
|
1643 CleanupStack::PushL(calendarIterator); |
|
1644 |
|
1645 for( CCalCalendarInfo* calendarInfo = calendarIterator->FirstL(); |
|
1646 calendarInfo!=NULL;calendarInfo = calendarIterator->NextL()) |
|
1647 { |
|
1648 TBuf8<KBuffLength> keyBuff; |
|
1649 // Mark the meta property as SoftDeleted |
|
1650 keyBuff.Zero(); |
|
1651 keyBuff.AppendNum(EMarkAsDelete); |
|
1652 TBool softDelete = EFalse; |
|
1653 TPckgC<TBool> pkgSoftDelete( softDelete ); |
|
1654 TRAPD(err,pkgSoftDelete.Set(calendarInfo->PropertyValueL(keyBuff))); |
|
1655 if( KErrNone == err ) |
|
1656 { |
|
1657 softDelete = pkgSoftDelete(); |
|
1658 } |
|
1659 if( softDelete && |
|
1660 calendarInfo->FileNameL().CompareF(CalSessionL().DefaultFileNameL()) ) |
|
1661 { |
|
1662 // delete caleninfo except for default calendar. |
|
1663 delete calendarInfo; |
|
1664 } |
|
1665 else |
|
1666 { |
|
1667 iCalendarInfoList.Append(calendarInfo); |
|
1668 } |
|
1669 } |
|
1670 CleanupStack::PopAndDestroy(calendarIterator); |
|
1671 |
|
1672 TRACE_EXIT_POINT; |
|
1673 } |
|
1674 |
|
1675 // ----------------------------------------------------------------------------- |
|
1676 // CCalenGlobalData::UpdateCalendarListL |
|
1677 // Update calendar list whenever CalendarInfoUpdated notification is received. |
|
1678 // ----------------------------------------------------------------------------- |
|
1679 // |
|
1680 void CCalenGlobalData::UpdateCalendarListL() |
|
1681 { |
|
1682 //Getting calendar name updated from calennotifier infochangednotification |
|
1683 HBufC* calendarNameUpdated = iContext->GetCalendarFileNameL().AllocLC(); |
|
1684 TInt index = iFileMappingArray.Find( *calendarNameUpdated, |
|
1685 CCalenGlobalData::CalenInfoIdentifierL); |
|
1686 |
|
1687 if(index != KErrNotFound) |
|
1688 { |
|
1689 CCalSession* session = iFileMappingArray[index]->GetSessionPtr(); |
|
1690 for(TInt i=0; i<iCalendarInfoList.Count() ;i++) |
|
1691 { |
|
1692 if( !iCalendarInfoList[i]->FileNameL().CompareF(calendarNameUpdated->Des())) |
|
1693 { |
|
1694 iCalendarInfoList[i] = session->CalendarInfoL(); |
|
1695 } |
|
1696 } |
|
1697 } |
|
1698 CleanupStack::PopAndDestroy(calendarNameUpdated); |
|
1699 } |
|
1700 // ----------------------------------------------------------------------------- |
|
1701 // CCalenGlobalData::GetDefaultCalendarInfoL |
|
1702 // Get default calendar info |
|
1703 // ----------------------------------------------------------------------------- |
|
1704 // |
|
1705 CCalCalendarInfo* CCalenGlobalData::GetDefaultCalendarInfoL() |
|
1706 { |
|
1707 TRACE_ENTRY_POINT; |
|
1708 |
|
1709 CCalCalendarInfo* defaultCalendarInfo = CCalCalendarInfo::NewL(); |
|
1710 CleanupStack::PushL(defaultCalendarInfo); |
|
1711 defaultCalendarInfo->SetColor(KCalenBlue.Value()); |
|
1712 defaultCalendarInfo->SetEnabled(ETrue); |
|
1713 defaultCalendarInfo->SetNameL(KPhoneCalendar); |
|
1714 CleanupStack::Pop(defaultCalendarInfo); |
|
1715 |
|
1716 TRACE_EXIT_POINT; |
|
1717 return defaultCalendarInfo; |
|
1718 } |
|
1719 |
|
1720 // ----------------------------------------------------------------------------- |
|
1721 // CCalenGlobalData::HandleCalendarInfoCreatedL |
|
1722 // Handles the notification ECalenNotifyCalendarInfoCreated |
|
1723 // ----------------------------------------------------------------------------- |
|
1724 // |
|
1725 void CCalenGlobalData::HandleCalendarInfoCreatedL() |
|
1726 { |
|
1727 TRACE_ENTRY_POINT; |
|
1728 // get the filename from the context |
|
1729 TDesC& fileName = iContext->GetCalendarFileNameL(); |
|
1730 |
|
1731 // check for the calendar file already exists in filemap list |
|
1732 HBufC* calendar = fileName.AllocLC(); |
|
1733 TInt index = iFileMappingArray.Find(*calendar, |
|
1734 CCalenGlobalData::CalenInfoIdentifierL); |
|
1735 CleanupStack::PopAndDestroy(calendar); |
|
1736 |
|
1737 // if not exists,add to filemapper list |
|
1738 if (KErrNotFound == index) |
|
1739 { |
|
1740 CCalenFileMapping* fileMapper = CCalenFileMapping::NewL(); |
|
1741 CleanupStack::PushL(fileMapper); |
|
1742 fileMapper->SetCalendarFileNameL(fileName); |
|
1743 |
|
1744 iNewEntryView = NULL; |
|
1745 iNewEntryViewCreation = NULL; |
|
1746 CCalSession* newSession = NULL; |
|
1747 if(iCalSession) |
|
1748 { |
|
1749 // create the new session using default session |
|
1750 newSession = CCalSession::NewL(*iCalSession); |
|
1751 CleanupStack::PushL(newSession); |
|
1752 TRAPD(err,newSession->OpenL(fileName)); |
|
1753 User::LeaveIfError( err ); |
|
1754 CleanupStack::Pop(newSession); |
|
1755 // set filemapper data |
|
1756 fileMapper->SetSessionPtr(newSession); |
|
1757 fileMapper->SetCollectionId(newSession->CollectionIdL()); |
|
1758 |
|
1759 if(!iCalendarForcedExit) |
|
1760 { |
|
1761 CreateEntryViewL(*newSession); |
|
1762 } |
|
1763 fileMapper->SetEntryView( iNewEntryView ); |
|
1764 |
|
1765 iCalendarInfoList.AppendL(newSession->CalendarInfoL()); |
|
1766 CCalenDbChangeNotifier* dbChangeNotifier = CCalenDbChangeNotifier::NewL( *newSession ); |
|
1767 dbChangeNotifier->RegisterObserverL(*iDBChangeNotifier); |
|
1768 fileMapper->SetDBChangeNotifier(dbChangeNotifier); |
|
1769 } |
|
1770 else |
|
1771 { |
|
1772 // create the first session |
|
1773 iCalSession = CCalSession::NewL(); |
|
1774 TRAPD(err,iCalSession->OpenL(fileName)); |
|
1775 User::LeaveIfError(err); |
|
1776 |
|
1777 // set filemapper data |
|
1778 fileMapper->SetSessionPtr(iCalSession); |
|
1779 fileMapper->SetCollectionId(iCalSession->CollectionIdL()); |
|
1780 |
|
1781 if(!iCalendarForcedExit) |
|
1782 { |
|
1783 CreateEntryViewL(*iCalSession); |
|
1784 } |
|
1785 |
|
1786 fileMapper->SetEntryView(iNewEntryView); |
|
1787 CCalenDbChangeNotifier* dbChangeNotifier = CCalenDbChangeNotifier::NewL( *iCalSession ); |
|
1788 fileMapper->SetDBChangeNotifier(dbChangeNotifier); |
|
1789 dbChangeNotifier->RegisterObserverL(*iDBChangeNotifier); |
|
1790 iGlobalDataOwnsEntryView = EFalse; |
|
1791 iGlobalDataOwnsCalSession = EFalse; |
|
1792 iCalendarInfoList.AppendL(iCalSession->CalendarInfoL()); |
|
1793 } |
|
1794 // append to filemapper list |
|
1795 iFileMappingArray.Append(fileMapper); |
|
1796 CleanupStack::Pop(fileMapper); |
|
1797 |
|
1798 iHashDbidIndexMap.Close(); |
|
1799 for(TInt index = 0; index < iFileMappingArray.Count(); index++) |
|
1800 { |
|
1801 iHashDbidIndexMap.InsertL( |
|
1802 iFileMappingArray[index]->GetCollectionId(), index); |
|
1803 } |
|
1804 } |
|
1805 TRACE_EXIT_POINT; |
|
1806 } |
|
1807 |
|
1808 // ----------------------------------------------------------------------------- |
|
1809 // CCalenGlobalData::HandleCalendarInfoUpdatedL |
|
1810 // Handles the notification ECalenNotifyCalendarInfoUpdated |
|
1811 // ----------------------------------------------------------------------------- |
|
1812 // |
|
1813 void CCalenGlobalData::HandleCalendarInfoUpdatedL() |
|
1814 { |
|
1815 TRACE_ENTRY_POINT; |
|
1816 |
|
1817 //Update Calendar list. |
|
1818 UpdateCalendarListL(); |
|
1819 |
|
1820 TRACE_EXIT_POINT; |
|
1821 } |
|
1822 |
|
1823 // ----------------------------------------------------------------------------- |
|
1824 // CCalenGlobalData::HandleCalendarFileDeletedL |
|
1825 // Handles the notification ECalenNotifyCalendarFileDeleted |
|
1826 // ----------------------------------------------------------------------------- |
|
1827 // |
|
1828 void CCalenGlobalData::HandleCalendarFileDeletedL() |
|
1829 { |
|
1830 TRACE_ENTRY_POINT; |
|
1831 |
|
1832 // get the filename from the context |
|
1833 TDesC& fileName = iContext->GetCalendarFileNameL(); |
|
1834 |
|
1835 // delete the calendar file |
|
1836 RemoveCalendarL(fileName); |
|
1837 |
|
1838 TRACE_EXIT_POINT; |
|
1839 } |
|
1840 |
|
1841 // ----------------------------------------------------------------------------- |
|
1842 // CCalenGlobalData::DeleteCalendarMissedAlarmsL |
|
1843 // Delete all missed alarms for deleted calendar |
|
1844 // ----------------------------------------------------------------------------- |
|
1845 // |
|
1846 void CCalenGlobalData::DeleteCalendarMissedAlarmsL(const TDesC& aCalendarFilename) |
|
1847 { |
|
1848 TRACE_ENTRY_POINT |
|
1849 //Clear all missed alarms related to this calendar |
|
1850 CMissedAlarmStore* missedAlarmStore = CMissedAlarmStore::NewLC(); |
|
1851 RPointerArray<CMissedAlarm> missedAlarms; |
|
1852 CleanupResetAndDestroyPushL(missedAlarms); |
|
1853 |
|
1854 missedAlarmStore->GetL(missedAlarms); |
|
1855 |
|
1856 for (TInt idx = 0; idx < missedAlarms.Count(); idx++) |
|
1857 { |
|
1858 CMissedAlarm* missedAlarm = missedAlarms[idx]; |
|
1859 if (!missedAlarm->iCalFileName.CompareF(aCalendarFilename)) |
|
1860 { |
|
1861 missedAlarmStore->RemoveL(*missedAlarm); |
|
1862 } |
|
1863 } |
|
1864 |
|
1865 CleanupStack::PopAndDestroy(&missedAlarms); |
|
1866 CleanupStack::PopAndDestroy(missedAlarmStore); |
|
1867 TRACE_EXIT_POINT |
|
1868 } |
|
1869 |
|
1870 // End of file |