emailuis/emailui/inc/FreestyleEmailUiAppui.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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  FreestyleEmailUiAppUi class definition
       
    15 *
       
    16 */
       
    17  
       
    18 
       
    19 #ifndef __FREESTYLEEMAILUI_APPUI_H__
       
    20 #define __FREESTYLEEMAILUI_APPUI_H__
       
    21   
       
    22 // SYSTEM INCLUDES
       
    23 #include <aknViewAppUi.h>
       
    24 //<cmail> SF
       
    25 #include <alf/alfenv.h>
       
    26 #include <alf/alfdisplay.h>
       
    27 //</cmail>
       
    28 #include <cntdef.h>
       
    29 #include <cntviewbase.h>
       
    30 // <cmail> CPhCltDialer.h API removed
       
    31 //#include <CPhCltDialer.h>
       
    32 #include <etelmm.h>
       
    33 // </cmail>
       
    34 #include <TPbkContactItemField.h>
       
    35 #include <hwrmdomainpskeys.h> // For flip change status.
       
    36 //<cmail>
       
    37 #include "MFSMailRequestObserver.h"
       
    38 #include "MFSMailEventObserver.h"
       
    39 #include "FreestyleEmailUiUtilities.h"
       
    40 //</cmail>
       
    41 #include <msvapi.h>
       
    42 #include <cstack.h>
       
    43 #include <iaupdateobserver.h>
       
    44 #include "CFSMailCommon.h"
       
    45 #include "cmailcustomstatuspaneindicators.h"
       
    46 
       
    47 // INTERNAL INCLUDES
       
    48 #include "FreestyleEmailUiPropertySubscriber.h"
       
    49 #include "FreestyleEmailUiConstants.h"
       
    50 
       
    51 enum TForcedStatus 
       
    52 	{
       
    53     ENoForce = 0,
       
    54     EForceToSync,
       
    55     EForceToConnected,
       
    56     EForceToDisconnected
       
    57     };
       
    58 
       
    59 // FORWARD DECLARATIONS
       
    60 class CFreestyleEmailUiView;
       
    61 class CFSEmailUiViewerControl;
       
    62 class CFSEmailUiLauncherGrid;
       
    63 class CFSEmailUiLauncherGridVisualiser;
       
    64 class CFSEmailUiGridMenuModel;
       
    65 class CFSEmailUiLayoutHandler;
       
    66 class CFSEmailUiViewSwitchTimer;
       
    67 class CFSEmailUiList;
       
    68 class CFSEmailUiMailViewerVisualiser;
       
    69 class CFSEmailUiMailListVisualiser;
       
    70 class CFSMailClient;
       
    71 class CFSMailMessage;
       
    72 class CFSMailFolder;
       
    73 class CFSMailBox;
       
    74 class CMailListUpdater;
       
    75 class CFSEmailUiEditor;
       
    76 class CAknInfoPopupNoteController;
       
    77 class CFSEmailUiSingleListModel;
       
    78 class CFSEmailUiSingleListVisualiser;
       
    79 class CFreestyleEmailUiTextureManager;
       
    80 class CFSEmailUiEditorVisualiser;
       
    81 class CFSEmailUiMsgDetailsVisualiser;
       
    82 class CFSEmailUiFolderListVisualiser;
       
    83 class CNcsComposeView;
       
    84 class CAknsLayeredBackgroundControlContext;
       
    85 class CAlfAnchorLayout;
       
    86 class CFsTreeList;
       
    87 class CFSEmailCRHandler;
       
    88 class CFSEmailUiAttachmentsListVisualiser;
       
    89 class CFreestyleEmailUiAttachmentsListControl;
       
    90 class MFSEmailUiFolderListCallback;
       
    91 class MFSEmailUiSortListCallback;
       
    92 class MFsControlButtonInterface;
       
    93 class CFSEmailUiSendAttachmentsListVisualiser;
       
    94 class TFSProgress;
       
    95 class CFSEmailUiDownloadManagerVisualiser;
       
    96 class CFreestyleEmailUiDownloadManagerControl;
       
    97 class CAlfLayout;
       
    98 class CFSEmailUiSearchListVisualiser;
       
    99 class CFSEmailUiStatusIndicator;
       
   100 class CFsEmailUiHtmlViewerView;
       
   101 class CAknWaitNoteWrapper;
       
   102 class CFSEmailUiActionMenu;
       
   103 class CFSEmailUiShortcutBinding;
       
   104 class CFSEmailUiWizardObserver;
       
   105 class CDocumentHandler;
       
   106 class CAknProgressDialog;
       
   107 class CEikProgressInfo;
       
   108 class CFsEmailUiViewBase;
       
   109 class CVPbkContactManager;
       
   110 class CESMRIcalViewer;
       
   111 class CFsEmailFileHandleShutter;
       
   112 class CFsLayoutManager;
       
   113 class CIAUpdate;
       
   114 class CIAUpdateParameters;
       
   115 class CFSEmailUiAutosyncMonitor;
       
   116 class CEUiExitGuardian;
       
   117 class CAknNavigationDecorator;
       
   118 class CFSEmailDownloadInfoMediator;
       
   119 class MAknNaviDecoratorObserver;
       
   120 class CCustomStatuspaneIndicators;
       
   121 
       
   122 class CFreestyleEmailUiAppUi : public CAknViewAppUi,
       
   123     			               public MAlfActionObserver,
       
   124     			               public MFSMailRequestObserver,
       
   125     			               public MFSMailEventObserver,
       
   126     			               public MMsvSessionObserver,
       
   127     			               public MIAUpdateObserver,
       
   128     			               public MFSEmailUiGenericTimerCallback,
       
   129     			               public MFreestyleEmailUiPropertyChangedObserver
       
   130     {
       
   131 friend class CMailListUpdater;
       
   132 public:
       
   133 
       
   134     CFreestyleEmailUiAppUi( CAlfEnv& aEnv );
       
   135     void ConstructL();
       
   136     ~CFreestyleEmailUiAppUi();
       
   137 	CAlfDisplay& Display();
       
   138 	CAlfEnv& AlfEnv();
       
   139    // void HandleCommandL(TInt aCommand);
       
   140     void HandleActionL(const TAlfActionCommand& aActionCommand);
       
   141 	// <cmail>
       
   142     void ProcessCommandL( TInt aCommand );
       
   143 	// </cmail>
       
   144 	void HandleCommandL( TInt aCommand );
       
   145 	
       
   146 	// View switching functions
       
   147 	void EnterFsEmailViewL( TUid aViewId );
       
   148 	void EnterFsEmailViewL( TUid aViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage );
       
   149 	void EnterPluginSettingsViewL( TUid aViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage );
       
   150 	void ReturnFromPluginSettingsView();
       
   151     void ViewActivatedExternallyL( TUid aViewId );
       
   152 
       
   153     void SetSwitchingToBackground( TBool aValue );
       
   154     TBool SwitchingToBackground() const;
       
   155 
       
   156 	/**
       
   157 	 * Tries to activate the local view where the current view was navigated from.
       
   158 	 * Activates the grid view if no other previous view available.
       
   159 	 * @return UID of the view to be activated
       
   160 	 */ 
       
   161 	TUid ReturnToPreviousViewL( const TDesC8& aCustomMessage = KNullDesC8 );
       
   162 
       
   163 	void ReturnFromHtmlViewerL( TBool aMessageWasDeleted = EFalse );
       
   164 
       
   165     // Clears the navigation history used with Back functionality. 
       
   166     // Thus, next call to ReturnToPreviousViewL() will return to the main grid.
       
   167     void EraseViewHistory();
       
   168 
       
   169 	// Create new mail with compose command
       
   170 	void CreateNewMailL();
       
   171 
       
   172 	// Returns pointer to the current active view. Ownership not transferred.
       
   173 	CFsEmailUiViewBase* CurrentActiveView();
       
   174     // Returns pointer to the previous active view. Ownership not transferred.
       
   175     CFsEmailUiViewBase* PreviousActiveView();
       
   176     // Tells if plugin settings view is currently open
       
   177     TBool IsPluginSettingsViewActive();
       
   178 	
       
   179 	// getter to generic components
       
   180 	CFSEmailUiLayoutHandler* LayoutHandler();
       
   181 	CFreestyleEmailUiTextureManager* FsTextureManager();
       
   182 //	CFSEmailUiStatusIndicator* StatusIndicator();
       
   183 
       
   184 	// Functions used by grid and viewer
       
   185 	TInt NewEmailsInModelL();
       
   186 	TInt EmailsInModelL();	  
       
   187 	TInt EmailIndexInModel();
       
   188 		
       
   189     /**
       
   190     * LaunchEditorL
       
   191     * Launch editor with the given address in TO-field and focus in MSG-field
       
   192     * @param aToAddress The email address to put in TO-field on startup. Ownership
       
   193     * is not transferred.
       
   194     */
       
   195 	void LaunchEditorL( CFSMailAddress* aToAddress );
       
   196 	
       
   197     /**
       
   198     * LaunchEditorL
       
   199     * Launch editor
       
   200     * @param aMode The mode in which the editor is started
       
   201     * @param aParams Editor launch parameters
       
   202     */
       
   203 	void LaunchEditorL( TEditorLaunchMode aMode, const TEditorLaunchParams& aParams );
       
   204 	
       
   205 	CFSMailClient* GetMailClient();
       
   206 	CFSEmailCRHandler* GetCRHandler();
       
   207 	
       
   208 	// Gets active mailbox pointer from the UI
       
   209 	// Ownership IS NOT transferred to the callers
       
   210 	CFSMailBox* GetActiveMailbox();
       
   211 
       
   212 	void SubscribeMailboxL( TFSMailMsgId aActiveMailboxId );
       
   213 	void SetActiveMailboxL( TFSMailMsgId aActiveMailboxId, TBool aAutoSync = ETrue );
       
   214 	CMsvSession* GetMsvSession();
       
   215 
       
   216 	TFSMailMsgId GetActiveBoxInboxId();
       
   217 	TFSMailMsgId GetActiveMailboxId();
       
   218 	
       
   219     /**
       
   220     * Show folder list or sort list as control bar popup list.
       
   221     * 
       
   222     * @param aCurrentSortOrder Current sort order in mail list
       
   223     * @param aFolderId/Type Folder id/type of the currently active mail folder
       
   224     * @param aCallback Callback pointer to use when reporting user selection
       
   225     * @param aButton Selected control bar button, used when positioning the list
       
   226     */
       
   227 	void ShowFolderListInPopupL( const TFSMailMsgId aFolderType,
       
   228                                  MFSEmailUiFolderListCallback* aCallback,
       
   229 								 MFsControlButtonInterface* aButton );
       
   230 	void ShowSortListInPopupL( const TFSMailSortField aCurrentSortOrder,
       
   231 	                           const TFSFolderType aFolderType,
       
   232 							   MFSEmailUiSortListCallback* aCallback,
       
   233 							   MFsControlButtonInterface* aButton );
       
   234 	void FolderPopupClosed();
       
   235 	
       
   236 	// Transition effects for Alf layouts, call these in doactivate and dodeactivate.
       
   237 	TBool ViewSwitchingOngoing();
       
   238 	
       
   239 	// Force Sync on active mailbox.
       
   240 	void SyncActiveMailBoxL();
       
   241 	
       
   242 	// Stop mailbox sync
       
   243 	void StopActiveMailBoxSyncL();
       
   244 	
       
   245 	// From sync observer
       
   246 	void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
       
   247 
       
   248     /**
       
   249      * Helper method to be called from Settings. Launches mailbox setup wizard.
       
   250      */
       
   251      void LaunchWizardL();
       
   252     
       
   253     // Overriden exit
       
   254     void Exit();
       
   255 
       
   256     void ExitNow();
       
   257 
       
   258     const CFSEmailUiShortcutBinding& ShortcutBinding() const;
       
   259    
       
   260     // Navigation functions, used mainly from viewer
       
   261     TBool IsNextMsgAvailable( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId, TFSMailMsgId& aFoundNextMsgFolder );
       
   262     TBool IsPreviousMsgAvailable( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundPreviousMsgId, TFSMailMsgId& aFoundPrevMsgFolder );
       
   263     TInt MoveToNextMsgL( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId );
       
   264     TInt MoveToPreviousMsgL( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundPreviousMsgId );
       
   265 
       
   266     /** Returns document handler. */
       
   267     CDocumentHandler& DocumentHandler();
       
   268 
       
   269     /**
       
   270      * Returns reference file handle shutter. The shutter is set to observe
       
   271      * embedded application exit events delegated by the appui's document
       
   272      * handler and it closes the set file handle on exit event. */
       
   273     CFsEmailFileHandleShutter& FileHandleShutter();
       
   274 
       
   275     // Returns unmodifiable reference to the current title pane text
       
   276     const TDesC& TitlePaneTextL();
       
   277     // Sets given text to title pane
       
   278     void SetTitlePaneTextL( const TDesC& aText );
       
   279     // Resets title pane text to its default value
       
   280     void ResetTitlePaneTextL();
       
   281     // Sets active mailbox name to title pane
       
   282     void SetActiveMailboxNameToStatusPaneL();
       
   283 
       
   284     // Set connection status icon of title pane to visible
       
   285     void ShowTitlePaneConnectionStatus();
       
   286     // Set connection status icon of title pane to hided
       
   287     void HideTitlePaneConnectionStatus();
       
   288     // Draw connection status icon into title pane if set as visible.
       
   289     // It is also possible to force connection indicator to wanted value
       
   290     // to achieve better user experience.
       
   291     void UpdateTitlePaneConnectionStatus( TForcedStatus aForcedStatus = ENoForce );
       
   292     // Return pointer to custom status pane indicators object
       
   293     // Which can be used to show priority and followup flags
       
   294     // on navi pane area. (Real navipane is not used)
       
   295     CCustomStatuspaneIndicators* GetStatusPaneIndicatorContainer();
       
   296 
       
   297     // Getter for appui owned virtual phonebook manager
       
   298     CVPbkContactManager& GetVPbkManagerL();
       
   299 
       
   300     // MessageReader implementation
       
   301     void StartReadingEmailsL();
       
   302     TBool MessageReaderSupportsFreestyle();
       
   303     
       
   304     static TBool AppUiExitOngoing();
       
   305 
       
   306     // Meeting request viewer instance, owned by the appui	
       
   307     CESMRIcalViewer* MrViewerInstanceL();	
       
   308 
       
   309     // Get Mail viewer instance, owned by the AppUi
       
   310     CFsEmailUiHtmlViewerView& MailViewer(); 
       
   311     
       
   312     // Get Folder list instance, owned by the AppUi
       
   313     CFSEmailUiFolderListVisualiser& FolderList();
       
   314     
       
   315     // Get Launcher grid instance, owned by the AppUi
       
   316     CFSEmailUiLauncherGridVisualiser& LauncherGrid();
       
   317     
       
   318     // View loading in idle
       
   319     TInt ViewLoadIdleCallbackFunctionL();
       
   320     
       
   321     /**
       
   322      * Sets the manual mailbox syncronisation/connection flag if the    
       
   323      * user chose to synchorise/connect mail boxes from the menu
       
   324      */
       
   325     void ManualMailBoxSync( TBool aManualMailBoxSync );
       
   326     void ManualMailBoxSyncAll( TBool aManualMailBoxSyncAll );
       
   327     void ManualMailBoxConnectAll( TBool aManualMailBoxConnectAll );
       
   328     void ManualMailBoxDisconnectAll( TBool aManualMailBoxConnectAll );
       
   329 	
       
   330 	// For showing mailbox query    
       
   331 	void GridStarted( TBool aStartedFromOds );
       
   332     void ShowMailboxQueryL();
       
   333     
       
   334     void DoAutoConnectL();
       
   335     
       
   336     CFSEmailDownloadInfoMediator* DownloadInfoMediator();
       
   337     
       
   338     // <cmail>
       
   339     TDisplayMode DisplayMode() const;
       
   340     // </cmail>
       
   341 
       
   342     /**
       
   343      * Returns the current flip status.
       
   344      * @return True if the flip is open, false otherwise.
       
   345      */
       
   346     TBool IsFlipOpen() const;
       
   347 
       
   348 
       
   349 public: //from MFSMailEventObserver
       
   350     /**
       
   351      * Framework event message. 
       
   352      * Used here to catch the events thrown from new mailbox creation process.
       
   353      *
       
   354      * @param aEvent One of pre-defined events in TFSMailEvent
       
   355      * @param aMailbox maibox related for this event
       
   356      * @param aParam1 intepretation is event specific (see TFSMailEvent descriptions)
       
   357      * @param aParam2 intepretation is event specific (see TFSMailEvent descriptions)
       
   358      * @param aParam3 intepretation is event specific (see TFSMailEvent descriptions)
       
   359      */
       
   360     void EventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox, 
       
   361                  TAny* aParam1, TAny* aParam2, TAny* aParam3);
       
   362                  
       
   363 public:              
       
   364 	void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3 );
       
   365 
       
   366 public: // MIAUpdateObserver
       
   367     virtual void CheckUpdatesComplete( TInt aErrorCode, TInt aAvailableUpdates );
       
   368     virtual void UpdateQueryComplete( TInt aErrorCode, TBool aUpdateNow );
       
   369     virtual void UpdateComplete( TInt aErrorCode, CIAUpdateResult* aResultDetails );
       
   370 
       
   371 public:	
       
   372 
       
   373     /**
       
   374     * StartEndKeyCapture
       
   375     * Start key capture for end-key
       
   376     */
       
   377     void StartEndKeyCapture();
       
   378 
       
   379     /**
       
   380     * StopEndKeyCapture
       
   381     * Stop key capture for end-key
       
   382     */
       
   383     void StopEndKeyCapture();
       
   384 
       
   385     /**
       
   386      * Accessor for navipane decorator object.
       
   387      * @param aViewId: Caller identify itself by giving the view Id (see FreestyleEmailUiConstants.h)
       
   388      * This is used for choosing correct decorator.
       
   389      * @return instance of correct navidecorator. NULL if aView doesn't match.
       
   390      */
       
   391     CAknNavigationDecorator* NaviDecoratorL( const TUid aViewId );
       
   392     
       
   393 public:
       
   394     
       
   395     virtual void TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer );
       
   396     
       
   397     /**
       
   398     * CancelFocusRemovalTimer
       
   399     * Cancels focus removal timer
       
   400     */
       
   401     void CancelFocusRemovalTimer();
       
   402     
       
   403     /**
       
   404     * StartFocusRemovalTimer
       
   405     * Starts focus removal timer
       
   406     * @return whether or not timer was active already.
       
   407     */
       
   408     TBool StartFocusRemovalTimer();
       
   409     
       
   410     /**
       
   411     * IsTimerFocusShown
       
   412     * Used for finding out if the timer focus is already visible
       
   413     * @return whether or not the timer focus is visible.
       
   414     */
       
   415     TBool IsTimerFocusShown() const;
       
   416 
       
   417 
       
   418 public: // From MFreestyleEmailUiPropertyChangedObserver.
       
   419 
       
   420 	void PropertyChangedL( TInt aValue );
       
   421 
       
   422 
       
   423 protected: 
       
   424 	TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   425     void HandleResourceChangeL(TInt aType);
       
   426 	void HandleWsEventL(const TWsEvent &aEvent, 
       
   427  	                    CCoeControl *aDestination);
       
   428  	
       
   429  	void HandleForegroundEventL( TBool aForeground );
       
   430     MCoeMessageObserver::TMessageResponse HandleMessageL( TUint32 aClientHandleOfTargetWindowGroup,
       
   431                                                           TUid aMessageUid,
       
   432                                                           const TDesC8& aMessageParameters );
       
   433  
       
   434 private:
       
   435     void DoHandleResourceChangeL(TInt aType);
       
   436 	void UpdateSettingsListModelL();
       
   437 	CAlfTexture& LoadItemIconL( TInt aUid );
       
   438     void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, 
       
   439                                   CFbsBitmap*& aMaskBitmap);
       
   440     
       
   441     /**
       
   442      * Helper method for launching a setup wizard, or handling data received from one.
       
   443      */
       
   444     void DoWizardStartupActionsL();
       
   445         
       
   446     TBool IsViewInHistoryStack( TUid aViewId ) const;
       
   447     
       
   448     void ReturnToViewL( TUid aViewId, TUid aCustomMessageId = TUid::Null(), const TDesC8& aCustomMessage = KNullDesC8 );
       
   449     
       
   450     // Checks updates from IAD client
       
   451     void CheckUpdatesL();
       
   452     void AllUpdateActivitiesCompleted();
       
   453 
       
   454 	// This async callback functionality is needed because UI and app construction
       
   455 	// cannot jam while the new mailbox query has been displayed     
       
   456    	static TInt DisplayCreateQueryL( TAny* aSelfPtr );
       
   457    	void DisplayCreateMailboxQueryL();
       
   458    	
       
   459    	// Send self to background.
       
   460    	void SendToBackground();
       
   461     
       
   462    	/*
       
   463    	 * Called from ConstructL during start of application.
       
   464    	 * Constructs navipane(s) that are used by different views.
       
   465    	 */
       
   466    	void ConstructNaviPaneL();
       
   467 
       
   468     // Create custom status pane indicators. (priority and followup)
       
   469     void CreateStatusPaneIndicatorsL();
       
   470     // Delete custom status pane indicators
       
   471     void DeleteStatusPaneIndicators();
       
   472     
       
   473    	/*
       
   474    	 * FocusTimerCallBack
       
   475    	 * Called when focus removal timer expires
       
   476    	 */
       
   477     static TInt FocusTimerCallBack(TAny* aAny);
       
   478     
       
   479    	/*
       
   480    	 * DoFocusTimerCallBack
       
   481    	 * Called when focus removal timer expires
       
   482    	 */
       
   483     TInt DoFocusTimerCallBack();
       
   484     
       
   485    	
       
   486 private:
       
   487 	// ALF environment NOTE: Display removed from Alfred version
       
   488     CAlfEnv* iEnv;
       
   489      
       
   490     // Pointers to current and previous active views
       
   491     CFsEmailUiViewBase* iCurrentActiveView; // not owned
       
   492     CFsEmailUiViewBase* iPreviousActiveView; // not owned
       
   493     CStack<CFsEmailUiViewBase, EFalse>* iNavigationHistory; // items not owned
       
   494  
       
   495  	CFSEmailDownloadInfoMediator* iDwnldMediator;
       
   496  
       
   497      // Pointers to actual display control groups containing UI elements      
       
   498     CAlfControlGroup* iGridControlGroup;
       
   499   	CAlfControlGroup* iMailListControlGroup;
       
   500     CAlfControlGroup* iEmailViewerControlGroup;
       
   501   	CAlfControlGroup* iFolderListControlGroup;
       
   502   	CAlfControlGroup* iSettingsListControlGroup;
       
   503    	CAlfControlGroup* iSendingAnimationControlGroup;
       
   504   	CAlfControlGroup* iMsgDetailsControlGroup;
       
   505   	CAlfControlGroup* iAttachmentControlGroup;
       
   506   	CAlfControlGroup* iComposerControlGroup;
       
   507   	CAlfControlGroup* iDownloadManagerControlGroup;
       
   508   	CAlfControlGroup* iSearchResultControlGroup;
       
   509   	CAlfControlGroup* iStatusIndicatorControlGroup;
       
   510   	CAlfControlGroup* iHtmlViewerControlGroup;
       
   511   
       
   512  	// FS Email UI specific layout handler object
       
   513     CFSEmailUiLayoutHandler* iLayoutHandler;
       
   514 
       
   515 	// FS specific layout
       
   516         //<cmail> layout manager doesn't exists in cmail
       
   517 	//CFsLayoutManager* iLayoutManager;
       
   518         //</cmail>
       
   519 	
       
   520 	// FS Email UI specific texture mngr object
       
   521  	CFreestyleEmailUiTextureManager* iFsTextureManager;
       
   522 
       
   523 	// Main UI grid control and view
       
   524   	CFSEmailUiLauncherGrid* iMainUiGrid;
       
   525     CFSEmailUiLauncherGridVisualiser* iMainUiGridVisualiser;	
       
   526 
       
   527 	// Mail view
       
   528 	CFSEmailUiMailListVisualiser* iMailListVisualiser;
       
   529 
       
   530   	// Plain text viewer view, control inside text view;
       
   531     CFSEmailUiMailViewerVisualiser* iViewerVisualiser;
       
   532 
       
   533 	// Message editor view
       
   534 	CNcsComposeView* iComposeView;
       
   535 
       
   536 	// Html viewer view
       
   537 	CFsEmailUiHtmlViewerView* iHtmlViewerView;
       
   538 
       
   539 	// Message details view
       
   540 	CFSEmailUiMsgDetailsVisualiser* iMsgDetailsVisualiser;
       
   541 
       
   542 	// Folder list view
       
   543 	CFSEmailUiFolderListVisualiser* iFolderListVisualiser;
       
   544 	
       
   545 	// Attachment list
       
   546 	CFSEmailUiAttachmentsListVisualiser* iAttachmentListVisualiser;
       
   547 	CFreestyleEmailUiAttachmentsListControl* iAttachmentHanlerControl;
       
   548 	
       
   549     // Download manager removed.
       
   550 
       
   551 	// Search result list view
       
   552 	CFSEmailUiSearchListVisualiser* iSearchListVisualiser;
       
   553 
       
   554 	// Status indicator
       
   555 	CFSEmailUiStatusIndicator* iStatusIndicator;
       
   556 
       
   557     // Mailclient, list of mailboxes, active mailbox and
       
   558     // latest opened folder
       
   559     CFSMailClient* iMailClient;
       
   560  
       
   561  	// Active mailbox, pointer owned by the APP UI!
       
   562  	CFSMailBox* iActiveMailbox;
       
   563 
       
   564 	TFSMailMsgId iActiveBoxInboxId;
       
   565 	TFSMailMsgId iActiveMailboxId;
       
   566  
       
   567 	// Mail sending progress dialog
       
   568 	CAknProgressDialog* iSendingProgressDialog;
       
   569 	CEikProgressInfo* iSendingProgressInfo;
       
   570 	
       
   571 	// Phonebook engine and resource handle
       
   572 	TInt iPhCltResHandle;
       
   573 	
       
   574 	// Central repository handler
       
   575 	CFSEmailCRHandler*	iCRHandler;
       
   576 	
       
   577 	// End key capture handles
       
   578 	TInt32 iEndCaptureHandle;
       
   579 	TInt32 iEndUpDownCaptureHandle;
       
   580 	
       
   581     CMsvSession* iMsvSession;
       
   582 
       
   583     CFSEmailUiActionMenu* iActionMenuHandler;
       
   584     
       
   585 	RArray<TFSMailMsgId> iSubscribedMailBoxes;
       
   586 	RArray<TUint> iSubscribedMailBoxesIds;
       
   587 	
       
   588 
       
   589 	// Helper class for keyboard shortcut handling
       
   590 	CFSEmailUiShortcutBinding* iShortcutBinder;
       
   591 	
       
   592 	CFSEmailUiWizardObserver* iWizardObserver;
       
   593 
       
   594     CDocumentHandler* iDocumentHandler;
       
   595     CFsEmailFileHandleShutter* iFileHandleShutter;
       
   596 
       
   597 	TBool iConstructComplete;
       
   598 	
       
   599 	TInt iSyncStatusReqId;
       
   600 	
       
   601 	TBool iIsForeground;
       
   602 	
       
   603   	CIdle* iViewLoadIdle;
       
   604 	TCallBack* iViewLoadIdleCallback;
       
   605 	TBool iIsCaptured;
       
   606 	
       
   607     CVPbkContactManager* iVpkContactManager; 
       
   608     
       
   609     //This is used to pass needed information to messagereader
       
   610 	HBufC8* iCustomMessageToMessageReader;
       
   611 	
       
   612 	// Meeting request viewer instance	
       
   613   	CESMRIcalViewer* iMRViewer;	
       
   614   	
       
   615   	// Flag to be used to disable online/offline note in automated 
       
   616   	// Mailbob online
       
   617   	TBool iAutomatedMailBoxOnline;
       
   618   	
       
   619 	// Value indicating that msg reader is supported, KErrNone if supported.
       
   620   	TInt iMsgReaderIsSupported;
       
   621   	// For IAD
       
   622     CIAUpdate* iUpdateClient;
       
   623     CIAUpdateParameters* iUpdateParameters;
       
   624     
       
   625     // For feature manager
       
   626     TBool iFeatureManagerInitialized;
       
   627     
       
   628     //ETrue if user started the sync/connect all
       
   629     TBool iManualMailBoxSync;
       
   630     TBool iManualMailBoxSyncAll;
       
   631     TBool iManualMailBoxConnectAll;
       
   632     TBool iManualMailBoxDisconnectAll;
       
   633 
       
   634     // ETrue if the screen layout has chaged while the application was on background
       
   635     TBool iPendingLayoutSwitch;
       
   636     
       
   637     // Startup mailbox creation query flag.
       
   638     TBool iStartupQueryShown;	
       
   639     TBool iGridStarted;
       
   640     TBool iGridFirstStartFromOds; 
       
   641     TBool iSettingsViewActive;
       
   642     TBool iIADUpdateCompleted;
       
   643     
       
   644     CFSEmailUiAutosyncMonitor* iAutoSyncMonitor; 
       
   645  
       
   646     // Async callback for create mailbox query
       
   647     // This is needed because query can not stop execution of UI construction      	
       
   648     CAsyncCallBack* iNewBoxQueryAsyncCallback;
       
   649 
       
   650     // Exit guardian. 
       
   651     CEUiExitGuardian* iExitGuardian;
       
   652 
       
   653     // navipane decorator
       
   654     // (used at least in mail viewer)
       
   655     CAknNavigationDecorator* iNaviDecorator2MailViewer;
       
   656     
       
   657     // Resource file offset for message editor external resources
       
   658     TInt iMsgEditorResourceOffset;
       
   659     
       
   660     // Resource file offset for FSMailServer external resources
       
   661     TInt iFSMailServerResourceOffset;
       
   662     
       
   663     // Custom status pane indicators
       
   664     CCustomStatuspaneIndicators* iStatusPaneIndicators;
       
   665     TBool iConnectionStatusVisible;
       
   666     CFSEmailUiGenericTimer* iConnectionStatusIconAnimTimer;
       
   667     CFbsBitmap* iConnectionIconBitmap;
       
   668     CFbsBitmap* iConnectionIconMask;
       
   669     TInt iConnectionStatusIconAngle;
       
   670     TForcedStatus iForcedConnectionStatus;
       
   671 
       
   672     // Set true, when application is going to be switched to backgound
       
   673     // after the view deactivation.
       
   674     TBool iSwitchingToBackground;
       
   675 
       
   676     // For handling the flip state.
       
   677     CFreestyleEmailUiPropertySubscriber* iPropertySubscriber;
       
   678     TBool iFlipOpen;
       
   679     
       
   680     // Timer for focus removal purposes. Owned
       
   681     CPeriodic* iFocusTimer;
       
   682 
       
   683     };
       
   684 
       
   685 
       
   686 /**
       
   687 *  CFSEmailUiAutosyncMonitor.
       
   688 * Needed for auto sync feature, not wanted when roaming.
       
   689 */
       
   690 class CFSEmailUiAutosyncMonitor : public CActive
       
   691     {
       
   692     public:
       
   693         enum TNetworkStatus 
       
   694             {
       
   695             EStatusUnknown = 0,
       
   696             EHomenetwork,
       
   697             ERoaming,
       
   698             ERequestCancelled
       
   699             };
       
   700 
       
   701         enum TMonitoringStatus
       
   702             {
       
   703             EInactive = 0,
       
   704             ERequestingNetworkStatus,
       
   705             EDone
       
   706             };
       
   707             
       
   708         static CFSEmailUiAutosyncMonitor* NewL( CFreestyleEmailUiAppUi& aAppUi );
       
   709         ~CFSEmailUiAutosyncMonitor();
       
   710 
       
   711     public: 
       
   712         void StartMonitoring( );
       
   713         void StopMonitoring( );
       
   714 
       
   715     private: 
       
   716         void RunL();
       
   717         void DoCancel();
       
   718         TInt RunError( TInt aError );
       
   719         
       
   720     private:
       
   721         CFSEmailUiAutosyncMonitor( CFreestyleEmailUiAppUi& aAppUi );
       
   722         void ConstructL();     
       
   723 
       
   724     private:  
       
   725         TMonitoringStatus iMonitoringStatus;
       
   726         CFreestyleEmailUiAppUi& iAppUi;
       
   727         RTelServer iServer;
       
   728         RMobilePhone iPhone;
       
   729         RMobilePhone::TMobilePhoneRegistrationStatus iRegisterationStatus;
       
   730         RTelServer::TPhoneInfo iPhoneInfo;
       
   731     };
       
   732 
       
   733 
       
   734 
       
   735 #endif // __FREESTYLEEMAILUI_APPUI_H__
       
   736