logsui/AppSrc/CLogsRecentListView.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
child 85 38bb213f60ba
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     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 *     View for recent lists
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CLogsRecentListView_H__
       
    21 #define __CLogsRecentListView_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <coemain.h>
       
    25 #include "CLogsBaseView.h"
       
    26 #include "MLogsExtObserver.h"
       
    27 #include "MLogsModel.h"
       
    28 
       
    29 #include "LogsEng.hrh"
       
    30 #include "Logs.hrh"
       
    31 
       
    32 // CONSTANTS
       
    33 
       
    34 // MACROS
       
    35 
       
    36 // DATA TYPES
       
    37 
       
    38 // FUNCTION PROTOTYPES
       
    39 
       
    40 // FORWARD DECLARATIONS
       
    41 class CLogsRecentListControlContainer;
       
    42 class CLogsViewGlobals;
       
    43 class MLogsViewExtension;
       
    44 class MLogsEventGetter;
       
    45 
       
    46 // CLASS DECLARATION
       
    47 
       
    48 /**
       
    49 *	Abstract base class for recent views
       
    50 */
       
    51 class CLogsRecentListView :     public CLogsBaseView,
       
    52                                 public MLogsExtObserver,
       
    53                                 public MCoeForegroundObserver
       
    54     {
       
    55     public:  // Constructors and destructor
       
    56         
       
    57         enum TLogsDrawNow
       
    58             {
       
    59             ELogsDrawNow,
       
    60             ELogsDontDraw
       
    61             };
       
    62         /**
       
    63          * Symbian OS constructor
       
    64          * @param recentlist type
       
    65          * @return new object
       
    66          */
       
    67 
       
    68         static CLogsRecentListView* NewL( TLogsModel aModel );
       
    69 
       
    70         /**
       
    71          * Destructor.
       
    72          */
       
    73         virtual ~CLogsRecentListView();
       
    74         
       
    75         /**
       
    76          * Recentlist state
       
    77          */
       
    78         TLogsState State() const;
       
    79 
       
    80         /**
       
    81          * Getter for recent type
       
    82          *
       
    83          * @return type of recent list (model)
       
    84          */
       
    85         TLogsModel RecentListType() const;
       
    86 
       
    87     public: // from MLogsObserver
       
    88         void StateChangedL( MLogsStateHolder* aHolder ); 
       
    89 
       
    90     public: // from MLogsExtObserver
       
    91         void ExtStateChangedL();
       
    92 
       
    93     public: // from MLogsKeyProcessor
       
    94         TBool ProcessKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
    95 
       
    96        	/**
       
    97          * Overrides the baseclass handler
       
    98          * 
       
    99          * @param aIndex	The index of the item tapped
       
   100          */ 
       
   101 		void ProcessPointerEventL(TInt aIndex);
       
   102 
       
   103     public: // CAknView
       
   104         void HandleCommandL( TInt aCommandId );
       
   105         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   106         
       
   107     
       
   108         void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
       
   109         void DoDeactivate();
       
   110         TUid Id() const;
       
   111         
       
   112        /**
       
   113         *  Called when the client rectangle of this view changes
       
   114         */
       
   115         void HandleClientRectChange();
       
   116         
       
   117        /**
       
   118         * Draws the listbox.
       
   119         */
       
   120         void DrawComponents();
       
   121         
       
   122        /**
       
   123         * Restore original Logs title pane text according to current view.
       
   124         * Calls CLogsBaseControlContainer::SetTitlePaneTextToDefaultL which
       
   125         * does the actual work.
       
   126         */
       
   127         void ChangeTitlePaneTextToDefaultL();
       
   128         
       
   129        /**
       
   130         * Store the event list current focused item information
       
   131         */
       
   132         void StoreEvenListCurrentFocus();
       
   133         
       
   134         /**
       
   135          * Early detection of view activation.
       
   136          * Overrides the baseclass implementation calls CAknView::ViewDeactivated().
       
   137          */
       
   138         void ViewDeactivated();
       
   139 
       
   140         /**
       
   141          * Overrides the baseclass handler
       
   142          * 
       
   143          * @param aCommand	The id of the command
       
   144          */ 
       
   145         void ProcessCommandL( TInt aCommand );
       
   146     
       
   147 
       
   148     public: // from MCoeForegroundObserver
       
   149 		void HandleGainingForeground();
       
   150 		void HandleLosingForeground();
       
   151 		
       
   152     public: // From MAiwNotifyCallback
       
   153         TInt HandleNotifyL( TInt aCmdId,
       
   154             		        TInt aEventId,
       
   155             		        CAiwGenericParamList& aEventParamList,
       
   156             		        const CAiwGenericParamList& aInParamList);
       
   157 		
       
   158     private:
       
   159 
       
   160         /**
       
   161         * C++ default constructor.
       
   162         * @param recentlist type
       
   163         */
       
   164         CLogsRecentListView( TLogsModel aModel );
       
   165 
       
   166         /**
       
   167         * By default Symbian OS constructor is private.
       
   168         * Calls AknViews BaseConstruct
       
   169         */
       
   170         void ConstructL();
       
   171         
       
   172         /**
       
   173          * Delayed constructor
       
   174          *
       
   175          * Performs time consuming construction operations once. Calling this is needed before anything
       
   176          * needing objects constructed here can be used (e.g. pressing Send key or launching a command from
       
   177          * ui's menu.        
       
   178          */
       
   179         // void ConstructDelayedL();        
       
   180 
       
   181         /**
       
   182          * Getter for view id
       
   183          *
       
   184          * @return Return view id
       
   185          */
       
   186         TLogsViewIds LogsCurrentRecentViewId() const;
       
   187 
       
   188         /**
       
   189          * Retrieves event relating current selection of listbox.
       
   190          * @return Current event or NULL
       
   191          */
       
   192         const MLogsEventGetter* CurrentEvent();
       
   193 
       
   194         /**
       
   195          * Clear listbox contents
       
   196          */
       
   197         void CmdClearRecentListL();
       
   198 
       
   199         /**
       
   200          * Delete selected recent event from recent list
       
   201          */
       
   202         void CmdDeleteEventL();
       
   203 
       
   204         /**
       
   205          *  Overwrites Option_Exit CBA with Option_Back CBA 
       
   206          *  @return ETrue if cba changed else return EFalse
       
   207          */
       
   208         TBool ChangeCba2ToBackL();
       
   209 
       
   210         /**
       
   211          *  Overwrites Option_Back CBA with Option_Exit CBA
       
   212          *
       
   213          *  @param  aDrawNow draw now or just change command
       
   214          *  @return ETrue if cba changed else return EFalse
       
   215          */
       
   216         TBool ChangeCba2ToExitL(TLogsDrawNow aDrawNow);
       
   217         
       
   218         /**
       
   219         *   Helper function to check wether event reading has
       
   220         *   finished.
       
   221         */
       
   222         TBool ReadingFinished();
       
   223 
       
   224         /**
       
   225         *   Helper function to check wether view deactivated operation may be
       
   226         *   ignored to aviod the list flicking, see EJZO-7RJB3V
       
   227         */
       
   228         TBool IgnoreViewDeactivatedOperation();
       
   229     
       
   230         /**
       
   231          * Early detection of view activation.
       
   232          * Overrides the baseclass implementation calls CAknView::ViewActivatedL().
       
   233          */
       
   234         void ViewActivatedL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
       
   235     
       
   236     private:    // Data
       
   237         /// Own: view's control container
       
   238         CLogsRecentListControlContainer* iContainer;
       
   239 
       
   240         /// Own: exit  cba text
       
   241         HBufC* iExitCbaButton;
       
   242 
       
   243          /// Own: back cba text
       
   244         HBufC* iBackCbaButton;  
       
   245         
       
   246         /// Own:
       
   247         TLogsState iState;        
       
   248 
       
   249 #ifdef _DEBUG // for performance evaluation
       
   250         /// Own: view construction time
       
   251         TTime iCreationTime;
       
   252         /// Own: construction time calculated
       
   253         TBool iCreationTimeCalculated;
       
   254 #endif
       
   255 
       
   256         /// Own:
       
   257         CLogsViewGlobals* iViewGlobal;
       
   258 
       
   259         /// Own:
       
   260         MLogsViewExtension* iViewExtension;
       
   261         
       
   262         
       
   263         /// Own: text for send SMS menu item
       
   264         //HBufC* iSendSMSText;
       
   265         /// Own: text for send MMS menu item
       
   266         //HBufC* iSendMMSText;
       
   267         
       
   268         TInt        iEventListCurrentNoChange;//Points to current event in special Logs processing when Logs has lost 
       
   269                                               //foreground and hence iEventListCurrent (in base class) may already 
       
   270                                               //have been set to KErrNotFound. Typical case is adding entry to phonebook.
       
   271         MLogsModel::TDoActivate iResetAndRefreshOnGainingForeground;
       
   272         
       
   273     };
       
   274 
       
   275 #endif // __CLogsRecentListView_H__
       
   276             
       
   277 // End of File