emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h
changeset 0 8466d47a6819
child 1 12c456ceeff2
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Symbian Foundation License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  FreestyleEmailUi double line list visualiser definition 
       
    15 *
       
    16 */
       
    17 
       
    18  
       
    19     
       
    20 #ifndef __FREESTYLEEMAILUI_MAILLISTVISUALISER_H__
       
    21 #define __FREESTYLEEMAILUI_MAILLISTVISUALISER_H__
       
    22 
       
    23 // SYSTEM INCLUDES
       
    24 #include <EIKMOBS.H>
       
    25 //<cmail>
       
    26 #include "fscontrolbarobserver.h"
       
    27 #include "fstreelistobserver.h"
       
    28 #include "CFSMailCommon.h"
       
    29 #include "MFSMailEventObserver.h"
       
    30 #include "fsccontactactionmenudefines.h"
       
    31 //</cmail>
       
    32 #include "FSEmailBuildFlags.h"
       
    33 
       
    34 // INTERNAL INCLUDES
       
    35 #include "FreestyleEmailUiViewBase.h"
       
    36 #include "FreestyleEmailUiListVisualiser.h"
       
    37 #include "FreestyleEmailUiConstants.h"
       
    38 #include "FreestyleEmailUiControlBarCallback.h"
       
    39 #include "FreestyleEmailUiUtilities.h"
       
    40 #include "FreestyleEmailUiContactHandlerObserver.h"
       
    41 
       
    42 // FORWARD DECLARATIONS
       
    43 class CAlfTextVisual;
       
    44 class CAlfGridLayout;
       
    45 class CFSEmailUiList;
       
    46 class CAlfImageVisual;
       
    47 class CAlfDeckLayout;
       
    48 class CAlfAnchorLayout;
       
    49 class CFSEmailUiMailListModelItem;
       
    50 class CFSEmailUiMailListModel;
       
    51 class CListModeChanger;
       
    52 class CFreestyleEmailUiTextureManager;
       
    53 class CFSMailFolder;
       
    54 class CFSMailClient;
       
    55 class CFSMailAddress;
       
    56 class CFsTreeList;
       
    57 class CFsTreeVisualizerBase;
       
    58 class MFsTreeItemData;
       
    59 class MFsTreeItemVisualizer;
       
    60 class CFreestyleEmailUiTextureManager;
       
    61 class CFreestyleEmailUiMailListControl;
       
    62 class CFreestyleEmailUiAppUi;
       
    63 class CFsControlBar;
       
    64 class CFSMailMessage;
       
    65 class CFsMailFolder;
       
    66 class CFsTreePlainOneLineNodeData;
       
    67 class CFsTreePlainOneLineNodeVisualizer;
       
    68 class MFsControlButtonInterface;
       
    69 class CPbkxContactActionMenu;
       
    70 class CMailListUpdater;
       
    71 class CMsgMovedNoteTimer;
       
    72 class CIdle;
       
    73 class CESMRIcalViewer;
       
    74 class CAknWaitDialog;
       
    75 class CDateChangeTimer;
       
    76 class CFsTreePlainTwoLineItemData;
       
    77 class CFsTreePlainTwoLineItemVisualizer;
       
    78 //<cmail>
       
    79 class CEUiEmailListTouchManager;
       
    80 //</cmail>
       
    81 class CAknStylusPopUpMenu;
       
    82 
       
    83 struct SMailListItem
       
    84 	{
       
    85 	TFsTreeItemId iListItemId;
       
    86 	MFsTreeItemData* iTreeItemData;
       
    87 	MFsTreeItemVisualizer* iTreeItemVisualiser;
       
    88 	};
       
    89 
       
    90 struct STimeDateFormats
       
    91 	{
       
    92 	TDateFormat iDateFormat;	
       
    93 	TChar iDateSeparator;
       
    94 	TTimeFormat iTimeFormat;
       
    95 	TChar iTimeSeparator;
       
    96 	TLocalePos iAmPmPosition;
       
    97 	};
       
    98 	
       
    99 enum TMailListUiControls
       
   100 	{
       
   101 	EControlBarComponent=0,
       
   102 	EMailListComponent
       
   103 	};
       
   104 
       
   105 enum TListControlType
       
   106 	{
       
   107 	EListControlTypeSingleLinePreviewOff=0,
       
   108 	EListControlTypeSingleLinePreviewOn,
       
   109 	EListControlTypeDoubleLinePreviewOff,
       
   110 	EListControlTypeDoubleLinePreviewOn
       
   111 	};
       
   112 
       
   113 enum TListControlSeparatorValue
       
   114 	{
       
   115 	EListControlSeparatorDisabled=0,
       
   116 	EListControlSeparatorEnabled
       
   117 	};
       
   118 
       
   119 // <cmail>
       
   120 class CFSEmailUiMailListVisualiser : public CFsEmailUiViewBase, 
       
   121 									 public MFsControlBarObserver, 
       
   122 									 public MFSEmailUiFolderListCallback, 
       
   123 									 public MFSEmailUiSortListCallback,
       
   124 									 public MFsTreeListObserver,
       
   125 									 public MFSEmailUiContactHandlerObserver,
       
   126 									 public MFsActionMenuPositionGiver
       
   127 // </cmail>
       
   128 	{
       
   129 friend class CMailListUpdater;
       
   130 public:
       
   131 	static CFSEmailUiMailListVisualiser* NewL(CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aMailListControlGroup);
       
   132 	static CFSEmailUiMailListVisualiser* NewLC(CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aMailListControlGroup);
       
   133     virtual ~CFSEmailUiMailListVisualiser();
       
   134     void PrepareForExit();
       
   135 
       
   136 	void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
       
   137 	// Refresh the whole list
       
   138 	void RefreshL( TFSMailMsgId* aFocusToMessage = NULL );
       
   139 	// From view 
       
   140 	TUid Id() const;	
       
   141 	// <cmail> Toolbar
       
   142 	/*void DoActivateL(const TVwsViewId& aPrevViewId,
       
   143 	                 TUid aCustomMessageId,
       
   144 	                 const TDesC8& aCustomMessage);*/
       
   145     // </cmail> Toolbar
       
   146 	TInt NewEmailsInModelL() const;
       
   147 	TInt EmailsInModelL() const;	              
       
   148 	CFSEmailUiMailListModel* Model();	
       
   149 	// Current active folder
       
   150 	TFSMailMsgId FolderId();
       
   151 	// Dynamic variant switch, called by appui
       
   152 	void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType );
       
   153 	void HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType aType );
       
   154 	// Handle foregroundevent
       
   155 	void HandleForegroundEventL();
       
   156 	// Sets softkeys
       
   157 	void SetViewSoftkeysL( TInt aResourceId );	
       
   158 	void SetMskL();
       
   159 	// Highlighted index
       
   160 	TInt HighlightedIndex() const;
       
   161 	void SetHighlightedIndexL( TInt aWantedIndex );
       
   162 	// Event handling forwarded from control
       
   163 	TBool OfferEventL( const TAlfEvent& aEvent ); 
       
   164 
       
   165     // <cmail>
       
   166 	/**
       
   167 	 * Open highlighted mail or node. 
       
   168 	 * (Touchwork: Called from touch manager)
       
   169 	 */
       
   170 	void DoHandleListItemOpenL();
       
   171 
       
   172 	/**
       
   173      * Open folderlist or shortlist.  
       
   174      * (Touchwork: Called from touch manager)
       
   175      * 
       
   176      * @param TInt button id. (shortlist or folderlist) 
       
   177      */
       
   178 	void DoHandleControlBarOpenL( TInt aControlBarButtonId );
       
   179 
       
   180     /**
       
   181      * Open action menu.   
       
   182      * (Touchwork: Called from touch manager)
       
   183      */
       
   184 	void DoHandleListItemLongTapL();
       
   185 
       
   186     /**
       
   187      * Get control which is currently focused.    
       
   188      * (Touchwork: Called from touch manager)
       
   189      * 
       
   190      * @return TInt id of control
       
   191      */
       
   192 	TInt GetFocusedControl() const; 
       
   193 
       
   194     /**
       
   195      * Set control bar as focused control.   
       
   196      * (Touchwork: Called from touch manager)
       
   197      */
       
   198 	void SetControlBarFocusedL();
       
   199 
       
   200     /**
       
   201      * Set tree list as focused control.   
       
   202      * (Touchwork: Called from touch manager)
       
   203      */
       
   204 	void SetTreeListFocusedL(); 
       
   205 
       
   206     /**
       
   207      * Helper function for disable controls to send 
       
   208      * any events.    
       
   209      * (Touchwork)
       
   210      * 
       
   211      * @param TBool state of controls. 
       
   212      */
       
   213 	void DisableMailList( TBool aValue );
       
   214 	// </cmail>
       
   215 	
       
   216 	// Command handling
       
   217 	void HandleCommandL(TInt aCommand);
       
   218 	// Read status 
       
   219 	void ChangeReadStatusOfHighlightedL( TBool aRead );
       
   220 	void ChangeReadStatusOfMarkedL( TBool aRead );
       
   221 	void ChangeReadStatusOfIndexL( TBool aRead, TInt aIndex );
       
   222 	// Delete messages 
       
   223 	void DeleteMessagesL(); 	
       
   224 	// Move to drafts
       
   225 	void MoveMessagesToDraftsL();
       
   226 	
       
   227 	// From base class MFSEmailUiFolderListCallback
       
   228 	// Handle folder list selection
       
   229 	void FolderSelectedL( TFSMailMsgId aSelectedFolderId,
       
   230 	 					 TFSEmailUiCtrlBarResponse aResponse );
       
   231 	void MailboxSelectedL( TFSMailMsgId aSelectedFolderId );
       
   232 	TRect FolderButtonRect();
       
   233 	
       
   234 	// From base class MFSEmailUiSortListCallback
       
   235 	void SortOrderChangedL( TFSMailSortField aSortField,
       
   236 	 					   TFSEmailUiCtrlBarResponse aResponse );
       
   237 	TRect SortButtonRect();
       
   238 	
       
   239 	// Navigation functions, used mainly from viewer
       
   240 	TBool IsNextMsgAvailable( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId, TFSMailMsgId& aFoundNextMsgFolder ) const;
       
   241 	TBool IsPreviousMsgAvailable( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundPreviousMsgId, TFSMailMsgId& aFoundPrevMsgFolder ) const;
       
   242 	TInt MoveToNextMsgL( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId );
       
   243 	TInt MoveToPreviousMsgL( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundPreviousMsgId );
       
   244 
       
   245 	/**
       
   246      * Sets the manual mailbox syncronisation flag if the user chose   
       
   247      * to synchorise mail box from the menu
       
   248      */
       
   249     void ManualMailBoxSync( TBool aManualMailBoxSync );
       
   250     
       
   251     // Returns ETrue if mailbox is syncronizing and EFalse if not
       
   252     TBool GetLatestSyncState();
       
   253 
       
   254 	void GetMarkedMessagesL( RArray<TFSMailMsgId>& aMessageIDs ) const;
       
   255 	CFsTreeList& GetMailList();
       
   256 	// Get message ID corresponding given list ID. If the list ID is for a node, its first child message ID is returned.
       
   257 	TFSMailMsgId MsgIdFromListId( TFsTreeItemId aListId ) const;
       
   258 
       
   259     void HandleMailBoxEventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox,
       
   260         TAny* aParam1, TAny* aParam2, TAny* aParam3 );
       
   261 
       
   262 // from base class MFsTreeListObserver
       
   263 
       
   264     /** Handles tree list events. */
       
   265     // <cmail> Touch
       
   266     void TreeListEventL( const TFsTreeListEvent aEvent, const TFsTreeItemId aId );
       
   267     // </cmail>
       
   268 
       
   269 // from base class MFSEmailUiContactHandlerObserver
       
   270 
       
   271     /** Handles completed contact handler event. */
       
   272     void OperationCompleteL( TContactHandlerCmd aCmd,
       
   273         const RPointerArray<CFSEmailUiClsItem>& aContacts );
       
   274     void OperationErrorL( TContactHandlerCmd, TInt aError );
       
   275 
       
   276     /**
       
   277     * Called when CDateChangeTimer completes. This happens when either when date
       
   278     * changes or when user alters the system time. Redraws the list to ensure that
       
   279     * time stamp texts in emails and nodes are up-to-date.
       
   280     */ 
       
   281     void NotifyDateChangedL();
       
   282 // <cmail>
       
   283     TPoint ActionMenuPosition();
       
   284 // </cmail>
       
   285   
       
   286 private: // from
       
   287     
       
   288     /**
       
   289      * @see CFsEmailUiViewBase::ChildDoActivateL
       
   290      */
       
   291     void ChildDoActivateL( const TVwsViewId& aPrevViewId,
       
   292             TUid aCustomMessageId,
       
   293             const TDesC8& aCustomMessage );
       
   294     void ChildDoDeactivate();
       
   295     void GetParentLayoutsL( RPointerArray<CAlfVisual>& aLayoutArray ) const;
       
   296     /**
       
   297 	 * @see CFsEmailUiViewBase::SetStatusBarLayout
       
   298 	 */ 
       
   299     void SetStatusBarLayout();
       
   300     
       
   301 private: // Private functions
       
   302     CFSEmailUiMailListVisualiser( CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi,
       
   303         CAlfControlGroup& aMailListControlGroup );
       
   304     void ConstructL();
       
   305 
       
   306 	// Refresh funcions
       
   307     void InsertNewMessagesL( const RArray<TFSMailMsgId>& aMessages );
       
   308     void InsertNewMessageL( CFSMailMessage* aNewMessage, const TBool aAllowRefresh ); // ownership is transferred
       
   309     
       
   310     void RefreshListItemsL();
       
   311     // Refresh the list order only
       
   312     void RefreshOrderL();
       
   313     
       
   314     // To start refreshing asynchronously
       
   315     void RefreshDeferred( TFSMailMsgId* aFocusToMessage = NULL );
       
   316     static TInt DoRefresh( TAny* aSelfPtr );
       
   317     void CompletePendingRefresh();
       
   318     
       
   319     // Create and insert one list node item according to given model item.
       
   320     // Omitting the argument aChildIdx causes the new node to be appended at the end of the list.
       
   321     TFsTreeItemId InsertNodeItemL( TInt aModelIndex, TInt aChildIndex = KErrNotFound, const TBool aAllowRefresh = EFalse );
       
   322     // Create and insert one list item according the given model item. The item is added under the given node.
       
   323     // Omitting the argument aChildIdx causes the new item to be appended as last child of the node.
       
   324     TFsTreeItemId InsertListItemL( TInt aModelIndex, TFsTreeItemId aParentNodeId, TInt aChildIdx = KErrNotFound, TBool aAllowRefresh = ETrue );
       
   325 	
       
   326 	// Mail model update
       
   327 	void UpdateMailListModelL();
       
   328 	void CreateModelItemsL( RPointerArray<CFSMailMessage>& aMessages );
       
   329 	
       
   330 	// Create title divider model item for the given message. Separator text depends on active sorting mode.
       
   331 	CFSEmailUiMailListModelItem* CreateSeparatorModelItemLC( CFSMailMessage& aMessage ) const;
       
   332 	
       
   333 	// Checks if the given messages belong under the same title divider. This depends on the currect sorting mode.
       
   334 	TBool MessagesBelongUnderSameSeparatorL( const CFSMailMessage& aMessage1, const CFSMailMessage& aMessage2 ) const;
       
   335 	
       
   336 	// Rescale UI	
       
   337 	void SetMailListLayoutAnchors();
       
   338 
       
   339 	// Control bar functions
       
   340 	void CreateControlBarLayoutL();
       
   341 	void ScaleControlBarL();
       
   342 	void SetSortButtonTextAndIconL();
       
   343     void HandleControlBarEvent( TFsControlBarEvent aEvent, TInt aData );
       
   344 
       
   345 	// Followup flag
       
   346 	void SetMessageFollowupFlagL();
       
   347 
       
   348 	void CreatePlainNodeL( const TDesC* aItemDataBuff,
       
   349                            CFsTreePlainOneLineNodeData* &aItemData,   
       
   350                            CFsTreePlainOneLineNodeVisualizer* &aNodeVisualizer ) const;                           	
       
   351 
       
   352 	// Move messages to folder
       
   353 	TInt MoveMsgsToFolderL( const TFSMailMsgId& aDestinationFolderId );
       
   354 
       
   355 	// Collapse/Expand nodes
       
   356 	void ExpandAllNodesL();
       
   357 	void CollapseAllNodesL();
       
   358 	void ExpandOrCollapseL();
       
   359 
       
   360 	// Mark control functions
       
   361 	void MarkAllItemsL();
       
   362 	void UnmarkAllItemsL();
       
   363 	TInt CountMarkedItemsL();
       
   364 	
       
   365 	void MarkMessagesIfFoundL( const RArray<TFSMailMsgId>& aMessageIDs );
       
   366 
       
   367 	// Message deletion internal functions
       
   368 	void DeleteFocusedMessageL();
       
   369 	void DeleteMarkedMessagesL();
       
   370 	static TInt DoDeleteMarkedMessages( TAny* aSelfPtr );
       
   371 
       
   372 	// Helper functions to access model data
       
   373 	TFSMailMsgId MsgIdFromIndex( TInt aItemIdx ) const;
       
   374 	CFSMailMessage& MsgPtrFromListIdL( TFsTreeItemId aListId );	
       
   375     const CFSMailMessage& MsgPtrFromListIdL( TFsTreeItemId aListId ) const; 
       
   376 
       
   377 	// Item data and visualiser helper functions 
       
   378 	MFsTreeItemData* ItemDataFromItemId( TFsTreeItemId aItemId );										
       
   379 	MFsTreeItemVisualizer* ItemVisualiserFromItemId( TFsTreeItemId aItemId );
       
   380 	
       
   381 	// Helpers to get the ordinal of a message in the iModel
       
   382 	TInt ItemIndexFromMessageId( const TFSMailMsgId& aMessageId ) const;
       
   383 	TInt NextMessageIndex( TInt aCurMsgIdx ) const;
       
   384 	TInt PreviousMessageIndex( TInt aCurMsgIdx ) const;
       
   385 	TInt ModelIndexFromListId( TFsTreeItemId aItemId ) const;
       
   386 	
       
   387 	// Open highlighted mail
       
   388 	void OpenHighlightedMailL();
       
   389 	void OpenMailItemL( TFsTreeItemId aMailItem );
       
   390 
       
   391 	// Create folder name buffer, either from database or from actual folder name
       
   392 	HBufC* CreateFolderNameLC( const CFSMailFolder* aFolder ) const;
       
   393 
       
   394 	// Shortcut specific toggles
       
   395 	void ShortcutReadUnreadToggleL();
       
   396 	void ShortcutCollapseExpandAllToggleL();
       
   397 	
       
   398 	// Utility functions to check if all nodes are expanded or collapsed
       
   399 	TBool AllNodesCollapsed() const;
       
   400 	TBool AllNodesExpanded() const;
       
   401 	
       
   402 	// Utility functions to check if mark as read/unread options should be available in menus
       
   403 	TBool IsMarkAsReadAvailableL() const;
       
   404 	TBool IsMarkAsUnreadAvailableL() const;
       
   405 	
       
   406 	// Utility function to get list of entries which will be targeted by the Actions menu commands.
       
   407 	// The list contains either marked entries or the focused message entry or is empty.
       
   408 	void GetActionsTargetEntriesL( RFsTreeItemIdList& aListItems ) const;
       
   409 	
       
   410 	// Action menu specific functions
       
   411 	void LaunchActionMenuL();
       
   412 	void HandleActionMenuCommandL( TActionMenuCustomItemId itemId );
       
   413 	void LaunchStylusPopupMenuL();
       
   414 	
       
   415 	// Compose, reply, reply all and forward
       
   416 	void CreateNewMsgL();
       
   417 	void ReplyL( CFSMailMessage* aMsgPtr );
       
   418 	void ReplyAllL( CFSMailMessage* aMsgPtr );
       
   419 	void ForwardL( CFSMailMessage* aMsgPtr );
       
   420 	void DoReplyForwardL( TEditorLaunchMode aMode, CFSMailMessage* aMsgPtr = NULL );
       
   421 	
       
   422 	// Some misc housekeeping functions
       
   423 	void RemoveUnnecessaryNodesL();
       
   424 	void UpdateMailListSettingsL();	
       
   425 	void UpdateMailListTimeDateSettings();
       
   426 	STimeDateFormats MailListTimeDateSettings();
       
   427 
       
   428 	// Request to update list item data from given message pointer
       
   429     void UpdateItemDataL( CFsTreePlainTwoLineItemData* aData, const CFSMailMessage* aMsgPtr );
       
   430 	
       
   431 	// Request to update preview pane data for list id with msg ptr
       
   432 	void UpdatePreviewPaneTextForItemL( TFsTreeItemId aListItemId, CFSMailMessage* aMsgPtr );
       
   433 	void UpdatePreviewPaneTextForItemL( CFsTreePlainTwoLineItemData* aTwoLineItemData, CFSMailMessage* aMsgPtr );
       
   434     void UpdatePreviewPaneTextIfNecessaryL( TFsTreeItemId aListItemId, TBool aUpdateItem = ETrue );
       
   435 	
       
   436 	// Sender/Recipient text depending on the mail folder
       
   437 	HBufC* GetListFirstTextLineL( const CFSMailMessage* aMsgPtr );
       
   438 
       
   439 	// Reload message pointer from mail client and update list item contents to match it. Item is
       
   440 	// removed if it isn't valid anymore.
       
   441 	void UpdateItemAtIndexL( TInt aIndex );
       
   442 	
       
   443 	// Check validity of highlighted msg and remove from list if needed
       
   444 	// EFalse indicates that mail was not valid anymore.
       
   445 	TBool CheckValidityOfHighlightedMsgL();
       
   446 
       
   447 	// Icon update for msg item
       
   448 	void UpdateMsgIconAndBoldingL( CFSMailMessage* aMsgPtr );
       
   449 	void UpdateMsgIconAndBoldingL( TInt aListIndex, TBool aRefreshItem = ETrue );
       
   450 	void UpdateMsgIconAndBoldingL( CFsTreePlainTwoLineItemData* aItemData,
       
   451 	                               CFsTreePlainTwoLineItemVisualizer* aItemVis,
       
   452 	                               CFSMailMessage* aMsgPtr );
       
   453 
       
   454 	// Message removing from list if found
       
   455 	void RemoveMsgItemsFromListIfFoundL( const RArray<TFSMailMsgId>& aEntryIds );
       
   456 
       
   457 	// Branding functions
       
   458 	void SetBrandedMailBoxIconL();
       
   459 	void SetMailboxNameToStatusPaneL();
       
   460 	void SetBrandedListWatermarkL();
       
   461 
       
   462     // Gives the parent node if the item has one. Returns KErrNotFound if no parent node available.
       
   463     TFsTreeItemId ParentNode( TFsTreeItemId aItemId ) const;
       
   464     
       
   465     // Either marks or unmarks the current item depending on the current marking state
       
   466     // as stored in iListMarkItemsState. Used for marking when shift is depressed while
       
   467     // scrolling. Returns ETrue if the highlighted item is markable.
       
   468     TBool DoScrollMarkUnmarkL();
       
   469     
       
   470     /**
       
   471      * Mark/unmark items under current separator.
       
   472      * 
       
   473      * @param aMarked If ETrue mark all items else unmark.
       
   474      * @param aSeparatorId Id of the separator.
       
   475      */
       
   476     void MarkItemsUnderSeparatorL( TBool aMarked, TInt aSeparatorId );
       
   477     
       
   478     //When maillist is activated this method handles the connection icon change
       
   479     void ConnectionIconHandling();
       
   480     
       
   481     void SetListAndCtrlBarFocusL();
       
   482     
       
   483     void SetMailListItemsExtendedL();
       
   484     
       
   485     void DoFirstStartL();
       
   486 
       
   487     // Called when flip state is changed
       
   488     void FlipStateChangedL( TBool aFlipOpen );
       
   489 
       
   490     /**
       
   491      * Handles the focus state changes
       
   492      * @param aShow Indicates if focus should become visible or removed
       
   493      */
       
   494     void HandleTimerFocusStateChange( TBool aShow );
       
   495 
       
   496 private: // data types
       
   497 
       
   498     
       
   499 private: // Private objects
       
   500     // Reference to Alf environment
       
   501     CAlfEnv& iEnv;
       
   502   	// Mail list updater timer
       
   503 	// Timer delays mail update to prevent unnesessary redraw events
       
   504 	CMailListUpdater* iMailListUpdater; 
       
   505 	// Msg moved note timer
       
   506 	CMsgMovedNoteTimer* iMsgNoteTimer; 
       
   507   	// Screen layout uses iMailListControl
       
   508 	CAlfAnchorLayout* iScreenAnchorLayout;
       
   509   	// Control bar control and layout and store visual pointer
       
   510 	CFsControlBar* iControlBarControl;
       
   511 	CAlfVisual* iControlBarVisual;
       
   512  	CAlfDeckLayout* iControlBarLayout;  
       
   513   	// Mail List control and layout
       
   514     CFreestyleEmailUiMailListControl* iMailListControl;
       
   515  	CAlfDeckLayout* iListLayout;
       
   516 // <cmail> this feature is waiting for title divider bg graphics
       
   517     CAlfImageVisual* iTitleDividerBgVisual;
       
   518 // </cmail>
       
   519     CFSEmailUiMailListModel* iModel; 
       
   520   	CFsTreeList* iMailList;
       
   521     CFsTreeVisualizerBase* iMailTreeListVisualizer;
       
   522   	TInt iNumSlots;		
       
   523    	CFSMailFolder* iMailFolder;
       
   524     TInt iNewEmailsInModel; 	
       
   525 	RArray<SMailListItem> iTreeItemArray;   
       
   526     RArray<TInt> iButtonsIds;
       
   527     TInt iFocusedControl;
       
   528     TBool iToolbarInUse;
       
   529     TInt iListMode;    
       
   530     TInt iNodesInUse;
       
   531     TInt iNewEmailButtonId;
       
   532 	TInt iFolderListButtonId;
       
   533 	TInt iSortButtonId;
       
   534 	TInt iImageButtonId;
       
   535 	MFsControlButtonInterface* iIconButton;
       
   536 	MFsControlButtonInterface* iNewEmailButton;
       
   537 	MFsControlButtonInterface* iFolderListButton;
       
   538 	MFsControlButtonInterface* iSortButton;	
       
   539 	TBool iThisViewActive;	
       
   540 	CPbkxContactActionMenu* iActionMenu;	
       
   541     TFSMailSortCriteria iCurrentSortCriteria;
       
   542 	// Set to indicate whether items should be marked or unmarked
       
   543 	TBool iListMarkItemsState;
       
   544 	// Set to indicate if Shift key is being held down in which case selection key has mark/unmark functionality
       
   545 	TBool iShiftDepressed;
       
   546 	// Set to indicate has other key events occured during hash key press (in which case hash is used as shift and not handled individually)
       
   547 	TBool iOtherKeyPressedWhileShiftDepressed;
       
   548 	// Move to folder toggle
       
   549 	TBool iMoveToFolderOngoing;
       
   550 	// Timers
       
   551 	CFSEmailUiGenericTimer* iMsgMoveTimer;
       
   552 	//ETrue if user started the sync
       
   553 	TBool iManualMailBoxSync;
       
   554 	TAknUiZoom iCurrentZoomLevel;
       
   555 	STimeDateFormats iDateFormats;
       
   556 	TRect iCurrentClientRect;
       
   557 	CAlfTexture* iMailBoxIconTexture;
       
   558 	CAlfTexture* iMailBoxWatermarkTexture;
       
   559 	TBool iSkinChanged;
       
   560 	TBool iDateChanged;
       
   561 	TFSMailMsgId iLatestOpenedMrId;
       
   562 	TBool iListOrderMayBeOutOfDate;
       
   563 	CAknWaitDialog* iDeletingWaitNote;
       
   564 	CDateChangeTimer* iDateChangeTimer;
       
   565 	TBool iFirstStartCompleted;
       
   566 	// generic use async callback object
       
   567 	CAsyncCallBack* iAsyncCallback; 
       
   568 	// async callback for deferred redrawing
       
   569 	CAsyncCallBack* iAsyncRedrawer;
       
   570 	TFSMailMsgId iMsgToFocusAfterRedraw;
       
   571 
       
   572     //<cmail>
       
   573     CEUiEmailListTouchManager* iTouchManager; 
       
   574     //</cmail>
       
   575     CAknStylusPopUpMenu* iStylusPopUpMenu; 
       
   576     
       
   577     TBool iShowReplyAll;
       
   578   	};
       
   579 
       
   580 
       
   581 // Definition of the mail updater timer. This timer is used for
       
   582 // delayed drawing of the mail list to avoid viewsrv:11 panics.
       
   583 class CMailListUpdater : public CTimer
       
   584     {
       
   585 public:
       
   586     static CMailListUpdater* NewL( CFSEmailUiMailListVisualiser* aMailListVisualiser );
       
   587     ~CMailListUpdater();
       
   588     void StartL( TBool aIsSorting = EFalse );
       
   589     void Stop();
       
   590     void RunL();
       
   591 
       
   592 protected:
       
   593     CMailListUpdater( CFSEmailUiMailListVisualiser* aMailListVisualiser );
       
   594 
       
   595 private:
       
   596     CFSEmailUiMailListVisualiser* iMailListVisualiser;
       
   597     TBool iIsSorting;
       
   598     CAknWaitDialog* iWaitNote;
       
   599     };
       
   600 
       
   601 // Delayd note timer 
       
   602 class CMsgMovedNoteTimer : public CTimer
       
   603     {
       
   604 public:
       
   605     static CMsgMovedNoteTimer* NewL( CFreestyleEmailUiAppUi* aAppUi, CFSEmailUiMailListVisualiser* aMailListVisualiser );
       
   606     ~CMsgMovedNoteTimer();
       
   607     void Start( TInt aMsgCount, const TFSMailMsgId aDestinationFolderId );
       
   608     void Stop();
       
   609     void RunL();
       
   610 
       
   611 protected:
       
   612     CMsgMovedNoteTimer( CFreestyleEmailUiAppUi* aAppUi, CFSEmailUiMailListVisualiser* aMailListVisualiser );
       
   613 
       
   614 private:
       
   615     CFreestyleEmailUiAppUi* iAppUi;
       
   616     CFSEmailUiMailListVisualiser* iMailListVisualiser;
       
   617     TFSMailMsgId iDestinationFolderId;
       
   618     TInt iMsgCount;
       
   619     };
       
   620 
       
   621 // Date changing timer. Updates the mail list when date changes.
       
   622 class CDateChangeTimer : public CTimer
       
   623     {
       
   624 public:
       
   625     static CDateChangeTimer* NewL( CFSEmailUiMailListVisualiser& aMailListVisualiser );
       
   626     ~CDateChangeTimer();
       
   627     void Start();
       
   628     void RunL();
       
   629     
       
   630 protected:
       
   631     CDateChangeTimer( CFSEmailUiMailListVisualiser& aMailListVisualiser );
       
   632     
       
   633 private:
       
   634     CFSEmailUiMailListVisualiser& iMailListVisualiser;
       
   635     };
       
   636 
       
   637 #endif