101 EFolderListIconServerFolders, |
98 EFolderListIconServerFolders, |
102 EFolderListIconMoreFolders, |
99 EFolderListIconMoreFolders, |
103 EFolderListIconEmailAccount |
100 EFolderListIconEmailAccount |
104 }; |
101 }; |
105 |
102 |
|
103 // Defines the order of the sort list icons in the sort icon array |
|
104 enum TFsEmailUiSortListIcons |
|
105 { |
|
106 ESortListAttachmentAscIcon = 0, |
|
107 ESortListAttachmentDescIcon, |
|
108 ESortListDateAscIcon, |
|
109 ESortListDateDescIcon, |
|
110 ESortListFollowAscIcon, |
|
111 ESortListFollowDescIcon, |
|
112 ESortListPriorityAscIcon, |
|
113 ESortListPriorityDescIcon, |
|
114 ESortListSenderAscIcon, |
|
115 ESortListSenderDescIcon, |
|
116 ESortListSubjectAscIcon, |
|
117 ESortListSubjectDescIcon, |
|
118 ESortListUnreadAscIcon, |
|
119 ESortListUnreadDescIcon |
|
120 }; |
|
121 |
106 // List level for the root folders |
122 // List level for the root folders |
107 static const TInt KListRootLevel( 1 ); |
123 static const TInt KListRootLevel( 1 ); |
108 // List supports three levels, so basically root folder + two levels of subfolders |
124 // List supports three levels, so basically root folder + two levels of subfolders |
109 static const TInt KListLastBasicLevel( KListRootLevel + 2 ); |
125 static const TInt KListLastBasicLevel( KListRootLevel + 2 ); |
|
126 |
|
127 const TInt KDefaultShadowBorderWidth( 15 ); |
|
128 const TReal KShadowBorderOpacity( 0.08 ); |
110 |
129 |
111 // Constants for drawing header text |
130 // Constants for drawing header text |
112 const TReal KFSHeaderTextBackgroundOpacity = 0.3f; |
131 const TReal KFSHeaderTextBackgroundOpacity = 0.3f; |
113 const TAlfTimedValue KFSVisible( 1 ); |
132 const TAlfTimedValue KFSVisible( 1 ); |
114 const TAlfTimedValue KFSInvisible( 0 ); |
133 const TAlfTimedValue KFSInvisible( 0 ); |
216 void CFSEmailUiFolderListVisualiser::DoFirstStartL() |
238 void CFSEmailUiFolderListVisualiser::DoFirstStartL() |
217 { |
239 { |
218 FUNC_LOG; |
240 FUNC_LOG; |
219 iControl = CFSEmailUiFolderListControl::NewL( iEnv, *this ); |
241 iControl = CFSEmailUiFolderListControl::NewL( iEnv, *this ); |
220 iModel = new (ELeave) CFSEmailUiFolderListModel(); |
242 iModel = new (ELeave) CFSEmailUiFolderListModel(); |
221 |
243 |
222 UpdateListSizeAttributes(); |
244 UpdateListSizeAttributes(); |
223 //LoadIconsL(); |
245 //LoadIconsL(); |
224 |
246 |
225 TRect mainPaneRect; |
247 TRect mainPaneRect; |
226 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
248 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); |
227 iFaderLayout = CAlfDeckLayout::AddNewL( *iControl ); |
249 iFaderLayout = CAlfDeckLayout::AddNewL( *iControl ); |
228 iFaderLayout->SetRect( mainPaneRect ); |
250 iFaderLayout->SetRect( mainPaneRect ); |
229 |
251 |
230 iParentLayout = CAlfAnchorLayout::AddNewL( *iControl ); |
252 iParentLayout = CAlfAnchorLayout::AddNewL( *iControl ); |
231 iParentLayout->SetRect( iScreenRect ); |
253 iParentLayout->SetRect( iScreenRect ); |
232 iParentLayout->SetFlags( EAlfVisualFlagManualLayout ); |
254 iParentLayout->SetFlags( EAlfVisualFlagManualLayout ); |
233 |
255 |
234 iParentLayout->EnableBrushesL(); |
256 iParentLayout->EnableBrushesL(); |
235 SetAnchors(); |
257 SetAnchors(); |
236 |
258 |
237 iFaderVisual = CAlfImageVisual::AddNewL( *iControl, iParentLayout ); |
259 iFaderVisual = CAlfImageVisual::AddNewL( *iControl, iParentLayout ); |
238 |
260 |
239 iHeaderLayout = CAlfDeckLayout::AddNewL( *iControl, iParentLayout ); |
261 iHeaderLayout = CAlfDeckLayout::AddNewL( *iControl, iParentLayout ); |
240 iHeaderLayout->SetFlags( EAlfVisualFlagAutomaticLocaleMirroringEnabled ); |
262 iHeaderLayout->SetFlags( EAlfVisualFlagAutomaticLocaleMirroringEnabled ); |
241 |
263 |
242 iHeaderTextVisual = CAlfTextVisual::AddNewL( *iControl, iHeaderLayout ); |
264 iHeaderTextVisual = CAlfTextVisual::AddNewL( *iControl, iHeaderLayout ); |
243 iHeaderTextVisual->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); |
265 iHeaderTextVisual->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); |
244 iHeaderTextVisual->SetTextL( KNullDesC ); |
266 iHeaderTextVisual->SetTextL( KNullDesC ); |
245 |
267 |
246 TRgb headerTextColor( KRgbBlack ); |
268 TRgb headerTextColor( KRgbBlack ); |
247 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), |
269 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), |
248 headerTextColor, KAknsIIDFsTextColors, EAknsCIFsTextColorsCG10 ); |
270 headerTextColor, KAknsIIDFsTextColors, EAknsCIFsTextColorsCG10 ); |
249 iHeaderTextVisual->SetColor( headerTextColor ); |
271 iHeaderTextVisual->SetColor( headerTextColor ); |
250 iHeaderTextVisual->SetTextStyle( iAppUi.LayoutHandler()-> |
272 iHeaderTextVisual->SetTextStyle( iAppUi.LayoutHandler()-> |
251 FSTextStyleFromLayoutL( AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_t1( 0 ) ).Id() ); |
273 FSTextStyleFromLayoutL( AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_t1( 0 ) ).Id() ); |
252 |
274 |
259 iHeaderTextVisual->SetAlign( EAlfAlignHLeft, EAlfAlignVCenter ); |
281 iHeaderTextVisual->SetAlign( EAlfAlignHLeft, EAlfAlignVCenter ); |
260 } |
282 } |
261 |
283 |
262 iHeaderTextVisual->SetOpacity( KFSInvisible ); |
284 iHeaderTextVisual->SetOpacity( KFSInvisible ); |
263 iHeaderLayout->SetOpacity( KFSInvisible ); |
285 iHeaderLayout->SetOpacity( KFSInvisible ); |
264 |
286 |
265 iListLayout = CAlfDeckLayout::AddNewL( *iControl, iParentLayout ); |
287 iListLayout = CAlfDeckLayout::AddNewL( *iControl, iParentLayout ); |
266 iListLayout->SetFlags(EAlfVisualFlagLayoutUpdateNotification|EAlfVisualFlagAutomaticLocaleMirroringEnabled); |
288 iListLayout->SetFlags(EAlfVisualFlagLayoutUpdateNotification|EAlfVisualFlagAutomaticLocaleMirroringEnabled); |
267 |
289 |
268 iTreeVisualizer = CFsTreeVisualizerBase::NewL(iControl, *iListLayout); |
290 iTreeVisualizer = CFsTreeVisualizerBase::NewL(iControl, *iListLayout); |
269 iTreeVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() ); |
291 iTreeVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() ); |
270 iTreeVisualizer->SetScrollTime( iAppUi.LayoutHandler()->ListScrollingTime() ); |
292 iTreeVisualizer->SetScrollTime( iAppUi.LayoutHandler()->ListScrollingTime() ); |
271 iTreeVisualizer->SetFadeInEffectTime( iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
293 iTreeVisualizer->SetFadeInEffectTime( iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
272 iTreeVisualizer->SetFadeOutEffectTime( iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
294 iTreeVisualizer->SetFadeOutEffectTime( iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
273 iTreeVisualizer->SetItemSeparatorSize( TSize(0, 0) ); |
295 iTreeVisualizer->SetItemSeparatorSize( TSize(0, 0) ); |
274 iTreeVisualizer->SetExpandCollapseAllOnLongTap( EFalse ); |
296 iTreeVisualizer->SetExpandCollapseAllOnLongTap( EFalse ); |
275 |
297 |
276 iTreeList = CFsTreeList::NewL( *iTreeVisualizer, iEnv ); |
298 iTreeList = CFsTreeList::NewL( *iTreeVisualizer, iEnv ); |
277 |
299 |
278 // Compared to S60 3.2.3 in S60 5.0 Alf offers the key events in |
300 // Compared to S60 3.2.3 in S60 5.0 Alf offers the key events in |
279 // opposite order. |
301 // opposite order. |
280 ControlGroup().AppendL( iControl ); |
302 ControlGroup().AppendL( iControl ); |
281 ControlGroup().AppendL( iTreeList->TreeControl() ); |
303 ControlGroup().AppendL( iTreeList->TreeControl() ); |
282 |
304 |
283 iTreeList->AddObserverL(*this); |
305 iTreeList->AddObserverL(*this); |
284 |
306 |
285 iTreeList->SetLoopingType( EFsTreeListLoopingJumpToFirstLast ); |
307 iTreeList->SetLoopingType( EFsTreeListLoopingJumpToFirstLast ); |
286 iTreeList->SetScrollbarVisibilityL( EFsScrollbarAuto ); |
308 iTreeList->SetScrollbarVisibilityL( EFsScrollbarAuto ); |
287 iAppUi.LayoutHandler()->SetListMarqueeBehaviour( iTreeList ); |
309 iAppUi.LayoutHandler()->SetListMarqueeBehaviour( iTreeList ); |
509 |
531 |
510 // --------------------------------------------------------------------------- |
532 // --------------------------------------------------------------------------- |
511 // CFSEmailUiFolderListVisualiser::DoShowInPopupL |
533 // CFSEmailUiFolderListVisualiser::DoShowInPopupL |
512 // --------------------------------------------------------------------------- |
534 // --------------------------------------------------------------------------- |
513 // |
535 // |
514 /*void CFSEmailUiFolderListVisualiser::DoShowInPopupL()*/ |
|
515 void CFSEmailUiFolderListVisualiser::DoShowInPopupL( |
536 void CFSEmailUiFolderListVisualiser::DoShowInPopupL( |
516 MFsControlButtonInterface* aButton, |
537 MFsControlButtonInterface* aButton, |
517 MFSEmailUiFolderListCallback* aFolderCallback, |
538 MFSEmailUiFolderListCallback* aFolderCallback, |
518 MFSEmailUiSortListCallback* aSortCallback ) |
539 MFSEmailUiSortListCallback* aSortCallback ) |
519 { |
540 { |
520 FUNC_LOG; |
541 FUNC_LOG; |
521 |
542 |
522 if ( ( aFolderCallback == NULL && aSortCallback == NULL ) || |
543 if ( ( aFolderCallback == NULL && aSortCallback == NULL ) || |
523 aButton == NULL ) |
544 aButton == NULL ) |
524 { |
545 { |
525 return; |
546 return; |
526 } |
547 } |
527 |
548 |
528 // In case of popup we are not moving or copying messages, |
549 // In case of popup we are not moving or copying messages, |
529 // so there's no need to connect the mailbox |
550 // so there's no need to connect the mailbox |
530 iNoConnectNeeded = ETrue; |
551 iNoConnectNeeded = ETrue; |
531 |
552 |
532 iCallback = aFolderCallback; |
553 iCallback = aFolderCallback; |
533 iSortListCallback = aSortCallback; |
554 iSortListCallback = aSortCallback; |
534 const TPoint buttonPos( aButton->Pos().Target() ); |
555 const TPoint buttonPos( aButton->Pos().Target() ); |
535 const TSize buttonSize( aButton->Size().Target().AsSize() ); |
556 const TSize buttonSize( aButton->Size().Target().AsSize() ); |
536 |
557 |
537 // TRect from where to start the transformation effect |
558 // TRect from where to start the transformation effect |
538 iCtrlButtonRect.SetRect( buttonPos, buttonSize ); |
559 TRect cbr = iAppUi.LayoutHandler()->GetControlBarRect(); |
|
560 iCtrlButtonRect.SetRect( buttonPos + cbr.iTl, buttonSize ); |
539 |
561 |
540 iFullScreen = EFalse; |
562 iFullScreen = EFalse; |
541 |
563 |
542 LoadIconsL(); |
564 LoadIconsL(); |
543 |
565 |
544 if ( !iFirstStartCompleted ) |
566 if ( !iFirstStartCompleted ) |
545 { |
567 { |
546 DoFirstStartL(); |
568 DoFirstStartL(); |
547 } |
569 } |
548 |
570 |
574 TRect outerRect( iScreenRect ); |
596 TRect outerRect( iScreenRect ); |
575 outerRect.Shrink( paddingValue, paddingValue ); |
597 outerRect.Shrink( paddingValue, paddingValue ); |
576 iBackgroundBrush->SetFrameRectsL( outerRect, iScreenRect ); |
598 iBackgroundBrush->SetFrameRectsL( outerRect, iScreenRect ); |
577 } |
599 } |
578 |
600 |
579 // Append brush if it's not yet appended. Currently this is our only |
601 // Append brush if it's not yet appended. Currently this is our only |
580 // brush so if brush count is more than zero, this brush is already |
602 // brush so if brush count is more than zero, this brush is already |
581 // appended. If other brush(es) are added later, this implementation |
603 // appended. If other brush(es) are added later, this implementation |
582 // need to be changed. |
604 // need to be changed. |
583 if ( iParentLayout->Brushes()->Count() == 0 ) |
605 if ( iParentLayout->Brushes()->Count() == 0 ) |
584 { |
606 { |
585 // Keep the ownership of the brush to avoid unneeded object |
607 // Keep the ownership of the brush to avoid unneeded object |
586 // deletion / reconstruction |
608 // deletion / reconstruction |
587 iParentLayout->Brushes()->AppendL( iBackgroundBrush, EAlfDoesNotHaveOwnership ); |
609 iParentLayout->Brushes()->AppendL( iBackgroundBrush, EAlfDoesNotHaveOwnership ); |
588 } |
610 } |
589 |
611 |
|
612 if( !iShadowBrush ) |
|
613 { |
|
614 iShadowBrush = CAlfShadowBorderBrush::NewL( |
|
615 iEnv, TAlfMetric( KDefaultShadowBorderWidth ) ); |
|
616 iShadowBrush->SetOpacity( KShadowBorderOpacity ); |
|
617 iShadowBrush->SetLayer( EAlfBrushLayerBackground ); |
|
618 iParentLayout->Brushes()->AppendL( iShadowBrush, |
|
619 EAlfDoesNotHaveOwnership ); |
|
620 } |
|
621 |
590 SetPopupSoftkeysL(); |
622 SetPopupSoftkeysL(); |
591 // SetRect need to be called also here, otherwise the list layout might |
623 // SetRect need to be called also here, otherwise the list layout might |
592 // be wrong in mirrored layout |
624 // be wrong in mirrored layout |
593 //iParentLayout->SetRect( iScreenRect ); |
|
594 iParentLayout->SetRect( iCtrlButtonRect ); |
625 iParentLayout->SetRect( iCtrlButtonRect ); |
595 |
626 |
596 opacity.SetValueNow( 1 ); |
627 opacity.SetValueNow( 1 ); |
597 //opacity.SetTarget( 1, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
628 //opacity.SetTarget( 1, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
598 iParentLayout->SetOpacity( opacity ); |
629 iParentLayout->SetOpacity( opacity ); |
599 iParentLayout->SetRect( iScreenRect, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
630 iParentLayout->SetRect( iScreenRect, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
600 iParentLayout->UpdateChildrenLayout(); |
631 iParentLayout->UpdateChildrenLayout(); |
601 iTreeList->DisableKineticScrolling( ETrue ); |
632 iTreeList->DisableKineticScrolling( ETrue ); |
602 iTreeList->ShowListL( ETrue ); |
633 iTreeList->ShowListL( ETrue ); |
603 iTreeList->SetFocusedL( ETrue ); |
634 iTreeList->SetFocusedL( ETrue ); |
|
635 iFocusVisible = iAppUi.IsFocusShown(); |
|
636 iTreeVisualizer->SetFocusVisibility( iFocusVisible ); |
604 iPopupListShown = ETrue; |
637 iPopupListShown = ETrue; |
605 } |
638 } |
606 |
639 |
607 // --------------------------------------------------------------------------- |
640 // --------------------------------------------------------------------------- |
608 // CFSEmailUiFolderListVisualiser::ShowInPopupL |
641 // CFSEmailUiFolderListVisualiser::ShowInPopupL |
622 // --------------------------------------------------------------------------- |
655 // --------------------------------------------------------------------------- |
623 // CFSEmailUiFolderListVisualiser::ShowSortListPopupL |
656 // CFSEmailUiFolderListVisualiser::ShowSortListPopupL |
624 // --------------------------------------------------------------------------- |
657 // --------------------------------------------------------------------------- |
625 // |
658 // |
626 void CFSEmailUiFolderListVisualiser::ShowSortListPopupL( |
659 void CFSEmailUiFolderListVisualiser::ShowSortListPopupL( |
627 const TFSMailSortField aCurrentSortOrder, |
660 const TFSMailSortCriteria aCurrentSortCriteria, |
628 const TFSFolderType aFolderType, |
661 const TFSFolderType aFolderType, |
629 MFSEmailUiSortListCallback* aCallback, |
662 MFSEmailUiSortListCallback* aCallback, |
630 MFsControlButtonInterface* aButton ) |
663 MFsControlButtonInterface* aButton ) |
631 { |
664 { |
632 FUNC_LOG; |
665 FUNC_LOG; |
633 iCurrentSortOrder = aCurrentSortOrder; |
666 iCurrentSortCriteria = aCurrentSortCriteria; |
634 iCurrentFolderType = aFolderType; |
667 iCurrentFolderType = aFolderType; |
635 DoShowInPopupL( aButton, NULL, aCallback ); |
668 DoShowInPopupL( aButton, NULL, aCallback ); |
636 } |
669 } |
637 |
670 |
638 // --------------------------------------------------------------------------- |
671 // --------------------------------------------------------------------------- |
747 TFolderListActivationData subView; |
780 TFolderListActivationData subView; |
748 TPckgBuf<TFolderListActivationData> viewData( subView ); |
781 TPckgBuf<TFolderListActivationData> viewData( subView ); |
749 viewData.Copy( aCustomMessage ); |
782 viewData.Copy( aCustomMessage ); |
750 iCallback = viewData().iCallback; |
783 iCallback = viewData().iCallback; |
751 iCurrentFolderType = viewData().iSourceFolderType; |
784 iCurrentFolderType = viewData().iSourceFolderType; |
752 |
785 |
753 iTreeList->HideListL(); |
786 iTreeList->HideListL(); |
754 |
787 |
755 // Clear padding when shown in full screen |
788 // Clear padding when shown in full screen |
756 const TAlfMetric padding( 0 ); |
789 const TAlfMetric padding( 0 ); |
757 iParentLayout->SetPadding( padding ); |
790 iParentLayout->SetPadding( padding ); |
758 iListLayout->SetPadding( padding ); |
791 iListLayout->SetPadding( padding ); |
759 |
792 |
760 PrepareFolderListL(); |
793 PrepareFolderListL(); |
761 |
794 |
762 // Remove need to be called for all brushes before Reset, otherwise the |
795 // Remove need to be called for all brushes before Reset, otherwise the |
763 // brush resources are not completely freed from server side -> brushes |
796 // brush resources are not completely freed from server side -> brushes |
764 // keep "hanging" there and make future drawing slower. |
797 // keep "hanging" there and make future drawing slower. |
765 while( iParentLayout->Brushes()->Count() > 0 ) |
798 while( iParentLayout->Brushes()->Count() > 0 ) |
766 { |
799 { |
767 iParentLayout->Brushes()->Remove( 0 ); |
800 iParentLayout->Brushes()->Remove( 0 ); |
768 } |
801 } |
769 iParentLayout->Brushes()->Reset(); |
802 iParentLayout->Brushes()->Reset(); |
770 |
803 |
771 TAlfTimedValue layoutOpacity = iHeaderLayout->Opacity(); |
804 TAlfTimedValue layoutOpacity = iHeaderLayout->Opacity(); |
772 layoutOpacity.SetTarget( 1, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime()/2 ); |
805 layoutOpacity.SetTarget( 1, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime()/2 ); |
773 iHeaderLayout->SetOpacity( layoutOpacity ); |
806 iHeaderLayout->SetOpacity( layoutOpacity ); |
774 |
807 |
775 TAlfTimedValue bgImageOpacity = iListBgImageVisual->Opacity(); |
808 TAlfTimedValue bgImageOpacity = iListBgImageVisual->Opacity(); |
776 bgImageOpacity.SetTarget( 1, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime()/2 ); |
809 bgImageOpacity.SetTarget( 1, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime()/2 ); |
777 iListBgImageVisual->SetOpacity( bgImageOpacity ); |
810 iListBgImageVisual->SetOpacity( bgImageOpacity ); |
778 |
811 |
779 // Reset the variables used in horizontal scrolling |
812 // Reset the variables used in horizontal scrolling |
780 iPreviousListRect = iListLayout->DisplayRectTarget(); |
813 iPreviousListRect = iListLayout->DisplayRectTarget(); |
781 iPreviousListLevel = KListRootLevel; |
814 iPreviousListLevel = KListRootLevel; |
782 |
815 |
783 iParentLayout->SetRect( iScreenRect ); |
816 iParentLayout->SetRect( iScreenRect ); |
784 iTreeList->ShowListL(); |
817 iTreeList->ShowListL(); |
785 |
818 |
786 TAlfTimedValue opacity; |
819 TAlfTimedValue opacity; |
787 opacity.SetValueNow( 1 ); |
820 opacity.SetValueNow( 1 ); |
881 void CFSEmailUiFolderListVisualiser::SetFocusToCurrentSortItemL() |
915 void CFSEmailUiFolderListVisualiser::SetFocusToCurrentSortItemL() |
882 { |
916 { |
883 FUNC_LOG; |
917 FUNC_LOG; |
884 if ( iFirstStartCompleted ) // Safety |
918 if ( iFirstStartCompleted ) // Safety |
885 { |
919 { |
886 for ( TInt i=0; i < iModel->Count() ; i++ ) |
920 for ( TInt i = 0; i < iModel->Count(); i++ ) |
887 { |
921 { |
888 CFSEmailUiFolderListItem* modelItem = iModel->ItemByIndex( i ); |
922 CFSEmailUiFolderListItem* modelItem = iModel->ItemByIndex( i ); |
889 if ( modelItem && ( modelItem->iSortField == iCurrentSortOrder ) ) |
923 if ( modelItem && ( modelItem->iSortField == iCurrentSortCriteria.iField ) ) |
890 { |
924 { |
891 iTreeVisualizer->SetFocusedItemL( modelItem->iListId, EFalse ); |
925 iTreeVisualizer->SetFocusedItemL( modelItem->iListId, EFalse ); |
892 break; |
926 break; |
893 } |
927 } |
894 } |
928 } |
|
929 |
|
930 // Bold the focused item's text |
|
931 TInt arraySize = iListItemVisulizers.Count(); |
|
932 for( TInt i = 0; i < arraySize; i++ ) |
|
933 { |
|
934 TFsTreeItemId id = iTreeList->FocusedItem(); |
|
935 if ( iListItemVisulizers[ i ] == &( iTreeList->ItemVisualizer( id ) ) ) |
|
936 { |
|
937 iListItemVisulizers[i]->SetTextBold( ETrue ); |
|
938 break; |
|
939 } |
|
940 } |
895 } |
941 } |
896 } |
942 } |
897 |
943 |
898 // --------------------------------------------------------------------------- |
944 // --------------------------------------------------------------------------- |
899 // In case of folder list popup, this function sets focus to current folder, |
945 // In case of folder list popup, this function sets focus to current folder, |
961 // --------------------------------------------------------------------------- |
1007 // --------------------------------------------------------------------------- |
962 // |
1008 // |
963 TBool CFSEmailUiFolderListVisualiser::OfferEventL(const TAlfEvent& aEvent) |
1009 TBool CFSEmailUiFolderListVisualiser::OfferEventL(const TAlfEvent& aEvent) |
964 { |
1010 { |
965 FUNC_LOG; |
1011 FUNC_LOG; |
966 TBool result( EFalse ); |
1012 TBool result( EFalse ); |
967 if ( aEvent.IsKeyEvent() && aEvent.Code() == EEventKey ) |
1013 if ( aEvent.IsKeyEvent() && aEvent.Code() == EEventKey ) |
968 { |
1014 { |
969 // Swap left and right with mirrored layout |
1015 // Swap left and right with mirrored layout |
970 TInt scanCode = aEvent.KeyEvent().iScanCode; |
1016 TInt scanCode( aEvent.KeyEvent().iScanCode ); |
971 if ( AknLayoutUtils::LayoutMirrored() ) |
1017 if ( AknLayoutUtils::LayoutMirrored() ) |
972 { |
1018 { |
973 if ( scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow; |
1019 if( scanCode == EStdKeyLeftArrow ) |
974 else if ( scanCode == EStdKeyRightArrow ) scanCode = EStdKeyLeftArrow; |
1020 { |
975 } |
1021 scanCode = EStdKeyRightArrow; |
976 |
1022 } |
|
1023 else if( scanCode == EStdKeyRightArrow ) |
|
1024 { |
|
1025 scanCode = EStdKeyLeftArrow; |
|
1026 } |
|
1027 } |
|
1028 |
|
1029 // Handle possible focus visibility change |
|
1030 if( ( scanCode == EStdKeyRightArrow ) || |
|
1031 ( scanCode == EStdKeyLeftArrow ) || |
|
1032 ( scanCode == EStdKeyUpArrow ) || |
|
1033 ( scanCode == EStdKeyDownArrow ) || |
|
1034 ( scanCode == EStdKeyEnter ) || |
|
1035 ( scanCode == EStdKeyDeviceA ) || |
|
1036 ( scanCode == EStdKeyDevice3 ) ) |
|
1037 { |
|
1038 // If the focus was not active already, ignore the key press |
|
1039 if( !iAppUi.SetFocusVisibility( ETrue ) ) |
|
1040 { |
|
1041 return ETrue; |
|
1042 } |
|
1043 } |
|
1044 |
977 switch ( scanCode ) |
1045 switch ( scanCode ) |
978 { |
1046 { |
979 case EStdKeyDevice3: // CENTER CLICK |
1047 case EStdKeyDevice3: // CENTER CLICK |
980 case EStdKeyEnter: // ENTER |
1048 case EStdKeyEnter: // ENTER |
981 { |
1049 { |
1015 } |
1083 } |
1016 break; |
1084 break; |
1017 |
1085 |
1018 default: |
1086 default: |
1019 // Check keyboard shortcuts. |
1087 // Check keyboard shortcuts. |
1020 TInt shortcutCommand = |
1088 TInt shortcutCommand = |
1021 iAppUi.ShortcutBinding().CommandForShortcutKey( aEvent.KeyEvent(), |
1089 iAppUi.ShortcutBinding().CommandForShortcutKey( aEvent.KeyEvent(), |
1022 CFSEmailUiShortcutBinding::EContextFolderList ); |
1090 CFSEmailUiShortcutBinding::EContextFolderList ); |
1023 if ( shortcutCommand != KErrNotFound ) |
1091 if ( shortcutCommand != KErrNotFound ) |
1024 { |
1092 { |
1025 HandleCommandL( shortcutCommand ); |
1093 HandleCommandL( shortcutCommand ); |
1026 result = ETrue; |
1094 result = ETrue; |
1027 } |
1095 } |
1028 break; |
1096 break; |
1029 } |
1097 } |
1030 } |
1098 } |
1031 return result; |
1099 return result; |
1032 } |
1100 } |
1033 |
1101 |
1034 // --------------------------------------------------------------------------- |
1102 // --------------------------------------------------------------------------- |
1035 // CFSEmailUiFolderListVisualiser::HandlePointerEventL |
1103 // CFSEmailUiFolderListVisualiser::HandlePointerEventL |
1036 // --------------------------------------------------------------------------- |
1104 // --------------------------------------------------------------------------- |
1037 // |
1105 // |
1038 TBool CFSEmailUiFolderListVisualiser::HandlePointerEventL(const TAlfEvent& aEvent) |
1106 TBool CFSEmailUiFolderListVisualiser::HandlePointerEventL(const TAlfEvent& aEvent) |
1039 { |
1107 { |
1040 // Handle pointer events to fadervisual. If the list is shown in popup, then |
1108 TBool eventHandled( EFalse ); |
1041 // the popup will be closed. |
1109 |
1042 if ((aEvent.Visual() == iFaderVisual || aEvent.Visual() == iFaderLayout) && aEvent.PointerEvent().iType == TPointerEvent::EButton1Down && iPopupListShown) |
1110 if( ( aEvent.Visual() == iFaderVisual || aEvent.Visual() == iFaderLayout ) && |
1043 { |
1111 ( aEvent.PointerEvent().iType == TPointerEvent::EButton1Down ) && |
|
1112 ( iPopupListShown ) ) |
|
1113 { |
|
1114 iAppUi.SetFocusVisibility( EFalse ); |
1044 HandleSelectionL( EFSEmailUiCtrlBarResponseCancel ); |
1115 HandleSelectionL( EFSEmailUiCtrlBarResponseCancel ); |
|
1116 eventHandled = ETrue; |
1045 } |
1117 } |
1046 else |
1118 else |
1047 { |
1119 { |
1048 return iTreeList->TreeControl()->OfferEventL(aEvent); |
1120 // Handle pointer events to fadervisual. If the list is shown in popup, |
1049 } |
1121 // then the popup will be closed. |
1050 return ETrue; |
1122 if( ( aEvent.IsPointerEvent() ) && |
|
1123 ( aEvent.PointerEvent().iType == TPointerEvent::EButton1Up ) ) |
|
1124 { |
|
1125 eventHandled = iTreeList->TreeControl()->OfferEventL(aEvent); |
|
1126 // Hide focus visibility always after pointer up event. |
|
1127 iAppUi.SetFocusVisibility( EFalse ); |
|
1128 } |
|
1129 else |
|
1130 { |
|
1131 eventHandled = iTreeList->TreeControl()->OfferEventL(aEvent); |
|
1132 } |
|
1133 } |
|
1134 return eventHandled; |
1051 } |
1135 } |
1052 |
1136 |
1053 // --------------------------------------------------------------------------- |
1137 // --------------------------------------------------------------------------- |
1054 // CFSEmailUiFolderListVisualiser::DynInitMenuPaneL |
1138 // CFSEmailUiFolderListVisualiser::DynInitMenuPaneL |
1055 // --------------------------------------------------------------------------- |
1139 // --------------------------------------------------------------------------- |
1063 if ( aResourceId == R_FSEMAILUI_FOLDERLIST_MENUPANE ) |
1147 if ( aResourceId == R_FSEMAILUI_FOLDERLIST_MENUPANE ) |
1064 { |
1148 { |
1065 if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) |
1149 if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) |
1066 { |
1150 { |
1067 // remove help support in pf5250 |
1151 // remove help support in pf5250 |
1068 aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
1152 aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
1069 } |
1153 } |
1070 |
1154 |
1071 // OFFLINE/ONLINE MENU SELECTION |
1155 // OFFLINE/ONLINE MENU SELECTION |
1072 if( iMoveOrCopyInitiated ) |
1156 if( iMoveOrCopyInitiated ) |
1073 { |
1157 { |
1074 TFSMailBoxStatus onlineStatus = iAppUi.GetActiveMailbox()->GetMailBoxStatus(); |
1158 TFSMailBoxStatus onlineStatus = iAppUi.GetActiveMailbox()->GetMailBoxStatus(); |
1075 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnline, onlineStatus == EFSMailBoxOnline ); |
1159 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnline, onlineStatus == EFSMailBoxOnline ); |
1076 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, onlineStatus == EFSMailBoxOffline ); |
1160 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, onlineStatus == EFSMailBoxOffline ); |
1077 } |
1161 } |
1078 else |
1162 else |
1079 { |
1163 { |
1080 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnline, ETrue ); |
1164 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOnline, ETrue ); |
1081 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, ETrue ); |
1165 aMenuPane->SetItemDimmed( EFsEmailUiCmdGoOffline, ETrue ); |
1082 } |
1166 } |
1083 |
1167 |
1084 // select option |
1168 // select option |
1085 aMenuPane->SetItemDimmed( EFsEmailUiCmdSelect, iModel->Count() == 0 ); |
1169 aMenuPane->SetItemDimmed( EFsEmailUiCmdSelect, iModel->Count() == 0 ); |
1086 |
1170 |
1087 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, AllNodesCollapsed() ); |
1171 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, AllNodesCollapsed() ); |
1088 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, AllNodesExpanded() ); |
1172 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, AllNodesExpanded() ); |
1089 } |
1173 } |
1090 |
1174 |
1091 // Add shortcut hints |
1175 // Add shortcut hints |
1092 iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, |
1176 iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, |
1093 CFSEmailUiShortcutBinding::EContextFolderList ); |
1177 CFSEmailUiShortcutBinding::EContextFolderList ); |
1094 } |
1178 } |
1095 } |
1179 } |
1096 |
1180 |
1097 |
1181 |
1098 // --------------------------------------------------------------------------- |
1182 // --------------------------------------------------------------------------- |
1099 // |
1183 // |
1100 // --------------------------------------------------------------------------- |
1184 // --------------------------------------------------------------------------- |
1101 // |
1185 // |
1102 void CFSEmailUiFolderListVisualiser::HandleSelectionL( TFSEmailUiCtrlBarResponse aSelection ) |
1186 void CFSEmailUiFolderListVisualiser::HandleSelectionL( TFSEmailUiCtrlBarResponse aSelection ) |
1103 { |
1187 { |
1104 FUNC_LOG; |
1188 FUNC_LOG; |
1105 // If popup is not open or the view is not active, then do nothing |
1189 // If popup is not open or the view is not active, then do nothing |
1106 if ( !(iPopupListShown || IsViewActive()) ) |
1190 if ( !(iPopupListShown || IsViewActive()) ) |
1107 { |
1191 { |
1108 return; |
1192 return; |
1109 } |
1193 } |
1110 |
1194 |
1111 TBool popupHiddenAlready(EFalse); |
1195 TBool popupHiddenAlready(EFalse); |
1112 switch( aSelection ) |
1196 switch( aSelection ) |
1113 { |
1197 { |
1114 case EFSEmailUiCtrlBarResponseSelect: |
1198 case EFSEmailUiCtrlBarResponseSelect: |
1115 { |
1199 { |
1182 return GetRootParent( parentId ); |
1266 return GetRootParent( parentId ); |
1183 } |
1267 } |
1184 } |
1268 } |
1185 |
1269 |
1186 // --------------------------------------------------------------------------- |
1270 // --------------------------------------------------------------------------- |
1187 // Override the default transition effect in case full screen mode is launched |
1271 // Override the default transition effect in case full screen mode is launched |
1188 // from popup mode. |
1272 // from popup mode. |
1189 // --------------------------------------------------------------------------- |
1273 // --------------------------------------------------------------------------- |
1190 // |
1274 // |
1191 void CFSEmailUiFolderListVisualiser::DoTransitionEffect( TBool aDirectionOut ) |
1275 void CFSEmailUiFolderListVisualiser::DoTransitionEffect( TBool aDirectionOut ) |
1192 { |
1276 { |
1193 FUNC_LOG; |
1277 FUNC_LOG; |
1194 if ( !aDirectionOut && IsFullScreen() && iAnimateNextActivation ) |
1278 if ( !aDirectionOut && IsFullScreen() && iAnimateNextActivation ) |
1195 { |
1279 { |
1196 TInt rectTransitionTime = iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime(); |
1280 TInt rectTransitionTime = iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime(); |
1197 TInt opacityTransitionTime = iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() / 2; |
1281 TInt opacityTransitionTime = iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() / 2; |
1198 |
1282 |
1199 TAlfTimedValue opacity; |
1283 TAlfTimedValue opacity; |
1200 opacity.SetValueNow( 0 ); |
1284 opacity.SetValueNow( 0 ); |
1201 opacity.SetTarget( 1, opacityTransitionTime ); |
1285 opacity.SetTarget( 1, opacityTransitionTime ); |
1202 iParentLayout->SetOpacity( opacity ); |
1286 iParentLayout->SetOpacity( opacity ); |
1203 |
1287 |
1204 // Do animated enlargening from popup window rect to full screen rect |
1288 // Do animated enlargening from popup window rect to full screen rect |
1205 iParentLayout->SetRect( FolderListRectInThisResolution() ); |
1289 iParentLayout->SetRect( FolderListRectInThisResolution() ); |
1206 iParentLayout->SetRect( iScreenRect, rectTransitionTime ); |
1290 iParentLayout->SetRect( iScreenRect, rectTransitionTime ); |
1207 } |
1291 } |
1208 else |
1292 else |
1295 { |
1388 { |
1296 CESMailSettingsPlugin::TSubViewActivationData activationData; |
1389 CESMailSettingsPlugin::TSubViewActivationData activationData; |
1297 activationData.iAccount = iAppUi.GetActiveMailbox()->GetId(); |
1390 activationData.iAccount = iAppUi.GetActiveMailbox()->GetId(); |
1298 activationData.iSubviewId = 1; |
1391 activationData.iSubviewId = 1; |
1299 activationData.iLaunchFolderSettings = ETrue; |
1392 activationData.iLaunchFolderSettings = ETrue; |
1300 |
1393 |
1301 TUid pluginUid = iAppUi.GetActiveMailbox()->GetSettingsUid(); |
1394 TUid pluginUid = iAppUi.GetActiveMailbox()->GetSettingsUid(); |
1302 // register plugin view if not exists so that activation can be made |
1395 // register plugin view if not exists so that activation can be made |
1303 if ( !iAppUi.View( pluginUid ) ) |
1396 if ( !iAppUi.View( pluginUid ) ) |
1304 { |
1397 { |
1305 CESMailSettingsPlugin* plugin = CESMailSettingsPlugin::NewL( pluginUid ); |
1398 CESMailSettingsPlugin* plugin = CESMailSettingsPlugin::NewL( pluginUid ); |
1306 CleanupStack::PushL( plugin ); |
1399 CleanupStack::PushL( plugin ); |
1307 iAppUi.AddViewL( plugin ); |
1400 iAppUi.AddViewL( plugin ); |
1308 CleanupStack::Pop( plugin ); |
1401 CleanupStack::Pop( plugin ); |
1309 } |
1402 } |
1310 TUid messageId = TUid::Uid( CESMailSettingsPlugin::EActivateMailSettingsSubview ); |
1403 TUid messageId = TUid::Uid( CESMailSettingsPlugin::EActivateMailSettingsSubview ); |
1311 const TPckgBuf<CESMailSettingsPlugin::TSubViewActivationData> pluginMessagePkg( activationData ); |
1404 const TPckgBuf<CESMailSettingsPlugin::TSubViewActivationData> pluginMessagePkg( activationData ); |
1312 iAppUi.EnterPluginSettingsViewL( pluginUid, messageId, pluginMessagePkg ); |
1405 iAppUi.EnterPluginSettingsViewL( pluginUid, messageId, pluginMessagePkg ); |
1313 |
1406 |
1314 // Hide list to avoid it flashing when returning back |
1407 // Hide list to avoid it flashing when returning back |
1315 iTreeList->HideListL(); |
1408 iTreeList->HideListL(); |
1316 } |
1409 } |
1317 break; |
1410 break; |
1318 |
1411 |
1384 |
1477 |
1385 if( focusedItem == KFsTreeNoneID ) |
1478 if( focusedItem == KFsTreeNoneID ) |
1386 { |
1479 { |
1387 return ETrue; |
1480 return ETrue; |
1388 } |
1481 } |
1389 |
1482 |
1390 if( focusedItem == iMoreFoldersItemId ) |
1483 if( focusedItem == iMoreFoldersItemId ) |
1391 { |
1484 { |
1392 //HidePopupL(); |
1485 //HidePopupL(); |
1393 iFullScreen = ETrue; |
1486 iFullScreen = ETrue; |
1394 |
1487 |
1395 TFolderListActivationData tmp; |
1488 TFolderListActivationData tmp; |
1396 tmp.iCallback = iCallback; |
1489 tmp.iCallback = iCallback; |
1397 const TPckgBuf<TFolderListActivationData> pkgOut( tmp ); |
1490 const TPckgBuf<TFolderListActivationData> pkgOut( tmp ); |
1398 |
1491 |
1399 iAppUi.EnterFsEmailViewL( FolderListId, KFolderListSelectFolder, pkgOut ); |
1492 iAppUi.EnterFsEmailViewL( FolderListId, KFolderListSelectFolder, pkgOut ); |
1400 |
1493 |
1401 return EFalse; |
1494 return EFalse; |
1402 } |
1495 } |
1403 |
1496 |
1404 CFSEmailUiFolderListItem* modelItem = iModel->ItemByListId( focusedItem ); |
1497 CFSEmailUiFolderListItem* modelItem = iModel->ItemByListId( focusedItem ); |
1405 if( !modelItem ) // Safety check, shouldn't be possible |
1498 if( !modelItem ) // Safety check, shouldn't be possible |
1406 { |
1499 { |
1407 return EFalse; |
1500 return EFalse; |
1408 } |
1501 } |
1409 |
1502 |
1410 if( iCallback ) |
1503 if( iCallback ) |
1411 { |
1504 { |
1412 const TFSMailMsgId& selectedFolderId = modelItem->iFolderId; |
1505 const TFSMailMsgId& selectedFolderId = modelItem->iFolderId; |
1413 const TFSMailMsgId& selectedMailboxId = modelItem->iMailboxId; |
1506 const TFSMailMsgId& selectedMailboxId = modelItem->iMailboxId; |
1414 if( !selectedFolderId.IsNullId() ) |
1507 if( !selectedFolderId.IsNullId() ) |
1415 { |
1508 { |
1416 if ( iCustomMessageId == KFolderListMoveMessage || |
1509 if ( iCustomMessageId == KFolderListMoveMessage || |
1417 iCustomMessageId == KFolderListMoveMessages || |
1510 iCustomMessageId == KFolderListMoveMessages || |
1418 iCustomMessageId == KFolderListCopyMessage || |
1511 iCustomMessageId == KFolderListCopyMessage || |
1419 iCustomMessageId == KFolderListCopyMessages ) |
1512 iCustomMessageId == KFolderListCopyMessages ) |
1420 { |
1513 { |
1421 iLatestSelectedMoveFolderId = selectedFolderId; |
1514 iLatestSelectedMoveFolderId = selectedFolderId; |
1422 } |
1515 } |
1423 iCallback->FolderSelectedL( selectedFolderId, EFSEmailUiCtrlBarResponseSelect ); |
1516 iCallback->FolderSelectedL( selectedFolderId, EFSEmailUiCtrlBarResponseSelect ); |
1424 } |
1517 } |
1425 else if( !selectedMailboxId.IsNullId() ) |
1518 else if( !selectedMailboxId.IsNullId() ) |
1426 { |
1519 { |
1427 iCallback->MailboxSelectedL( selectedMailboxId ); |
1520 iCallback->MailboxSelectedL( selectedMailboxId ); |
1435 iSortListCallback->SortOrderChangedL( modelItem->iSortField, EFSEmailUiCtrlBarResponseSelect ); |
1528 iSortListCallback->SortOrderChangedL( modelItem->iSortField, EFSEmailUiCtrlBarResponseSelect ); |
1436 // Set callback to NULL after callback is called so that the |
1529 // Set callback to NULL after callback is called so that the |
1437 // same callback is not reused unintentionally. |
1530 // same callback is not reused unintentionally. |
1438 iSortListCallback = NULL; |
1531 iSortListCallback = NULL; |
1439 } |
1532 } |
1440 |
1533 |
1441 return ETrue; |
1534 return ETrue; |
1442 } |
1535 } |
1443 |
1536 |
1444 |
1537 |
1445 // --------------------------------------------------------------------------- |
1538 // --------------------------------------------------------------------------- |
1446 // Append node to list by getting the item data from resource |
1539 // Append node to list by getting the item data from resource |
1447 // --------------------------------------------------------------------------- |
1540 // --------------------------------------------------------------------------- |
1448 // |
1541 // |
1449 void CFSEmailUiFolderListVisualiser::SetHeaderTextByResourceIdL( |
1542 void CFSEmailUiFolderListVisualiser::SetHeaderTextByResourceIdL( |
1450 TInt aResourceId ) |
1543 TInt aResourceId ) |
1451 { |
1544 { |
1452 FUNC_LOG; |
1545 FUNC_LOG; |
1453 if ( iFirstStartCompleted ) // Safety |
1546 if ( iFirstStartCompleted ) // Safety |
1454 { |
1547 { |
1455 HBufC* headingText = StringLoader::LoadLC( aResourceId ); |
1548 HBufC* headingText = StringLoader::LoadLC( aResourceId ); |
1456 SetHeaderTextAttributesL(); |
1549 SetHeaderTextAttributesL(); |
1457 iHeaderTextVisual->SetTextL( *headingText ); |
1550 iHeaderTextVisual->SetTextL( *headingText ); |
1458 CleanupStack::PopAndDestroy( headingText ); |
1551 CleanupStack::PopAndDestroy( headingText ); |
1459 } |
1552 } |
1644 } |
1733 } |
1645 |
1734 |
1646 void CFSEmailUiFolderListVisualiser::AppendSortListItemsL() |
1735 void CFSEmailUiFolderListVisualiser::AppendSortListItemsL() |
1647 { |
1736 { |
1648 FUNC_LOG; |
1737 FUNC_LOG; |
1649 TFsTreeItemId itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_DATE, KFsTreeRootID, NULL, EFalse ); |
1738 |
|
1739 // Select correct icon depending on the selected sort criteria |
|
1740 CAlfTexture* icon( NULL ); |
|
1741 icon = iCurrentSortCriteria.iField == EFSMailSortByDate ? |
|
1742 iCurrentSortCriteria.iOrder == EFSMailAscending ? |
|
1743 iSortIconArray[ ESortListDateDescIcon ] : |
|
1744 iSortIconArray[ ESortListDateAscIcon ] : |
|
1745 iSortIconArray[ ESortListDateDescIcon ]; |
|
1746 |
|
1747 TFsTreeItemId itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_DATE, KFsTreeRootID, icon, EFalse ); |
1650 iModel->AppendL( itemId, EFSMailSortByDate ); |
1748 iModel->AppendL( itemId, EFSMailSortByDate ); |
1651 |
1749 |
1652 switch( iCurrentFolderType ) |
1750 switch( iCurrentFolderType ) |
1653 { |
1751 { |
1654 case EFSSentFolder: |
1752 case EFSSentFolder: |
1655 case EFSDraftsFolder: |
1753 case EFSDraftsFolder: |
1656 case EFSOutbox: |
1754 case EFSOutbox: |
1657 { |
1755 { |
1658 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_RECIPIENT, KFsTreeRootID, NULL, EFalse ); |
1756 icon = iCurrentSortCriteria.iField == EFSMailSortByRecipient ? |
|
1757 iCurrentSortCriteria.iOrder == EFSMailAscending ? |
|
1758 iSortIconArray[ ESortListSenderDescIcon ] : |
|
1759 iSortIconArray[ ESortListSenderAscIcon ] : |
|
1760 iSortIconArray[ ESortListSenderDescIcon ]; |
|
1761 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_RECIPIENT, KFsTreeRootID, icon, EFalse ); |
1659 iModel->AppendL( itemId, EFSMailSortByRecipient ); |
1762 iModel->AppendL( itemId, EFSMailSortByRecipient ); |
1660 } |
1763 } |
1661 break; |
1764 break; |
1662 |
1765 |
1663 default: |
1766 default: |
1664 { |
1767 { |
1665 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_SENDER, KFsTreeRootID, NULL, EFalse ); |
1768 icon = iCurrentSortCriteria.iField == EFSMailSortBySender ? |
|
1769 iCurrentSortCriteria.iOrder == EFSMailAscending ? |
|
1770 iSortIconArray[ ESortListSenderDescIcon ] : |
|
1771 iSortIconArray[ ESortListSenderAscIcon ] : |
|
1772 iSortIconArray[ ESortListSenderDescIcon ]; |
|
1773 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_SENDER, KFsTreeRootID, icon, EFalse ); |
1666 iModel->AppendL( itemId, EFSMailSortBySender ); |
1774 iModel->AppendL( itemId, EFSMailSortBySender ); |
1667 } |
1775 } |
1668 break; |
1776 break; |
1669 } |
1777 } |
1670 |
1778 |
1671 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_SUBJECT, KFsTreeRootID, NULL, EFalse ); |
1779 icon = iCurrentSortCriteria.iField == EFSMailSortBySubject ? |
|
1780 iCurrentSortCriteria.iOrder == EFSMailAscending ? |
|
1781 iSortIconArray[ ESortListSubjectDescIcon ] : |
|
1782 iSortIconArray[ ESortListSubjectAscIcon ] : |
|
1783 iSortIconArray[ ESortListSubjectDescIcon ]; |
|
1784 |
|
1785 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_SUBJECT, KFsTreeRootID, icon, EFalse ); |
1672 iModel->AppendL( itemId, EFSMailSortBySubject ); |
1786 iModel->AppendL( itemId, EFSMailSortBySubject ); |
1673 |
1787 |
1674 if ( TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() ) ) |
1788 if ( TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() ) ) |
1675 { |
1789 { |
1676 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_FLAG, KFsTreeRootID, NULL, EFalse ); |
1790 icon = iCurrentSortCriteria.iField == EFSMailSortByFlagStatus ? |
|
1791 iCurrentSortCriteria.iOrder == EFSMailAscending ? |
|
1792 iSortIconArray[ ESortListFollowDescIcon ] : |
|
1793 iSortIconArray[ ESortListFollowAscIcon ] : |
|
1794 iSortIconArray[ ESortListFollowDescIcon ]; |
|
1795 |
|
1796 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_FLAG, KFsTreeRootID, icon, EFalse ); |
1677 iModel->AppendL( itemId, EFSMailSortByFlagStatus ); |
1797 iModel->AppendL( itemId, EFSMailSortByFlagStatus ); |
1678 } |
1798 } |
1679 |
1799 |
1680 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_PRIORITY, KFsTreeRootID, NULL, EFalse ); |
1800 icon = iCurrentSortCriteria.iField == EFSMailSortByPriority ? |
|
1801 iCurrentSortCriteria.iOrder == EFSMailAscending ? |
|
1802 iSortIconArray[ ESortListPriorityDescIcon ] : |
|
1803 iSortIconArray[ ESortListPriorityAscIcon ] : |
|
1804 iSortIconArray[ ESortListPriorityDescIcon ]; |
|
1805 |
|
1806 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_PRIORITY, KFsTreeRootID, icon, EFalse ); |
1681 iModel->AppendL( itemId, EFSMailSortByPriority ); |
1807 iModel->AppendL( itemId, EFSMailSortByPriority ); |
1682 |
1808 |
1683 if ( iCurrentFolderType != EFSSentFolder && |
1809 if ( iCurrentFolderType != EFSSentFolder && |
1684 iCurrentFolderType != EFSDraftsFolder && |
1810 iCurrentFolderType != EFSDraftsFolder && |
1685 iCurrentFolderType != EFSOutbox ) |
1811 iCurrentFolderType != EFSOutbox ) |
1686 { |
1812 { |
1687 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_UNREAD, KFsTreeRootID, NULL, EFalse ); |
1813 icon = iCurrentSortCriteria.iField == EFSMailSortByUnread ? |
|
1814 iCurrentSortCriteria.iOrder == EFSMailAscending ? |
|
1815 iSortIconArray[ ESortListUnreadDescIcon ] : |
|
1816 iSortIconArray[ ESortListUnreadAscIcon ] : |
|
1817 iSortIconArray[ ESortListUnreadDescIcon ]; |
|
1818 |
|
1819 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_UNREAD, KFsTreeRootID, icon, EFalse ); |
1688 iModel->AppendL( itemId, EFSMailSortByUnread ); |
1820 iModel->AppendL( itemId, EFSMailSortByUnread ); |
1689 } |
1821 } |
1690 |
1822 |
1691 // Allow scroll bar refresh only for the last item |
1823 // Allow scroll bar refresh only for the last item |
1692 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_ATTACHMENT, KFsTreeRootID, NULL, ETrue ); |
1824 icon = iCurrentSortCriteria.iField == EFSMailSortByAttachment ? |
|
1825 iCurrentSortCriteria.iOrder == EFSMailAscending ? |
|
1826 iSortIconArray[ ESortListAttachmentDescIcon ] : |
|
1827 iSortIconArray[ ESortListAttachmentAscIcon ] : |
|
1828 iSortIconArray[ ESortListAttachmentDescIcon ]; |
|
1829 |
|
1830 itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_ATTACHMENT, KFsTreeRootID, icon, ETrue ); |
1693 iModel->AppendL( itemId, EFSMailSortByAttachment ); |
1831 iModel->AppendL( itemId, EFSMailSortByAttachment ); |
1694 } |
1832 } |
1695 |
1833 |
1696 // --------------------------------------------------------------------------- |
1834 // --------------------------------------------------------------------------- |
1697 // Recursive function to get the folder's subfolder data |
1835 // Recursive function to get the folder's subfolder data |
1981 FUNC_LOG; |
2119 FUNC_LOG; |
1982 RPointerArray<CFSMailBox> mailboxes; |
2120 RPointerArray<CFSMailBox> mailboxes; |
1983 CleanupResetAndDestroyClosePushL( mailboxes ); |
2121 CleanupResetAndDestroyClosePushL( mailboxes ); |
1984 TFSMailMsgId id; |
2122 TFSMailMsgId id; |
1985 iAppUi.GetMailClient()->ListMailBoxes( id, mailboxes ); |
2123 iAppUi.GetMailClient()->ListMailBoxes( id, mailboxes ); |
1986 |
2124 |
1987 TInt count = mailboxes.Count(); |
2125 TInt count = mailboxes.Count(); |
1988 |
2126 |
1989 while( mailboxes.Count() > 0 ) |
2127 while( mailboxes.Count() > 0 ) |
1990 { |
2128 { |
1991 if( !( mailboxes[0]->GetId() == iAppUi.GetActiveMailboxId() ) ) |
2129 if( !( mailboxes[0]->GetId() == iAppUi.GetActiveMailboxId() ) ) |
1992 { |
2130 { |
1993 MFSMailBrandManager& brandManager = iAppUi.GetMailClient()->GetBrandManagerL(); |
2131 MFSMailBrandManager& brandManager = iAppUi.GetMailClient()->GetBrandManagerL(); |
1994 |
2132 |
1995 CAlfTexture* mailBoxTexture; |
2133 CAlfTexture* mailBoxTexture; |
1996 CGulIcon* mailboxIcon( NULL ); |
2134 CGulIcon* mailboxIcon( NULL ); |
1997 TRAPD( err, mailboxIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailboxes[0]->GetId() ) ); |
2135 TRAPD( err, mailboxIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailboxes[0]->GetId() ) ); |
1998 if ( err == KErrNone && mailboxIcon ) |
2136 if ( err == KErrNone && mailboxIcon ) |
1999 { |
2137 { |
2000 CleanupStack::PushL( mailboxIcon ); |
2138 CleanupStack::PushL( mailboxIcon ); |
2001 AknIconUtils::SetSize(mailboxIcon->Bitmap(), iListIconSize); |
2139 AknIconUtils::SetSize(mailboxIcon->Bitmap(), iListIconSize); |
2002 AknIconUtils::SetSize(mailboxIcon->Mask(), iListIconSize); |
2140 AknIconUtils::SetSize(mailboxIcon->Mask(), iListIconSize); |
2003 |
2141 |
2004 // Create texture into TextureManager, If not already existing |
2142 // Create texture into TextureManager, If not already existing |
2005 iAppUi.FsTextureManager()->CreateBrandedMailboxTexture( mailboxIcon, |
2143 iAppUi.FsTextureManager()->CreateBrandedMailboxTexture( mailboxIcon, |
2006 mailboxes[0]->GetId().PluginId(), |
2144 mailboxes[0]->GetId().PluginId(), |
2007 mailboxes[0]->GetId().Id(), |
2145 mailboxes[0]->GetId().Id(), |
2008 iListIconSize); |
2146 iListIconSize); |
2009 // Get branded mailbox icon |
2147 // Get branded mailbox icon |
2010 mailBoxTexture = &iAppUi.FsTextureManager()->TextureByMailboxIdL( mailboxes[0]->GetId().PluginId(), |
2148 mailBoxTexture = &iAppUi.FsTextureManager()->TextureByMailboxIdL( mailboxes[0]->GetId().PluginId(), |
2011 mailboxes[0]->GetId().Id(), |
2149 mailboxes[0]->GetId().Id(), |
2012 iListIconSize); |
2150 iListIconSize); |
2013 |
2151 |
2014 CleanupStack::PopAndDestroy( mailboxIcon ); |
2152 CleanupStack::PopAndDestroy( mailboxIcon ); |
2015 } |
2153 } |
2016 else |
2154 else |
2017 { |
2155 { |
2018 mailBoxTexture = iIconArray[EFolderListIconEmailAccount]; |
2156 mailBoxTexture = iIconArray[EFolderListIconEmailAccount]; |
2062 FUNC_LOG; |
2200 FUNC_LOG; |
2063 CFsSeparatorData* data = CFsSeparatorData::NewL(); |
2201 CFsSeparatorData* data = CFsSeparatorData::NewL(); |
2064 |
2202 |
2065 CFsSeparatorVisualizer* visualizer( NULL ); |
2203 CFsSeparatorVisualizer* visualizer( NULL ); |
2066 visualizer = CFsSeparatorVisualizer::NewL(*iTreeList->TreeControl()); |
2204 visualizer = CFsSeparatorVisualizer::NewL(*iTreeList->TreeControl()); |
2067 |
2205 |
2068 // We use the default size of the separator, but we need to save it |
2206 // We use the default size of the separator, but we need to save it |
2069 // here to have it available later when calculating the list height |
2207 // here to have it available later when calculating the list height |
2070 iListSeparatorHeight = visualizer->Size().iHeight; |
2208 iListSeparatorHeight = visualizer->Size().iHeight; |
2071 |
2209 |
2072 // This should never be the last item in the list, so disable the refresh |
2210 // This should never be the last item in the list, so disable the refresh |
2073 iTreeList->InsertItemL( *data, *visualizer, KFsTreeRootID, KErrNotFound, EFalse); |
2211 iTreeList->InsertItemL( *data, *visualizer, KFsTreeRootID, KErrNotFound, EFalse); |
2074 |
2212 |
2075 iModel->IncreaseSeparatorCount(); |
2213 iModel->IncreaseSeparatorCount(); |
2076 } |
2214 } |
2077 |
2215 |
2078 // --------------------------------------------------------------------------- |
2216 // --------------------------------------------------------------------------- |
2079 // Append separator between active mailbox's folders and other mailboxes |
2217 // Append separator between active mailbox's folders and other mailboxes |
2112 TFsTreeItemId CFSEmailUiFolderListVisualiser::AppendNodeToListL( TDesC* aItemData, TFsTreeItemId aParentNode, CAlfTexture* aIcon, TUint aUnreadCnt ) |
2250 TFsTreeItemId CFSEmailUiFolderListVisualiser::AppendNodeToListL( TDesC* aItemData, TFsTreeItemId aParentNode, CAlfTexture* aIcon, TUint aUnreadCnt ) |
2113 { |
2251 { |
2114 FUNC_LOG; |
2252 FUNC_LOG; |
2115 CFsTreePlainOneLineNodeData* plainItemData; |
2253 CFsTreePlainOneLineNodeData* plainItemData; |
2116 CFsTreePlainOneLineNodeVisualizer* plainNodeVisualizer; |
2254 CFsTreePlainOneLineNodeVisualizer* plainNodeVisualizer; |
2117 |
2255 |
2118 HBufC* itemDispName = HBufC::NewLC(aItemData->Length() + KFmtUnRdCntMaxLength); |
2256 HBufC* itemDispName = HBufC::NewLC(aItemData->Length() + KFmtUnRdCntMaxLength); |
2119 itemDispName->Des().Copy(*aItemData); |
2257 itemDispName->Des().Copy(*aItemData); |
2120 if( aUnreadCnt > 0 ) |
2258 if( aUnreadCnt > 0 ) |
2121 { |
2259 { |
2122 itemDispName->Des().AppendFormat(KFormatUnreadCnt, aUnreadCnt); |
2260 itemDispName->Des().AppendFormat(KFormatUnreadCnt, aUnreadCnt); |
2123 } |
2261 } |
2124 CreatePlainNodeLC2( itemDispName, plainItemData, plainNodeVisualizer, aIcon ); |
2262 CreatePlainNodeLC2( itemDispName, plainItemData, plainNodeVisualizer, aIcon ); |
2125 |
2263 |
2126 // We assume that node can never be the last item to be drawn, there will |
2264 // We assume that node can never be the last item to be drawn, there will |
2127 // always be leaf folder under it. So we can always deny scroll bar update. |
2265 // always be leaf folder under it. So we can always deny scroll bar update. |
2128 TFsTreeItemId nodeId = iTreeList->InsertNodeL( *plainItemData, *plainNodeVisualizer, aParentNode, KErrNotFound, EFalse); |
2266 TFsTreeItemId nodeId = iTreeList->InsertNodeL( *plainItemData, *plainNodeVisualizer, aParentNode, KErrNotFound, EFalse); |
2129 CleanupStack::Pop( 2 ); // plainItemData & plainNodeVisualizer |
2267 CleanupStack::Pop( 2 ); // plainItemData & plainNodeVisualizer |
2130 CleanupStack::PopAndDestroy( itemDispName ); |
2268 CleanupStack::PopAndDestroy( itemDispName ); |
2159 |
2297 |
2160 // --------------------------------------------------------------------------- |
2298 // --------------------------------------------------------------------------- |
2161 // Append leaf to list |
2299 // Append leaf to list |
2162 // --------------------------------------------------------------------------- |
2300 // --------------------------------------------------------------------------- |
2163 // |
2301 // |
2164 TFsTreeItemId CFSEmailUiFolderListVisualiser::AppendItemToListL( TDesC* aItemData, |
2302 TFsTreeItemId CFSEmailUiFolderListVisualiser::AppendItemToListL( TDesC* aItemData, |
2165 TFsTreeItemId aParentNode, |
2303 TFsTreeItemId aParentNode, |
2166 CAlfTexture* aIcon, |
2304 CAlfTexture* aIcon, |
2167 TBool aAllowRefresh, |
2305 TBool aAllowRefresh, |
2168 TUint aUnreadCnt) |
2306 TUint aUnreadCnt) |
2169 { |
2307 { |
2170 FUNC_LOG; |
2308 FUNC_LOG; |
2171 CFsTreePlainOneLineItemData* plainItemData; |
2309 CFsTreePlainOneLineItemData* plainItemData; |
2172 CFsTreePlainOneLineItemVisualizer* plainItemVisualizer; |
2310 CFsTreePlainOneLineItemVisualizer* plainItemVisualizer; |
2173 |
2311 |
2174 HBufC* itemDispName = HBufC::NewLC(aItemData->Length() + KFmtUnRdCntMaxLength); |
2312 HBufC* itemDispName = HBufC::NewLC(aItemData->Length() + KFmtUnRdCntMaxLength); |
2175 itemDispName->Des().Copy(*aItemData); |
2313 itemDispName->Des().Copy(*aItemData); |
2176 if( aUnreadCnt > 0 ) |
2314 if( aUnreadCnt > 0 ) |
2177 { |
2315 { |
2178 itemDispName->Des().AppendFormat(KFormatUnreadCnt, aUnreadCnt); |
2316 itemDispName->Des().AppendFormat(KFormatUnreadCnt, aUnreadCnt); |
2179 } |
2317 } |
2180 CreatePlainItemLC2( itemDispName, plainItemData, plainItemVisualizer, aIcon ); |
2318 CreatePlainItemLC2( itemDispName, plainItemData, plainItemVisualizer, aIcon ); |
2181 |
2319 |
2182 |
2320 |
2183 TFsTreeItemId itemId = iTreeList->InsertItemL( *plainItemData, *plainItemVisualizer, aParentNode, KErrNotFound, aAllowRefresh); |
2321 TFsTreeItemId itemId = iTreeList->InsertItemL( *plainItemData, *plainItemVisualizer, aParentNode, KErrNotFound, aAllowRefresh); |
2184 CleanupStack::Pop( 2 ); // plainItemData & plainItemVisualizer |
2322 CleanupStack::Pop( 2 ); // plainItemData & plainItemVisualizer |
2185 CleanupStack::PopAndDestroy( itemDispName ); |
2323 CleanupStack::PopAndDestroy( itemDispName ); |
2186 if( itemId != KFsTreeNoneID ) |
2324 if( itemId != KFsTreeNoneID ) |
2187 { |
2325 { |
2188 iListItemVisulizers.Append( plainItemVisualizer ); |
2326 iListItemVisulizers.Append( plainItemVisualizer ); |
2189 } |
2327 } |
2190 |
2328 |
2191 return itemId; |
2329 return itemId; |
2192 } |
2330 } |
2193 |
2331 |
2194 // --------------------------------------------------------------------------- |
2332 // --------------------------------------------------------------------------- |
2195 // Create plain leaf item |
2333 // Create plain leaf item |
2235 CAlfTexture* aIcon ) |
2374 CAlfTexture* aIcon ) |
2236 { |
2375 { |
2237 FUNC_LOG; |
2376 FUNC_LOG; |
2238 aItemData = CFsTreePlainOneLineNodeData::NewL(); |
2377 aItemData = CFsTreePlainOneLineNodeData::NewL(); |
2239 CleanupStack::PushL( aItemData ); |
2378 CleanupStack::PushL( aItemData ); |
2240 |
2379 |
2241 aItemData->SetDataL( *aItemDataBuff ); |
2380 aItemData->SetDataL( *aItemDataBuff ); |
2242 if( aIcon ) |
2381 if( aIcon ) |
2243 { |
2382 { |
2244 aItemData->SetIconExpanded( *aIcon ); |
2383 aItemData->SetIconExpanded( *aIcon ); |
2245 aItemData->SetIconCollapsed( *aIcon ); |
2384 aItemData->SetIconCollapsed( *aIcon ); |
2246 } |
2385 } |
2247 |
2386 |
2248 aNodeVisualizer = CFsTreePlainOneLineNodeVisualizer::NewL( *iTreeList->TreeControl() ); |
2387 aNodeVisualizer = CFsTreePlainOneLineNodeVisualizer::NewL( *iTreeList->TreeControl() ); |
2249 CleanupStack::PushL( aNodeVisualizer ); |
2388 CleanupStack::PushL( aNodeVisualizer ); |
2250 |
2389 |
2251 // Set folder view specific layouts to be used |
2390 // Set folder view specific layouts to be used |
2252 if ( iFullScreen ) |
2391 if ( iFullScreen ) |
2253 { |
2392 { |
2254 aNodeVisualizer->SetLayoutHints( CFsTreeItemVisualizerBase::EFolderLayout ); |
2393 aNodeVisualizer->SetLayoutHints( CFsTreeItemVisualizerBase::EFolderLayout ); |
2255 } |
2394 } |
2256 else |
2395 else |
2257 { |
2396 { |
2258 aNodeVisualizer->SetLayoutHints( CFsTreeItemVisualizerBase::EPopupLayout ); |
2397 aNodeVisualizer->SetLayoutHints( CFsTreeItemVisualizerBase::EPopupLayout ); |
2259 } |
2398 } |
2260 SetItemVisualizerPropertiesL( aNodeVisualizer ); |
2399 SetItemVisualizerPropertiesL( aNodeVisualizer ); |
2261 } |
2400 } |
2262 |
2401 |
2263 void CFSEmailUiFolderListVisualiser::SetItemVisualizerPropertiesL( MFsTreeItemVisualizer* aItemVisualizer ) |
2402 void CFSEmailUiFolderListVisualiser::SetItemVisualizerPropertiesL( MFsTreeItemVisualizer* aItemVisualizer ) |
2264 { |
2403 { |
2265 FUNC_LOG; |
2404 FUNC_LOG; |
2266 aItemVisualizer->SetFlags(aItemVisualizer->Flags() & ~KFsTreeListItemManagedLayout); |
2405 aItemVisualizer->SetFlags(aItemVisualizer->Flags() & ~KFsTreeListItemManagedLayout); |
2267 |
2406 |
2523 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListMoreFoldersTexture ) ); // EFolderListIconMoreFolders |
2665 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListMoreFoldersTexture ) ); // EFolderListIconMoreFolders |
2524 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListEmailAccountTexture ) ); // EFolderListIconEmailAccount |
2666 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListEmailAccountTexture ) ); // EFolderListIconEmailAccount |
2525 } |
2667 } |
2526 else |
2668 else |
2527 { |
2669 { |
2528 // NOTE: Must be appended same order as are in TFsEmailUiFolderListIcons! |
2670 // NOTE: Must be appended same order as are in TFsEmailUiFolderListIcons! |
2529 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListInboxTexturePopup ) ); // EFolderListIconInbox |
2671 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListInboxTexturePopup ) ); // EFolderListIconInbox |
2530 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListInboxSubfoldersTexturePopup ) ); // EFolderListIconInboxSubfolders |
2672 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListInboxSubfoldersTexturePopup ) ); // EFolderListIconInboxSubfolders |
2531 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListOutboxTexturePopup ) ); // EFolderListIconOutbox |
2673 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListOutboxTexturePopup ) ); // EFolderListIconOutbox |
2532 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListDraftsTexturePopup ) ); // EFolderListIconDrafts |
2674 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListDraftsTexturePopup ) ); // EFolderListIconDrafts |
2533 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListSentTexturePopup ) ); // EFolderListIconSent |
2675 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListSentTexturePopup ) ); // EFolderListIconSent |
2534 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListDeletedItemsTexturePopup ) ); // EFolderListIconDeleted |
2676 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListDeletedItemsTexturePopup ) ); // EFolderListIconDeleted |
2535 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListServerFoldersTexturePopup ) ); // EFolderListIconServerFolders |
2677 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListServerFoldersTexturePopup ) ); // EFolderListIconServerFolders |
2536 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListMoreFoldersTexturePopup ) ); // EFolderListIconMoreFolders |
2678 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListMoreFoldersTexturePopup ) ); // EFolderListIconMoreFolders |
2537 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListEmailAccountTexturePopup ) ); // EFolderListIconEmailAccount |
2679 iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListEmailAccountTexturePopup ) ); // EFolderListIconEmailAccount |
|
2680 |
|
2681 // NOTE: Must be appended same order as are in TFsEmailUiSortListIcons! |
|
2682 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListAttachmentAscTexture ) ); // ESortListAttachmentAscIcon |
|
2683 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListAttachmentDescTexture ) ); // ESortListAttachmentDescIcon |
|
2684 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListDateAscTexture ) ); // ESortListDateAscIcon |
|
2685 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListDateDescTexture ) ); // ESortListDateDescIcon |
|
2686 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListFollowAscTexture ) ); // ESortListFollowAscIcon |
|
2687 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListFollowDescTexture ) ); // ESortListFollowDescIcon |
|
2688 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListPriorityAscTexture ) ); // ESortListPriorityAscIcon |
|
2689 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListPriorityDescTexture ) ); // ESortListPriorityDescIcon |
|
2690 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSenderAscTexture ) ); // ESortListSenderAscIcon |
|
2691 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSenderDescTexture ) ); // ESortListSenderDescIcon |
|
2692 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSubjectAscTexture ) ); // ESortListSubjectAscIcon |
|
2693 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSubjectDescTexture ) ); // ESortListSubjectDescIcon |
|
2694 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListUnreadAscTexture ) ); // ESortListUnreadAscIcon |
|
2695 iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListUnreadDescTexture ) ); // ESortListUnreadDescIcon |
2538 } |
2696 } |
2539 } |
2697 } |
2540 |
2698 |
2541 void CFSEmailUiFolderListVisualiser::ResizeListIcons() |
2699 void CFSEmailUiFolderListVisualiser::ResizeListIcons() |
2542 { |
2700 { |
2584 // |
2749 // |
2585 void CFSEmailUiFolderListVisualiser::AdaptScreenRectToListContent() |
2750 void CFSEmailUiFolderListVisualiser::AdaptScreenRectToListContent() |
2586 { |
2751 { |
2587 FUNC_LOG; |
2752 FUNC_LOG; |
2588 const TInt popupHeight( iScreenRect.Height() ); |
2753 const TInt popupHeight( iScreenRect.Height() ); |
2589 const TInt separatorHeight( iListSeparatorHeight * |
2754 const TInt separatorHeight( iListSeparatorHeight * |
2590 iModel->SeparatorCount() ); |
2755 iModel->SeparatorCount() ); |
2591 const TInt itemCount( iTreeList->Count() - iModel->SeparatorCount() ); |
2756 const TInt itemCount( iTreeList->Count() - iModel->SeparatorCount() ); |
2592 TInt visibleItemCount( ( popupHeight - separatorHeight ) / |
2757 TInt visibleItemCount( ( popupHeight - separatorHeight ) / |
2593 iListItemHeight ); |
2758 iListItemHeight ); |
2594 visibleItemCount = Min( visibleItemCount, itemCount ); |
2759 visibleItemCount = Min( visibleItemCount, itemCount ); |
2595 iScreenRect.SetHeight( visibleItemCount * iListItemHeight + |
2760 iScreenRect.SetHeight( visibleItemCount * iListItemHeight + |
2596 separatorHeight + |
2761 separatorHeight + |
2597 iAppUi.LayoutHandler()->DropDownMenuListPadding() * 2 + |
2762 iAppUi.LayoutHandler()->DropDownMenuListPadding() * 2 + |
2598 iAppUi.LayoutHandler()->ControlBarListPadding().iY ); |
2763 iAppUi.LayoutHandler()->ControlBarListPadding().iY ); |
2599 AdjustWidthByContent( iScreenRect ); |
2764 AdjustWidthByContent( iScreenRect ); |
2600 } |
2765 } |
2601 |
2766 |
2602 // --------------------------------------------------------------------------- |
2767 // --------------------------------------------------------------------------- |
2603 // Adjusts list width according to content. |
2768 // Adjusts list width according to content. |
2604 // --------------------------------------------------------------------------- |
2769 // --------------------------------------------------------------------------- |
2605 // |
2770 // |
2606 void CFSEmailUiFolderListVisualiser::AdjustWidthByContent( TRect& aRect ) const |
2771 void CFSEmailUiFolderListVisualiser::AdjustWidthByContent( TRect& aRect ) const |
2607 { |
2772 { |
|
2773 const TRect oldButtonRect( iScreenRect ); |
2608 const TInt buttonWidth( iCtrlButtonRect.Width() ); |
2774 const TInt buttonWidth( iCtrlButtonRect.Width() ); |
2609 const TInt currentWidth( aRect.Width() ); |
2775 const TInt currentWidth( aRect.Width() ); |
2610 |
2776 |
2611 // only do adjusting if the buttonWidth is smaller than current popup width |
2777 // only do adjusting if the buttonWidth is smaller than current popup width |
2612 if ( buttonWidth < currentWidth ) |
2778 if ( buttonWidth < currentWidth ) |
2613 { |
2779 { |
|
2780 TBool landscape( Layout_Meta_Data::IsLandscapeOrientation() ); |
2614 TAknLayoutRect scrollPane; |
2781 TAknLayoutRect scrollPane; |
2615 scrollPane.LayoutRect( aRect, |
2782 scrollPane.LayoutRect( aRect, |
2616 AknLayoutScalable_Apps::sp_fs_scroll_pane_cp01( 6 ) ); |
2783 AknLayoutScalable_Apps::sp_fs_scroll_pane_cp01( 6 ) ); |
2617 const TInt scrollPaneWidth( scrollPane.Rect().Width() ); |
2784 const TInt scrollPaneWidth( scrollPane.Rect().Width() ); |
2618 |
2785 |
2619 TAknLayoutText textLayout; |
2786 TAknLayoutText textLayout; |
2620 textLayout.LayoutText( aRect, |
2787 textLayout.LayoutText( aRect, |
2621 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 0 ) ); |
2788 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 0 ) ); |
2622 const CFont& font( *(textLayout.Font()) ); |
2789 const CFont& font( *(textLayout.Font()) ); |
2623 const TInt padding( |
2790 const TInt padding( |
2873 TFsTreeItemId focusedId = iTreeList->FocusedItem(); |
3046 TFsTreeItemId focusedId = iTreeList->FocusedItem(); |
2874 if ( focusedId > KFsTreeRootID ) |
3047 if ( focusedId > KFsTreeRootID ) |
2875 { |
3048 { |
2876 // Get the list level |
3049 // Get the list level |
2877 TUint level = iTreeList->Level( focusedId ); |
3050 TUint level = iTreeList->Level( focusedId ); |
2878 |
3051 |
2879 // Little optimisation, handle all levels up to KListLastBasicLevel |
3052 // Little optimisation, handle all levels up to KListLastBasicLevel |
2880 // as root level because horizontal scroll amount is same for all |
3053 // as root level because horizontal scroll amount is same for all |
2881 if( level <= KListLastBasicLevel ) |
3054 if( level <= KListLastBasicLevel ) |
2882 { |
3055 { |
2883 level = KListRootLevel; |
3056 level = KListRootLevel; |
2884 } |
3057 } |
2885 |
3058 |
2886 // Recalculate the list rect only if level has changed or if |
3059 // Recalculate the list rect only if level has changed or if |
2887 // recalculation is forced by parameter (e.g. in case of |
3060 // recalculation is forced by parameter (e.g. in case of |
2888 // dynamic variant switch) |
3061 // dynamic variant switch) |
2889 if( ( level != iPreviousListLevel ) || aForceRecalculation ) |
3062 if( ( level != iPreviousListLevel ) || aForceRecalculation ) |
2890 { |
3063 { |
2891 TRect listRect = iListLayout->DisplayRectTarget(); |
3064 TRect listRect = iListLayout->DisplayRectTarget(); |
2892 |
3065 |
2893 // Calulate list rect by taking x-coordinates from iScreenRect |
3066 // Calulate list rect by taking x-coordinates from iScreenRect |
2894 // and y-coordinates from list layouts target rect (to take |
3067 // and y-coordinates from list layouts target rect (to take |
2895 // into account the list header) |
3068 // into account the list header) |
2896 listRect.SetRect( iScreenRect.iTl.iX, listRect.iTl.iY, |
3069 listRect.SetRect( iScreenRect.iTl.iX, listRect.iTl.iY, |
2897 iScreenRect.iBr.iX, listRect.iBr.iY ); |
3070 iScreenRect.iBr.iX, listRect.iBr.iY ); |
2898 |
3071 |
2899 if( level > KListLastBasicLevel ) |
3072 if( level > KListLastBasicLevel ) |
2900 { |
3073 { |
2901 // Calculate rect according to current level |
3074 // Calculate rect according to current level |
2902 TInt rectChange = (level - KListLastBasicLevel) * iTreeList->Indentation(); |
3075 TInt rectChange = (level - KListLastBasicLevel) * iTreeList->Indentation(); |
2903 listRect.SetWidth( iScreenRect.Width() + rectChange ); |
3076 listRect.SetWidth( iScreenRect.Width() + rectChange ); |
2904 listRect.Move( -rectChange, 0 ); |
3077 listRect.Move( -rectChange, 0 ); |
2905 } |
3078 } |
2906 |
3079 |
2907 // Set the list rect only if it has changed from previous |
3080 // Set the list rect only if it has changed from previous |
2908 // (because list refresh causes a little twitch) |
3081 // (because list refresh causes a little twitch) |
2909 if( listRect != iPreviousListRect ) |
3082 if( listRect != iPreviousListRect ) |
2910 { |
3083 { |
2911 iListLayout->SetRect( listRect, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
3084 iListLayout->SetRect( listRect, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); |
2912 iTreeVisualizer->RefreshListViewL(); |
3085 iTreeVisualizer->RefreshListViewL(); |
2913 iPreviousListRect = listRect; |
3086 iPreviousListRect = listRect; |
2914 } |
3087 } |
2915 |
3088 |
2916 iPreviousListLevel = level; |
3089 iPreviousListLevel = level; |
2917 } |
3090 } |
2918 } |
3091 } |
2919 } |
3092 } |
2920 } |
3093 } |
2987 // |
3170 // |
2988 void CFSEmailUiFolderListVisualiser::HandleMailBoxEventL( TFSMailEvent aEvent, |
3171 void CFSEmailUiFolderListVisualiser::HandleMailBoxEventL( TFSMailEvent aEvent, |
2989 TFSMailMsgId aMailboxId, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ ) |
3172 TFSMailMsgId aMailboxId, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ ) |
2990 { |
3173 { |
2991 FUNC_LOG; |
3174 FUNC_LOG; |
2992 |
3175 |
2993 // Handle the event |
3176 // Handle the event |
2994 if ( iMoveOrCopyInitiated && |
3177 if ( iMoveOrCopyInitiated && |
2995 iFirstStartCompleted && |
3178 iFirstStartCompleted && |
2996 aMailboxId == iAppUi.GetActiveMailboxId() && |
3179 aMailboxId == iAppUi.GetActiveMailboxId() && |
2997 iAppUi.CurrentActiveView() == this ) |
3180 iAppUi.CurrentActiveView() == this ) |
2998 { |
3181 { |
2999 if ( aEvent == TFSEventMailboxOnline ) |
3182 if ( aEvent == TFSEventMailboxOnline ) |
3000 { |
3183 { |
3001 if( iWaitingToGoOnline ) |
3184 if( iWaitingToGoOnline ) |
3002 { |
3185 { |
3003 PrepareFolderListL(); |
3186 PrepareFolderListL(); |
3004 PopulateFolderListL(); |
3187 PopulateFolderListL(); |
3005 |
3188 |
3006 if ( iModel->Count() ) |
3189 if ( iModel->Count() ) |
3007 { |
3190 { |
3008 SetFocusToLatestMovedFolderL(); |
3191 SetFocusToLatestMovedFolderL(); |
3009 } |
3192 } |
|
3193 iTreeList->SetFocusedL( ETrue ); |
|
3194 iWaitingToGoOnline = EFalse; |
3010 } |
3195 } |
3011 } |
3196 } |
3012 else if ( aEvent == TFSEventMailboxOffline ) |
3197 else if ( aEvent == TFSEventMailboxOffline ) |
3013 { |
3198 { |
3014 // Empty the list when disconnected if connection is needed for |
3199 // Empty the list when disconnected if connection is needed for |
3020 } |
3205 } |
3021 } |
3206 } |
3022 } |
3207 } |
3023 |
3208 |
3024 // --------------------------------------------------------------------------- |
3209 // --------------------------------------------------------------------------- |
|
3210 // |
|
3211 // --------------------------------------------------------------------------- |
|
3212 // |
|
3213 void CFSEmailUiFolderListVisualiser::FocusVisibilityChange( TBool aVisible ) |
|
3214 { |
|
3215 FUNC_LOG; |
|
3216 CFsEmailUiViewBase::FocusVisibilityChange( aVisible ); |
|
3217 iTreeVisualizer->SetFocusVisibility( aVisible ); |
|
3218 } |
|
3219 |
|
3220 // --------------------------------------------------------------------------- |
3025 // CbaButtonPressed |
3221 // CbaButtonPressed |
3026 // Check if aPosition is on CBA touch area |
3222 // Check if aPosition is on CBA touch area |
3027 // --------------------------------------------------------------------------- |
3223 // --------------------------------------------------------------------------- |
3028 // |
3224 // |
3029 TBool CFSEmailUiFolderListVisualiser::CbaButtonPressed( TPoint aPosition ) |
3225 TBool CFSEmailUiFolderListVisualiser::CbaButtonPressed( TPoint aPosition ) |
3030 { |
3226 { |
3031 TBool cbaPressed( EFalse ); |
3227 TBool cbaPressed( EFalse ); |
3032 |
3228 |
3033 TRect leftCbaRect = TRect(); |
3229 TRect leftCbaRect = TRect(); |
3034 TRect rightCbaRect = TRect(); |
3230 TRect rightCbaRect = TRect(); |
3035 GetCbaRects( leftCbaRect, rightCbaRect ); |
3231 GetCbaRects( leftCbaRect, rightCbaRect ); |
3036 if ( leftCbaRect.Contains( aPosition ) || |
3232 if ( leftCbaRect.Contains( aPosition ) || |
3037 rightCbaRect.Contains( aPosition )) |
3233 rightCbaRect.Contains( aPosition )) |
3047 // Resolve CBA touch areas from layouts |
3243 // Resolve CBA touch areas from layouts |
3048 // --------------------------------------------------------------------------- |
3244 // --------------------------------------------------------------------------- |
3049 // |
3245 // |
3050 void CFSEmailUiFolderListVisualiser::GetCbaRects( TRect& aLeftCbaRect, TRect& aRightCbaRect ) |
3246 void CFSEmailUiFolderListVisualiser::GetCbaRects( TRect& aLeftCbaRect, TRect& aRightCbaRect ) |
3051 { |
3247 { |
3052 TBool rightPaneActive( IsAreaSideRightPaneActive() ); |
3248 TBool rightPaneActive( IsAreaSideRightPaneActive() ); |
3053 TBool bskLandscape( Layout_Meta_Data::IsLandscapeOrientation() && |
3249 TBool bskLandscape( Layout_Meta_Data::IsLandscapeOrientation() && |
3054 !rightPaneActive ); |
3250 !rightPaneActive ); |
3055 TRect screen; |
3251 TRect screen; |
3056 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); |
3252 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); |
3057 if ( rightPaneActive ) |
3253 if ( rightPaneActive ) |
3058 { |
3254 { |
3059 TAknWindowComponentLayout rightAreaLayout( |
3255 TAknWindowComponentLayout rightAreaLayout( |
3060 AknLayoutScalable_Avkon::area_side_right_pane( 0 ) ); |
3256 AknLayoutScalable_Avkon::area_side_right_pane( 0 ) ); |
3061 |
3257 |
3062 TAknLayoutRect layoutRect; |
3258 TAknLayoutRect layoutRect; |
3063 // Read right (top in landscape) softkey layout. |
3259 // Read right (top in landscape) softkey layout. |
3064 layoutRect.LayoutRect( |
3260 layoutRect.LayoutRect( |
3065 screen, |
3261 screen, |
3066 TAknWindowComponentLayout::Compose( |
3262 TAknWindowComponentLayout::Compose( |
3067 rightAreaLayout, |
3263 rightAreaLayout, |
3068 AknLayoutScalable_Avkon::sctrl_sk_bottom_pane() ).LayoutLine() ); |
3264 AknLayoutScalable_Avkon::sctrl_sk_bottom_pane() ).LayoutLine() ); |
3069 TRect bottomSKRect( layoutRect.Rect() ); |
3265 TRect bottomSKRect( layoutRect.Rect() ); |
3070 |
3266 |
3071 // Read left (bottom in landscape) softkey layout. |
3267 // Read left (bottom in landscape) softkey layout. |
3072 layoutRect.LayoutRect( |
3268 layoutRect.LayoutRect( |
3073 screen, |
3269 screen, |
3074 TAknWindowComponentLayout::Compose( |
3270 TAknWindowComponentLayout::Compose( |
3075 rightAreaLayout, |
3271 rightAreaLayout, |
3076 AknLayoutScalable_Avkon::sctrl_sk_top_pane() ).LayoutLine() ); |
3272 AknLayoutScalable_Avkon::sctrl_sk_top_pane() ).LayoutLine() ); |