messagingappbase/mce/inc/MceMainViewListView.h
branchRCL_3
changeset 27 7fdbb852d323
child 28 fc3320e39880
equal deleted inserted replaced
26:ebe688cedc25 27:7fdbb852d323
       
     1 /*
       
     2 * Copyright (c) 2002 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:  
       
    15 *     Main view of the Mce.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MCEMAINVIEWLISTVIEW_H
       
    22 #define MCEMAINVIEWLISTVIEW_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <aknview.h>    // CAknView
       
    26 #include <msvapi.h>
       
    27 
       
    28 #include <AiwServiceHandler.h>
       
    29 
       
    30 //#include "MceBaseListView.h"
       
    31 #include "MceListItem.h"
       
    32 #include "MceMainViewListItemArray.h"
       
    33 
       
    34 #include "mcetemplate.h"
       
    35 
       
    36 #include <bldvariant.hrh>
       
    37 
       
    38 #include <ImumInHealthServices.h>
       
    39 
       
    40 // FORWARD DECLARATIONS
       
    41 
       
    42 class CMsvSession;
       
    43 class CMceUi;
       
    44 class CMceSessionHolder;
       
    45 class CMceBitmapResolver;
       
    46 class CMceMainViewEmptyListContainer;
       
    47 class CMceMainViewListContainer;
       
    48 
       
    49 // CLASS DECLARATION
       
    50 
       
    51 /**
       
    52 *  Main view of the Mce.
       
    53 */
       
    54 class CMceMainViewListView :
       
    55     public CAknView,
       
    56     public MMceMainViewListItemArrayObserver,
       
    57     public MEikListBoxObserver,
       
    58     public MMsvSessionObserver
       
    59     {
       
    60     public:
       
    61         
       
    62     public:  // Constructors and destructor
       
    63 
       
    64         /**
       
    65         * Two-phased constructor.
       
    66         */
       
    67         static CMceMainViewListView* NewL(
       
    68             CMsvSessionPtr aSession,
       
    69             CMceSessionHolder& aSessionHolder,
       
    70             CMceBitmapResolver& aBitmapResolver );
       
    71 
       
    72         /**
       
    73         * Destructor.
       
    74         */
       
    75         virtual ~CMceMainViewListView();
       
    76 
       
    77     public: // new function
       
    78 
       
    79         /**
       
    80         * Sets item id (from msgs) to be selected when mce main view is activated.
       
    81         * Called by message list view when closing.
       
    82         * @param: aFolderId: id of the folder to be selected
       
    83         */
       
    84         void SetSelectedFolderId( TMsvId aFolderId );
       
    85 
       
    86         /**
       
    87         * Sets selection so that Delivery reports item is selected next time
       
    88         * main view is activated.
       
    89         */
       
    90         void SetDeliveryReportsSelected( );
       
    91 
       
    92         /**
       
    93         * Set special MSK button
       
    94         */
       
    95         void SetSpecialMSKButtonL(TInt aResourceId);        
       
    96 
       
    97         /**
       
    98         * Should be called by mce after message server startup.
       
    99         * This adds view to session observer list and creates needed CMsvEntries.
       
   100         */
       
   101         virtual void HandleMsgServerStartupL();
       
   102 
       
   103         /**
       
   104         * Returns pointer to list container.
       
   105         * @return Pointer to list container
       
   106         */
       
   107         CMceMainViewListContainer* ListContainer() const;
       
   108         
       
   109         /**
       
   110         * 
       
   111         */
       
   112         void HandleClientRectChange();        
       
   113         
       
   114         /**
       
   115         * Reconstructs main view folder list
       
   116         */
       
   117         void ConstructMainViewL();
       
   118         
       
   119     public:     // Functions from base classes
       
   120     
       
   121     
       
   122         /**
       
   123         * From CAknView
       
   124         */
       
   125         TUid Id() const;
       
   126 
       
   127         /**
       
   128         * From CAknView
       
   129         */
       
   130         void DoActivateL(
       
   131             const TVwsViewId& aPrevViewId,
       
   132             TUid aCustomMessageId,
       
   133             const TDesC8& aCustomMessage );
       
   134 
       
   135         /**
       
   136         * From CAknView
       
   137         */
       
   138         void DoDeactivate();
       
   139 
       
   140         /**
       
   141         * From CAknView
       
   142         */
       
   143         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   144 
       
   145         /**
       
   146         * From MEikCommandObserver
       
   147         */
       
   148         void HandleCommandL(TInt aCommand);
       
   149 
       
   150         /**
       
   151         * From MEikCommandObserver
       
   152         */
       
   153         virtual void ProcessCommandL(TInt aCommand);
       
   154 
       
   155         /**
       
   156         * From MMsvSessionObserver
       
   157         */
       
   158         void HandleSessionEventL(
       
   159             TMsvSessionEvent aEvent,
       
   160             TAny* aArg1,
       
   161             TAny* aArg2,
       
   162             TAny* aArg3 );
       
   163 
       
   164         /**
       
   165         * From MMceMainViewListItemArrayObserver
       
   166         */
       
   167         virtual void MceListItemArrayChangedL( );
       
   168         
       
   169         /**
       
   170          * Called Main view refresh is happening 
       
   171          * and need to know flick is ON\OFF
       
   172          * @return ETrue if flick is ON 
       
   173          * otherwise OFF 
       
   174          */
       
   175         TBool MceListItemArrayFlickEvent();
       
   176 
       
   177     protected:  // Functions from base classes
       
   178 
       
   179         /**
       
   180         * From MEikListBoxObserver
       
   181         */
       
   182         void HandleListBoxEventL(
       
   183             CEikListBox* aListBox,
       
   184             TListBoxEvent aEventType);
       
   185 
       
   186     private:
       
   187 
       
   188         /**
       
   189         * Constructor is private.
       
   190         */
       
   191         CMceMainViewListView(
       
   192             CMsvSessionPtr aSession,
       
   193             CMceSessionHolder& aSessionHolder,
       
   194             CMceBitmapResolver& aBitmapResolver );
       
   195 
       
   196         /**
       
   197         * By default Symbian OS constructor is private.
       
   198         */
       
   199         void ConstructL();
       
   200 
       
   201         /**
       
   202         * When user wants to open some folder then this is called.
       
   203         * Handles folder opening and extra opens such as CBS launching, creating
       
   204         * remote mailbox if not mailboxes.
       
   205         */
       
   206         void ChangeViewL();
       
   207 
       
   208         /**
       
   209         * Adds extra items to the list array:
       
   210         * "Write message", "Delivery reports", "No remote mailboxes"
       
   211         */
       
   212         void AddExtraItemsL();
       
   213 
       
   214         /**
       
   215         * Creates containers etc. after msv session is ready.
       
   216         */
       
   217         void CreateContainerAndActivateL();
       
   218 
       
   219         /**
       
   220         * Finds changed folder's index in main view list.
       
   221         * For example, if documents\subfolder is change then this finds an
       
   222         * index for the documents and changes its bitmap index to KErrNotFound
       
   223         * @param aChangedFolderId: id of the changed folder.
       
   224         */
       
   225         void CheckMainViewBitmapL( TMsvId aChangedFolderId ) const;
       
   226 
       
   227         /**
       
   228         * Changes all the bitmap indexes in mainview to KErrNotFound.
       
   229         */
       
   230         void ResetBitmapsL() const;
       
   231         
       
   232         /**
       
   233         * Starts application when extra item is selected from the 
       
   234         * main view list.
       
   235         */
       
   236         void StartAppL( TInt aCommandId );
       
   237 
       
   238         /**
       
   239         * Counts how many mailboxes with unread messages there is
       
   240         * @param aFirstMailboxId: id of the first mailbox with unread messages, 
       
   241         *    0 if no mailboxes with unread messages
       
   242         * @return Number of mailboxes with unread messages
       
   243         * @since 3.1
       
   244         */
       
   245         TInt MailboxWithUnreadMessagesL( TMsvId& aFirstMailboxId );
       
   246 
       
   247 		/**
       
   248 		* Input parameter list for AIW plugin
       
   249 		*/
       
   250         CAiwGenericParamList* AiwSyncParamListLC(TInt aId, const TDesC& aText);
       
   251 
       
   252         /**
       
   253          * Show a confirmation note to the user after successful 
       
   254          * setting of the default view
       
   255          */
       
   256         void ShowConfirmationNoteL( TInt aResourceID );
       
   257        
       
   258         /**
       
   259          *  Set the default view settings    
       
   260          */
       
   261         TBool SetMceDefaultViewL(TBool aVal);
       
   262 
       
   263         /**
       
   264          *  Get the current default view settings    
       
   265          */
       
   266         TInt GetMceDefaultViewL();
       
   267 
       
   268     private:    // Data
       
   269         CMceMainViewListContainer*      iMsgListContainer;
       
   270 
       
   271         CMsvSessionPtr          iSession;
       
   272         CMsvEntry*              iFolderEntry;
       
   273 
       
   274         CMceSessionHolder&      iSessionHolder;
       
   275 
       
   276         CMceBitmapResolver&     iBitmapResolver;
       
   277 
       
   278         TBool                   iMceViewActivated;
       
   279         TBool                   iMsvSessionReady;
       
   280         
       
   281         CAiwServiceHandler*		iAiwServiceHandler;
       
   282         TMceFlags               iListViewFlags;
       
   283 
       
   284         TMsvId 					iCurrentItemId;
       
   285 
       
   286         CMceUi*                 iMceUi;
       
   287 
       
   288         TInt    iSelectedIndex; // selection before deactivated
       
   289         TInt    iTopItemIndex; // top item before deactivated
       
   290         TMsvId  iSelectionFolderId;
       
   291         TBool   iDrawListbox;
       
   292         CMceMainViewEmptyListContainer* iEmptyListContainer;
       
   293         TInt    iPerformOperationAfterMsgStart; // 0 when do nothing, KMceShowMail or KMceShowAudioMessage if activated before msg started.
       
   294         // ETrue if MCE integration feature is ON. In practice, this means
       
   295         // that S60 mailboxes are hided from MCE main view
       
   296         TBool iEmailClientIntegration;
       
   297        
       
   298         // ETrue if Selectable Default Email feature is on
       
   299         TBool iSelectableEmail;
       
   300 
       
   301         // Id of the email application (other than platform email application)
       
   302         TInt iMtmPluginId;
       
   303         
       
   304         /**
       
   305          * CMail Changes, it will be True if 
       
   306          * KFeatureIdFfEmailFramework is enabled
       
   307          */
       
   308         TBool  iEmailFramework;        
       
   309         /**
       
   310          * Flag that shows Flicking status in Main View
       
   311          * ETrue if ON
       
   312          * otherwsie EFalse
       
   313          */
       
   314         TBool                           iFlick; 
       
   315     };
       
   316 
       
   317 #endif
       
   318 
       
   319 // End of file