|
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 * Messaging Centre application's engine class that reads events from |
|
16 * log DB. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef __Mce_Engine_CMceLogEngineReader_H__ |
|
23 #define __Mce_Engine_CMceLogEngineReader_H__ |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> |
|
27 #include <f32file.h> |
|
28 #include <logviewchangeobserver.h> |
|
29 #include "MceLogEngine.h" |
|
30 #include "MceLogEngine.hrh" |
|
31 |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CLogClient; |
|
35 class CLogViewEvent; |
|
36 class CMceLogEngine; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Implements the functionality to read log events from DB. |
|
42 */ |
|
43 class CMceLogEngineReader : public CActive, public MLogViewChangeObserver |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Standard creation function. |
|
48 * |
|
49 * @param aObserver Pointer to observer. |
|
50 * @return pointer to CMceLogEngineReader instance. |
|
51 */ |
|
52 static CMceLogEngineReader* NewL(CMceLogEngine* aObserver); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 ~CMceLogEngineReader(); |
|
58 |
|
59 /** |
|
60 * Starts reading the entries from log database. |
|
61 * |
|
62 * @param aFirstime If ETrue reading is started from setting the filter. |
|
63 */ |
|
64 void StartReadingL(); |
|
65 |
|
66 /** |
|
67 * Clear DR list |
|
68 * |
|
69 */ |
|
70 void ClearDrListL(); |
|
71 |
|
72 private: |
|
73 /** |
|
74 * Second phase of construction. |
|
75 */ |
|
76 void ConstructL(); |
|
77 |
|
78 /** |
|
79 * Default constructor. |
|
80 */ |
|
81 CMceLogEngineReader(); |
|
82 |
|
83 /** |
|
84 * Constructor. |
|
85 * |
|
86 * @param aObserver Pointer to observer. |
|
87 */ |
|
88 CMceLogEngineReader( CMceLogEngine* aObserver ); |
|
89 |
|
90 /** |
|
91 * Set filters to fetch only events of certain type. |
|
92 */ |
|
93 void SetSpecialFilterL(); |
|
94 |
|
95 |
|
96 private: // From CActive |
|
97 void DoCancel(); |
|
98 void RunL(); |
|
99 TInt RunError(TInt aError); |
|
100 |
|
101 public: // from MLogViewChangeObserver |
|
102 void HandleLogViewChangeEventAddedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); |
|
103 void HandleLogViewChangeEventChangedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); |
|
104 void HandleLogViewChangeEventDeletedL(TLogId aId, TInt aViewIndex, TInt aChangeIndex, TInt aTotalChangeCount); |
|
105 |
|
106 private: // data |
|
107 /// Ref: Logs's engine |
|
108 CMceLogEngine* iObserver; |
|
109 /// Own: File server session |
|
110 RFs iFsSession; |
|
111 /// Own: Log engine |
|
112 CLogClient* iLogClient; |
|
113 /// Own: View to filtered events. |
|
114 CLogViewEvent* iLogViewEvent; |
|
115 /// Own: Reader's state |
|
116 TMceLogEngineReaderState iReaderState; |
|
117 /// Own: Filterlist |
|
118 CLogFilterList* iFilterList; |
|
119 /// Own: How many events has been read. |
|
120 TInt iEventCounter; |
|
121 /// Own: Indicator if observer's array was reset |
|
122 TBool iArrayReset; |
|
123 /// Own: Amount of event in view |
|
124 TInt iEventsInView; |
|
125 }; |
|
126 |
|
127 #endif // __Mce_Engine_CMceLogEngineReader_H__ |
|
128 |
|
129 // End of file |