39 #include "calendar.hrh" |
39 #include "calendar.hrh" |
40 #include <finditem.hrh> |
40 #include <finditem.hrh> |
41 #include <finditemmenu.h> |
41 #include <finditemmenu.h> |
42 #include "calenattachmentmodel.h" |
42 #include "calenattachmentmodel.h" |
43 |
43 |
|
44 #include <aknappui.h> |
44 // Button position of the MSK CBA button |
45 // Button position of the MSK CBA button |
45 const TInt KSK2CBAPosition = 2; |
46 const TInt KSK2CBAPosition = 2; |
46 |
47 |
47 // ================= MEMBER FUNCTIONS ========================================= |
48 // ================= MEMBER FUNCTIONS ========================================= |
48 |
49 |
338 CCalenEventViewContainer* cnt = static_cast<CCalenEventViewContainer*>( iContainer ); |
345 CCalenEventViewContainer* cnt = static_cast<CCalenEventViewContainer*>( iContainer ); |
339 HBufC* titleText = StringLoader::LoadLC( cnt->GetTitleTextId(), iCoeEnv ); |
346 HBufC* titleText = StringLoader::LoadLC( cnt->GetTitleTextId(), iCoeEnv ); |
340 iSPUtils->UnderLineTitleText( EFalse ); |
347 iSPUtils->UnderLineTitleText( EFalse ); |
341 iSPUtils->SetTitleText( titleText ); // ownership passed |
348 iSPUtils->SetTitleText( titleText ); // ownership passed |
342 CleanupStack::Pop( titleText ); |
349 CleanupStack::Pop( titleText ); |
|
350 SetStatusPaneFromActiveContextL(); |
343 iSPUtils->RefreshStatusPane(); |
351 iSPUtils->RefreshStatusPane(); |
344 |
352 |
345 TRACE_EXIT_POINT; |
353 TRACE_EXIT_POINT; |
346 } |
354 } |
347 |
355 |
405 { |
413 { |
406 iServices.IssueNotificationL(ECalenNotifyAlarmSnoozed); |
414 iServices.IssueNotificationL(ECalenNotifyAlarmSnoozed); |
407 } |
415 } |
408 else |
416 else |
409 { |
417 { |
410 if(cnt->GetFindItemMenu()->CommandIsValidL(aCommand)) |
418 if(cnt->GetFindItemMenu()->CommandIsValidL(aCommand) && toolbarImpl) |
411 { |
419 { |
412 CAknToolbar& toolbar = toolbarImpl->Toolbar(); |
420 CAknToolbar& toolbar = toolbarImpl->Toolbar(); |
413 toolbar.SetToolbarVisibility( EFalse ); |
421 toolbar.SetToolbarVisibility( EFalse ); |
414 cnt->GetFindItemMenu()->HandleItemFinderCommandL( aCommand ); |
422 cnt->GetFindItemMenu()->HandleItemFinderCommandL( aCommand ); |
415 toolbar.SetToolbarVisibility( ETrue ); |
423 toolbar.SetToolbarVisibility( ETrue ); |
808 |
816 |
809 void CCalenEventView::UpdateToolbarButtonsL() |
817 void CCalenEventView::UpdateToolbarButtonsL() |
810 { |
818 { |
811 // Get the existing toolbar from MCalenservices |
819 // Get the existing toolbar from MCalenservices |
812 MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull(); |
820 MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull(); |
813 CAknToolbar& toolbar = toolbarImpl->Toolbar(); |
821 |
814 TCalCollectionId colId = iServices.Context().InstanceId().iColId; |
822 TCalCollectionId colId = iServices.Context().InstanceId().iColId; |
815 |
823 |
816 // get multiple db data from services |
824 // get multiple db data from services |
817 RPointerArray<CCalCalendarInfo> calendarInfoList; |
825 RPointerArray<CCalCalendarInfo> calendarInfoList; |
818 iServices.GetAllCalendarInfoL(calendarInfoList); |
826 iServices.GetAllCalendarInfoL(calendarInfoList); |
820 |
828 |
821 HBufC* calendarFileName = iServices.GetCalFileNameForCollectionId(colId).AllocLC(); |
829 HBufC* calendarFileName = iServices.GetCalFileNameForCollectionId(colId).AllocLC(); |
822 TInt index = calendarInfoList.Find( *calendarFileName, |
830 TInt index = calendarInfoList.Find( *calendarFileName, |
823 CCalenEventViewContainer::CalendarInfoIdentifierL); |
831 CCalenEventViewContainer::CalendarInfoIdentifierL); |
824 CleanupStack::PopAndDestroy(calendarFileName); |
832 CleanupStack::PopAndDestroy(calendarFileName); |
825 |
833 if(toolbarImpl) |
826 |
|
827 if(!(calendarInfoList[index]->Enabled())) |
|
828 { |
834 { |
829 toolbar.SetItemDimmed( ECalenSend, ETrue, ETrue ); |
835 CAknToolbar& toolbar = toolbarImpl->Toolbar(); |
830 toolbar.SetItemDimmed( ECalenDeleteCurrentEntry, ETrue, ETrue ); |
836 if(!(calendarInfoList[index]->Enabled())) |
831 toolbar.SetItemDimmed( ECalenEditCurrentEntry, ETrue, ETrue ); |
837 { |
832 } |
838 toolbar.SetItemDimmed( ECalenSend, ETrue, ETrue ); |
833 else |
839 toolbar.SetItemDimmed( ECalenDeleteCurrentEntry, ETrue, ETrue ); |
834 { |
840 toolbar.SetItemDimmed( ECalenEditCurrentEntry, ETrue, ETrue ); |
835 toolbar.SetItemDimmed( ECalenSend, EFalse, ETrue ); |
841 } |
836 toolbar.SetItemDimmed( ECalenDeleteCurrentEntry, EFalse, ETrue ); |
842 else |
837 toolbar.SetItemDimmed( ECalenEditCurrentEntry, EFalse, ETrue ); |
843 { |
|
844 toolbar.SetItemDimmed( ECalenSend, EFalse, ETrue ); |
|
845 toolbar.SetItemDimmed( ECalenDeleteCurrentEntry, EFalse, ETrue ); |
|
846 toolbar.SetItemDimmed( ECalenEditCurrentEntry, EFalse, ETrue ); |
|
847 } |
838 } |
848 } |
839 CleanupStack::PopAndDestroy(&calendarInfoList); |
849 CleanupStack::PopAndDestroy(&calendarInfoList); |
840 } |
850 } |
|
851 // ---------------------------------------------------------------------------- |
|
852 // CCalenEventView::SetStatusPaneFromActiveContextL |
|
853 // Set the calendar name to status pane |
|
854 // (other items were commented in a header). |
|
855 // ---------------------------------------------------------------------------- |
|
856 // |
|
857 void CCalenEventView::SetStatusPaneFromActiveContextL() |
|
858 { |
|
859 TRACE_ENTRY_POINT; |
|
860 |
|
861 RPointerArray<CCalCalendarInfo> calendarInfoList; |
|
862 iServices.GetAllCalendarInfoL(calendarInfoList); |
|
863 CleanupClosePushL(calendarInfoList); |
|
864 |
|
865 TCalCollectionId colId; |
|
866 colId = iServices.Context().InstanceId().iColId; |
|
867 |
|
868 HBufC* calendarFileName = iServices.GetCalFileNameForCollectionId(colId).AllocLC(); |
|
869 TInt calIndex = calendarInfoList.Find( *calendarFileName, |
|
870 CCalenEventViewContainer::CalendarInfoIdentifierL); |
|
871 CleanupStack::PopAndDestroy(calendarFileName); |
|
872 if(calIndex != KErrNotFound) |
|
873 { |
|
874 HBufC* calendarName = calendarInfoList[calIndex]->NameL().AllocLC(); |
|
875 TRgb calendarColor = calendarInfoList[calIndex]->Color(); |
|
876 // navi pane |
|
877 CAknNavigationDecorator* naviLabel = iSPUtils->ShowNaviPaneL( *calendarName, calendarColor ); |
|
878 CleanupStack::PopAndDestroy(calendarName); |
|
879 } |
|
880 CleanupStack::PopAndDestroy(&calendarInfoList); |
|
881 |
|
882 |
|
883 iSPUtils->RefreshStatusPane(); |
|
884 TRACE_EXIT_POINT; |
|
885 } |
841 //end of file |
886 //end of file |