messagingappbase/mce/inc/MceMainViewListView.h
changeset 0 72b543305e3a
child 12 caea42e26caa
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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 
       
    61     public:  // Constructors and destructor
       
    62 
       
    63         /**
       
    64         * Two-phased constructor.
       
    65         */
       
    66         static CMceMainViewListView* NewL(
       
    67             CMsvSessionPtr aSession,
       
    68             CMceSessionHolder& aSessionHolder,
       
    69             CMceBitmapResolver& aBitmapResolver );
       
    70 
       
    71         /**
       
    72         * Destructor.
       
    73         */
       
    74         virtual ~CMceMainViewListView();
       
    75 
       
    76     public: // new function
       
    77 
       
    78         /**
       
    79         * Sets item id (from msgs) to be selected when mce main view is activated.
       
    80         * Called by message list view when closing.
       
    81         * @param: aFolderId: id of the folder to be selected
       
    82         */
       
    83         void SetSelectedFolderId( TMsvId aFolderId );
       
    84 
       
    85         /**
       
    86         * Sets selection so that Delivery reports item is selected next time
       
    87         * main view is activated.
       
    88         */
       
    89         void SetDeliveryReportsSelected( );
       
    90 
       
    91         /**
       
    92         * Set special MSK button
       
    93         */
       
    94         void SetSpecialMSKButtonL(TInt aResourceId);        
       
    95 
       
    96         /**
       
    97         * Should be called by mce after message server startup.
       
    98         * This adds view to session observer list and creates needed CMsvEntries.
       
    99         */
       
   100         virtual void HandleMsgServerStartupL();
       
   101 
       
   102         /**
       
   103         * Returns pointer to list container.
       
   104         * @return Pointer to list container
       
   105         */
       
   106         CMceMainViewListContainer* ListContainer() const;
       
   107         
       
   108         /**
       
   109         * 
       
   110         */
       
   111         void HandleClientRectChange();        
       
   112         
       
   113         /**
       
   114         * Reconstructs main view folder list
       
   115         */
       
   116         void ConstructMainViewL();
       
   117         
       
   118     public:     // Functions from base classes
       
   119     
       
   120     
       
   121         /**
       
   122         * From CAknView
       
   123         */
       
   124         TUid Id() const;
       
   125 
       
   126         /**
       
   127         * From CAknView
       
   128         */
       
   129         void DoActivateL(
       
   130             const TVwsViewId& aPrevViewId,
       
   131             TUid aCustomMessageId,
       
   132             const TDesC8& aCustomMessage );
       
   133 
       
   134         /**
       
   135         * From CAknView
       
   136         */
       
   137         void DoDeactivate();
       
   138 
       
   139         /**
       
   140         * From CAknView
       
   141         */
       
   142         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   143 
       
   144         /**
       
   145         * From MEikCommandObserver
       
   146         */
       
   147         void HandleCommandL(TInt aCommand);
       
   148 
       
   149         /**
       
   150         * From MEikCommandObserver
       
   151         */
       
   152         virtual void ProcessCommandL(TInt aCommand);
       
   153 
       
   154         /**
       
   155         * From MMsvSessionObserver
       
   156         */
       
   157         void HandleSessionEventL(
       
   158             TMsvSessionEvent aEvent,
       
   159             TAny* aArg1,
       
   160             TAny* aArg2,
       
   161             TAny* aArg3 );
       
   162 
       
   163         /**
       
   164         * From MMceMainViewListItemArrayObserver
       
   165         */
       
   166         virtual void MceListItemArrayChangedL( );
       
   167 
       
   168     protected:  // Functions from base classes
       
   169 
       
   170         /**
       
   171         * From MEikListBoxObserver
       
   172         */
       
   173         void HandleListBoxEventL(
       
   174             CEikListBox* aListBox,
       
   175             TListBoxEvent aEventType);
       
   176 
       
   177     private:
       
   178 
       
   179         /**
       
   180         * Constructor is private.
       
   181         */
       
   182         CMceMainViewListView(
       
   183             CMsvSessionPtr aSession,
       
   184             CMceSessionHolder& aSessionHolder,
       
   185             CMceBitmapResolver& aBitmapResolver );
       
   186 
       
   187         /**
       
   188         * By default Symbian OS constructor is private.
       
   189         */
       
   190         void ConstructL();
       
   191 
       
   192         /**
       
   193         * When user wants to open some folder then this is called.
       
   194         * Handles folder opening and extra opens such as CBS launching, creating
       
   195         * remote mailbox if not mailboxes.
       
   196         */
       
   197         void ChangeViewL();
       
   198 
       
   199         /**
       
   200         * Adds extra items to the list array:
       
   201         * "Write message", "Delivery reports", "No remote mailboxes"
       
   202         */
       
   203         void AddExtraItemsL();
       
   204 
       
   205         /**
       
   206         * Creates containers etc. after msv session is ready.
       
   207         */
       
   208         void CreateContainerAndActivateL();
       
   209 
       
   210         /**
       
   211         * Finds changed folder's index in main view list.
       
   212         * For example, if documents\subfolder is change then this finds an
       
   213         * index for the documents and changes its bitmap index to KErrNotFound
       
   214         * @param aChangedFolderId: id of the changed folder.
       
   215         */
       
   216         void CheckMainViewBitmapL( TMsvId aChangedFolderId ) const;
       
   217 
       
   218         /**
       
   219         * Changes all the bitmap indexes in mainview to KErrNotFound.
       
   220         */
       
   221         void ResetBitmapsL() const;
       
   222         
       
   223         /**
       
   224         * Starts application when extra item is selected from the 
       
   225         * main view list.
       
   226         */
       
   227         void StartAppL( TInt aCommandId );
       
   228 
       
   229         /**
       
   230         * Counts how many mailboxes with unread messages there is
       
   231         * @param aFirstMailboxId: id of the first mailbox with unread messages, 
       
   232         *    0 if no mailboxes with unread messages
       
   233         * @return Number of mailboxes with unread messages
       
   234         * @since 3.1
       
   235         */
       
   236         TInt MailboxWithUnreadMessagesL( TMsvId& aFirstMailboxId );
       
   237 
       
   238 		/**
       
   239 		* Input parameter list for AIW plugin
       
   240 		*/
       
   241         CAiwGenericParamList* AiwSyncParamListLC(TInt aId, const TDesC& aText);
       
   242 
       
   243     private:    // Data
       
   244         CMceMainViewListContainer*      iMsgListContainer;
       
   245 
       
   246         CMsvSessionPtr          iSession;
       
   247         CMsvEntry*              iFolderEntry;
       
   248 
       
   249         CMceSessionHolder&      iSessionHolder;
       
   250 
       
   251         CMceBitmapResolver&     iBitmapResolver;
       
   252 
       
   253         TBool                   iMceViewActivated;
       
   254         TBool                   iMsvSessionReady;
       
   255         
       
   256         CAiwServiceHandler*		iAiwServiceHandler;
       
   257         TMceFlags               iListViewFlags;
       
   258 
       
   259         TMsvId 					iCurrentItemId;
       
   260 
       
   261         CMceUi*                 iMceUi;
       
   262 
       
   263         TInt    iSelectedIndex; // selection before deactivated
       
   264         TInt    iTopItemIndex; // top item before deactivated
       
   265         TMsvId  iSelectionFolderId;
       
   266         TBool   iDrawListbox;
       
   267         CMceMainViewEmptyListContainer* iEmptyListContainer;
       
   268         TInt    iPerformOperationAfterMsgStart; // 0 when do nothing, KMceShowMail or KMceShowAudioMessage if activated before msg started.
       
   269         // ETrue if MCE integration feature is ON. In practice, this means
       
   270         // that S60 mailboxes are hided from MCE main view
       
   271         TBool iEmailClientIntegration;
       
   272        
       
   273         // ETrue if Selectable Default Email feature is on
       
   274         TBool iSelectableEmail;
       
   275 
       
   276         // Id of the email application (other than platform email application)
       
   277         TInt iMtmPluginId;
       
   278         
       
   279         /**
       
   280          * CMail Changes, it will be True if 
       
   281          * KFeatureIdFfEmailFramework is enabled
       
   282          */
       
   283         TBool  iEmailFramework;        
       
   284     };
       
   285 
       
   286 #endif
       
   287 
       
   288 // End of file