logsui/AppSrc/CLogsEventListView.h
changeset 0 e686773b3f54
child 21 9da50d567e3c
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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 *     Logs application "Event list" view class implementation
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef     __Logs_App_CLogsEventListView_H__
       
    21 #define     __Logs_App_CLogsEventListView_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include "CLogsBaseView.h"
       
    25 #include "LogsEng.hrh"
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // MACROS
       
    30 
       
    31 // DATA TYPES
       
    32 
       
    33 // FUNCTION PROTOTYPES
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CEikMenuPane;
       
    37 class CLogsEventListControlContainer;
       
    38 class MLogsStateHolder;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43  * Logs application "Event list" view class implementation.
       
    44  */
       
    45 class   CLogsEventListView :    public  CLogsBaseView
       
    46     {
       
    47     public:  // interface
       
    48         /**
       
    49          *  Standard creation function. Creates and returns a new object
       
    50          *  of this class.
       
    51          *
       
    52          *  @return The new view object.
       
    53          */
       
    54         static CLogsEventListView* NewL();
       
    55 
       
    56         /**
       
    57          *  Destructor.
       
    58          */
       
    59         ~CLogsEventListView();
       
    60 
       
    61      private:
       
    62 
       
    63         /**
       
    64          *  Default constructor
       
    65          */
       
    66         CLogsEventListView();
       
    67 
       
    68         /**
       
    69          *   Constructor, second phase. 
       
    70          */
       
    71         void ConstructL();
       
    72 
       
    73         
       
    74     public:  // from CAknView
       
    75         /**
       
    76          *  Framework calls to init menu items.
       
    77          *
       
    78          *  @param aResourceId   resource read
       
    79          *  @param aMenuPane     menu pane
       
    80          */ 
       
    81         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    82 
       
    83     private:  // from CAknView
       
    84         /**
       
    85          * Returns the ID of the view.
       
    86          * @return view id
       
    87          */
       
    88         TUid Id() const;
       
    89 
       
    90        /**
       
    91         *  Called when the client rectangle of this view changes
       
    92         */
       
    93         void HandleClientRectChange();
       
    94         
       
    95        /**
       
    96         * Draws the listbox.
       
    97         */
       
    98         void DrawComponents();
       
    99 
       
   100         /**
       
   101          *  Called by the framework when this view is activated.
       
   102          *
       
   103          *  @param aPrevViewId      This is ID for previous view.
       
   104          *  @param aCustomMessageId ID of the custom message. Not used.
       
   105          *  @param aCustomMessage   custom message. Not used.
       
   106          */
       
   107         void DoActivateL( const TVwsViewId& aPrevViewId,
       
   108                           TUid aCustomMessageId,
       
   109                           const TDesC8& aCustomMessage );
       
   110 
       
   111         /**
       
   112          *  Called by the framework when this view is deactivated.
       
   113          */
       
   114         void DoDeactivate();
       
   115         
       
   116 
       
   117     public:
       
   118 
       
   119         /**
       
   120          *  Currently used filter
       
   121          *
       
   122          *  @return current filter
       
   123          */
       
   124 
       
   125         TLogsFilter CurrentFilter() const;
       
   126 
       
   127         /**
       
   128          *  State of underlying model
       
   129          *
       
   130          *  @return state of model
       
   131          */
       
   132         TLogsState State() const;
       
   133     
       
   134     public: // from MEikCommandObserver
       
   135         /**
       
   136          *  Handles the view specific commands.
       
   137          *
       
   138          *  @param aCommandId This is an id for command.
       
   139          *                    Most of the commands are forwarded to LogAppUI.
       
   140          */
       
   141         void HandleCommandL( TInt aCommand );
       
   142         
       
   143         /**
       
   144          * Overrides the baseclass handler
       
   145          * 
       
   146          * @param aCommand	The id of the command
       
   147          */   
       
   148         void ProcessCommandL( TInt aCommand ); 
       
   149         
       
   150         /**
       
   151          * Restore original Logs title pane text according to current view.
       
   152          * Calls CLogsBaseControlContainer::SetTitlePaneTextToDefaultL which
       
   153          * does the actual work.
       
   154          */
       
   155         void ChangeTitlePaneTextToDefaultL();
       
   156                
       
   157     public: // from MLogsKeyProcessor
       
   158         TBool ProcessKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   159 
       
   160     public: // from MLogsModelObserver
       
   161         void StateChangedL( MLogsStateHolder* aHolder ); 
       
   162            
       
   163     private:
       
   164 
       
   165         /**
       
   166          *  Initialize filter popup view.
       
   167          *
       
   168          *  @return Index of selected filter.
       
   169          */
       
   170         TLogsFilter InitFilterPopupListL();
       
   171 
       
   172         /**
       
   173          *  Makes filter list's one line with the current information
       
   174          *
       
   175          *  @param  aItems              Array where to put the line information
       
   176          *  @param  aFirstResourceText  First line's resource id
       
   177          */
       
   178         void AddOneListBoxTextLineL( CDesCArrayFlat* aItems,
       
   179                                      TInt aResourceText );
       
   180 
       
   181         /**
       
   182          *  Function clears all the events from log db.
       
   183          */
       
   184         void CmdClearListL();
       
   185 
       
   186         /**
       
   187          *  Function filters the events from log db.
       
   188          */
       
   189         void CmdFilterL();
       
   190 
       
   191     private:  // data
       
   192 
       
   193         /// Own:  control container
       
   194         CLogsEventListControlContainer* iContainer;
       
   195         
       
   196         /// Own:
       
   197         TLogsFilter iCurrentFilter;
       
   198 
       
   199         /// Own:
       
   200         TLogsState iState;
       
   201         
       
   202         /// Own:
       
   203         TBool iClearListInProgress;
       
   204 
       
   205 #ifdef _DEBUG // for performance evaluation
       
   206         /// Own: view construction time
       
   207         TTime iCreationTime;
       
   208         /// Own: construction time calculated
       
   209         TBool iCreationTimeCalculated;
       
   210 #endif
       
   211 
       
   212     };
       
   213 
       
   214 #endif  // __Logs_App_CLogsEventListView_H__
       
   215 
       
   216 // End of File