logsui/EngineInc/CLogsModel.h
changeset 0 e686773b3f54
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 *     Abstract base class for logs model.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CLogsModel_H_
       
    21 #define __CLogsModel_H_
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <f32file.h>
       
    26 #include "MLogsModel.h"
       
    27 #include "MLogsObserver.h"
       
    28 #include "MLogsStateHolder.h"
       
    29 #include "TLogsEventStrings.h"
       
    30 
       
    31 // MACROS
       
    32 
       
    33 // DATA TYPES
       
    34 
       
    35 // FUNCTION PROTOTYPES
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class MLogsStateHolder;
       
    39 class MLogsEvent;
       
    40 class MLogsReader;
       
    41 class MLogsEventWrapper;
       
    42 class MLogsEventArray;
       
    43 class CLogsEngine;
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48  *	Defines abstract interface for Logs model
       
    49  */
       
    50 class CLogsModel :  public CBase,
       
    51                     public MLogsModel,
       
    52                     public MLogsObserver,
       
    53                     public MLogsStateHolder
       
    54     {
       
    55     public:
       
    56         /**
       
    57          * EPOC constructor. 
       
    58          *
       
    59          * @param aFsSession   ref. to file server session
       
    60          * @param aModel model type
       
    61          * @param aStrings     log client constants
       
    62          * @return model object
       
    63          */
       
    64         static CLogsModel* NewL( RFs& aFsSession, TLogsModel aModel,
       
    65                             TLogsEventStrings& aStrings, CLogsEngine* aLogsEngine );
       
    66         /**
       
    67          *  Destructor
       
    68          */
       
    69         ~CLogsModel();
       
    70 
       
    71     private:
       
    72         /**
       
    73          * EPOC constructor. 
       
    74          */
       
    75         void ConstructL();
       
    76         
       
    77         /**
       
    78          * C++ constructor. 
       
    79          *
       
    80          * @param aFsSession   ref. to file server session
       
    81          * @param aModel model type
       
    82          * @param aStrings     log client constants
       
    83          */
       
    84         CLogsModel( RFs& aFsSession, 
       
    85                     TLogsModel aModel, 
       
    86                     TLogsEventStrings& aStrings, 
       
    87                     CLogsEngine* aLogsEngineRef );
       
    88 
       
    89     private:
       
    90 
       
    91     public: // from MLogsModel
       
    92 		void Delete( TInt aIndex );
       
    93         TInt Count();
       
    94         const MLogsEventGetter* At( TInt aIndex );
       
    95         void SetObserver( MLogsObserver* aObserver );
       
    96         void DoActivateL( TDoActivate aDoActivate );  
       
    97         void DoDeactivate( TClearMissedCalls aClearMissedCalls,
       
    98                            TDoDeactivate aDisconnectDb  );  
       
    99         void Reset();
       
   100         void ConfigureL( const MLogsReaderConfig* aConfig );
       
   101         void KickStartL( TBool aReset );
       
   102 
       
   103     public: // from MLogsStateHolder
       
   104         TLogsState State() const;
       
   105 
       
   106     public: // from MLogsObserver
       
   107         void StateChangedL( MLogsStateHolder* aHolder );
       
   108 
       
   109     private: // data
       
   110 
       
   111         /// Ref: File server session
       
   112         RFs& iFsSession;
       
   113 
       
   114         /// Own: model type
       
   115         TLogsModel iModel;
       
   116 
       
   117         /// Ref: log strings
       
   118         TLogsEventStrings& iStrings;
       
   119 
       
   120         /// Own: Event array
       
   121         MLogsEventArray* iEventArray;
       
   122 
       
   123         /// Own: MLogsReader
       
   124         MLogsReader* iReader;
       
   125 
       
   126         /// Own: wrapper for CLogsGetEvent
       
   127         MLogsEventWrapper* iWrapper;
       
   128 
       
   129         /// Ref: Observer
       
   130         MLogsObserver* iObserver;
       
   131 
       
   132         /// own: state for observer
       
   133         TLogsState      iState;
       
   134         
       
   135         /// Ref: Log db engine        
       
   136         CLogsEngine* iLogsEngineRef;         
       
   137     };
       
   138 
       
   139             
       
   140 #endif
       
   141 
       
   142 // End of File  __CLogsModel_H_