|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __LOGVIEW_H__ |
|
17 #define __LOGVIEW_H__ |
|
18 |
|
19 // System includes |
|
20 #include <d32dbms.h> |
|
21 #include <logwrap.h> |
|
22 |
|
23 // User includes |
|
24 #include <logcli.h> |
|
25 |
|
26 // Classes referenced |
|
27 class CLogClient; |
|
28 class CLogGetEventClientOp; |
|
29 class CLogPackage; |
|
30 class CLogViewSetupClientOp; |
|
31 class CLogMaintainClientOp; |
|
32 class CLogViewObserver; |
|
33 class CLogFilterList; |
|
34 class CLogFilter; |
|
35 class CLogViewDuplicate; |
|
36 class CLogViewRemoveEventClientOp; |
|
37 class MLogViewChangeObserver; |
|
38 class CLogViewWindow; |
|
39 |
|
40 |
|
41 //********************************** |
|
42 // CLogView |
|
43 //********************************** |
|
44 |
|
45 class CLogView : public CLogActive |
|
46 /** |
|
47 Navigates a view on the log database. |
|
48 |
|
49 The class provides functions for navigating through a set of events and a |
|
50 function to retrieve the event at the current position within the view. |
|
51 |
|
52 The class cannot be instantiated. Further classes are derived from this class |
|
53 to define and construct views on the log database. |
|
54 |
|
55 The set of events in a view are always ordered so that the first event in |
|
56 a view is the most recent. |
|
57 @publishedAll |
|
58 @released |
|
59 */ |
|
60 { |
|
61 public: |
|
62 IMPORT_C ~CLogView(); |
|
63 // |
|
64 public: |
|
65 inline const CLogEvent& Event() const; |
|
66 // |
|
67 IMPORT_C TBool FirstL(TRequestStatus& aStatus); |
|
68 IMPORT_C TBool LastL(TRequestStatus& aStatus); |
|
69 IMPORT_C TBool NextL(TRequestStatus& aStatus); |
|
70 IMPORT_C TBool PreviousL(TRequestStatus& aStatus); |
|
71 // |
|
72 IMPORT_C TInt CountL(); |
|
73 // |
|
74 IMPORT_C void SetFlagsL(TLogFlags aFlags); |
|
75 // |
|
76 protected: |
|
77 CLogView(CLogClient& aClient, TInt aPriority = CActive::EPriorityStandard); |
|
78 void ConstructL(TInt aType, MLogViewChangeObserver* aObserver = NULL); |
|
79 // |
|
80 inline TBool IsValid() const; |
|
81 void DoCancel(); |
|
82 void ReadEventFromWindowL(); |
|
83 void ReawaitForChanges(); |
|
84 TInt LogViewRecordCount() const; |
|
85 // |
|
86 private: |
|
87 TBool NavigateL(TInt aPosition, TRequestStatus& aStatus); |
|
88 void DoRunL(); |
|
89 void PrepareViewChildrenL(); |
|
90 void NotifyLogServerTerminatedL(); |
|
91 |
|
92 // |
|
93 private: |
|
94 CLogEvent* iEvent; |
|
95 TAny* iSpare1; |
|
96 // |
|
97 protected: |
|
98 CLogClient& iClient; |
|
99 CLogPackage* iPackage; |
|
100 TAny* iSpare2; |
|
101 CLogMaintainClientOp* iMaintain; |
|
102 TLogViewId iViewId; |
|
103 TDes8* iData; |
|
104 TBool iValid; |
|
105 CLogViewWindow* iWindow; |
|
106 // |
|
107 private: |
|
108 TInt iType; |
|
109 MLogViewChangeObserver* iLogViewChangeObserver; |
|
110 CLogViewObserver* iLogViewObserver; |
|
111 friend class CLogViewObserver; |
|
112 }; |
|
113 |
|
114 //********************************** |
|
115 // CLogViewEvent |
|
116 //********************************** |
|
117 |
|
118 |
|
119 class CLogViewEvent : public CLogView |
|
120 /** |
|
121 A view on the event log. |
|
122 |
|
123 The events included in the view are defined using a filter that specifies |
|
124 the constraints that all events in the view must satisfy. Filters are specified |
|
125 using one or more CLogFilter objects. |
|
126 |
|
127 @see CLogFilter |
|
128 @see CLogFilterList |
|
129 @publishedAll |
|
130 @released |
|
131 */ |
|
132 { |
|
133 public: |
|
134 IMPORT_C static CLogViewEvent* NewL(CLogClient& aClient, TInt aPriority = CActive::EPriorityStandard); |
|
135 IMPORT_C static CLogViewEvent* NewL(CLogClient& aClient, MLogViewChangeObserver& aObserver, TInt aPriority = CActive::EPriorityStandard); |
|
136 IMPORT_C ~CLogViewEvent(); |
|
137 // |
|
138 public: |
|
139 IMPORT_C TBool SetFilterL(const CLogFilterList& aFilterList, TRequestStatus& aStatus); |
|
140 IMPORT_C TBool SetFilterL(const CLogFilter& aFilter, TRequestStatus& aStatus); |
|
141 IMPORT_C TBool SetFilterParseFilterByFilterL(const CLogFilterList& aFilterList, TRequestStatus& aStatus); |
|
142 // |
|
143 private: |
|
144 CLogViewEvent(CLogClient& aClient, TInt aPriority); |
|
145 void ConstructL(MLogViewChangeObserver* aObserver = NULL); |
|
146 }; |
|
147 |
|
148 //********************************** |
|
149 // CLogViewRecent |
|
150 //********************************** |
|
151 |
|
152 |
|
153 class CLogViewRecent : public CLogView |
|
154 /** |
|
155 A view on a recent event list. |
|
156 @publishedAll |
|
157 @released |
|
158 */ |
|
159 { |
|
160 public: |
|
161 IMPORT_C static CLogViewRecent* NewL(CLogClient& aClient, TInt aPriority = CActive::EPriorityStandard); |
|
162 IMPORT_C static CLogViewRecent* NewL(CLogClient& aClient, MLogViewChangeObserver& aObserver, TInt aPriority = CActive::EPriorityStandard); |
|
163 IMPORT_C ~CLogViewRecent(); |
|
164 // |
|
165 public: |
|
166 IMPORT_C TBool SetRecentListL(TLogRecentList aList, TRequestStatus& aStatus); |
|
167 IMPORT_C TBool SetRecentListL(TLogRecentList aList, const CLogFilter& aFilter, TRequestStatus& aStatus); |
|
168 IMPORT_C TBool SetRecentListL(TLogRecentList aList, const CLogFilterList& aFilterList, TRequestStatus& aStatus); |
|
169 // |
|
170 IMPORT_C TBool DuplicatesL(CLogViewDuplicate& aView, TRequestStatus& aStatus); |
|
171 IMPORT_C TBool DuplicatesL(CLogViewDuplicate& aView, const CLogFilter& aFilter, TRequestStatus& aStatus); |
|
172 IMPORT_C TBool DuplicatesL(CLogViewDuplicate& aView, const CLogFilterList& aFilterList, TRequestStatus& aStatus); |
|
173 IMPORT_C void ClearDuplicatesL(); |
|
174 // |
|
175 IMPORT_C void RemoveL(TLogId aId); |
|
176 IMPORT_C TBool RemoveL(TRequestStatus& aStatus); |
|
177 // |
|
178 inline TLogRecentList RecentList() const; |
|
179 // |
|
180 private: |
|
181 CLogViewRecent(CLogClient& aClient, TInt aPriority); |
|
182 void ConstructL(MLogViewChangeObserver* aObserver = NULL); |
|
183 void DoRunL(); |
|
184 // |
|
185 TBool DoRemoveL(TRequestStatus& aStatus); |
|
186 // |
|
187 private: |
|
188 TLogRecentList iRecentList; |
|
189 TLogRecentList iCurrentList; |
|
190 TPckgBuf<TLogRecentList> iCurrentListBuf; |
|
191 CLogViewRemoveEventClientOp* iRemove; |
|
192 }; |
|
193 |
|
194 //********************************** |
|
195 // CLogViewDuplicate |
|
196 //********************************** |
|
197 |
|
198 class CLogViewDuplicate : public CLogView |
|
199 /** |
|
200 A view of events that are duplicates of an event in a view of recent events. |
|
201 |
|
202 The view is populated through a call to CLogViewRecent::DuplicatesL(). |
|
203 |
|
204 @see CLogViewRecent::DuplicatesL() |
|
205 @see CLogViewRecent |
|
206 @publishedAll |
|
207 @released |
|
208 */ |
|
209 { |
|
210 public: |
|
211 IMPORT_C static CLogViewDuplicate* NewL(CLogClient& aClient, TInt aPriority = CActive::EPriorityStandard); |
|
212 IMPORT_C static CLogViewDuplicate* NewL(CLogClient& aClient, MLogViewChangeObserver& aObserver, TInt aPriority = CActive::EPriorityStandard); |
|
213 IMPORT_C ~CLogViewDuplicate(); |
|
214 // |
|
215 IMPORT_C void RemoveL(TLogId aId); |
|
216 IMPORT_C TBool RemoveL(TRequestStatus& aStatus); |
|
217 // |
|
218 inline TLogId Source() const; |
|
219 // |
|
220 public: |
|
221 // The following are not exported, use CLogViewRecent::DuplicatesL to initialise this view |
|
222 TBool SetEventL(TLogId aId, TRequestStatus& aStatus); |
|
223 TBool SetEventL(TLogId aId, const CLogFilter& aFilter, TRequestStatus& aStatus); |
|
224 TBool SetEventL(TLogId aId, const CLogFilterList& aFilterList, TRequestStatus& aStatus); |
|
225 // |
|
226 private: |
|
227 CLogViewDuplicate(CLogClient& aClient, TInt aPriority); |
|
228 void ConstructL(MLogViewChangeObserver* aObserver = NULL); |
|
229 // |
|
230 TBool DoRemoveL(TRequestStatus& aStatus); |
|
231 // |
|
232 private: |
|
233 TLogId iSourceId; |
|
234 CLogViewRemoveEventClientOp* iRemove; |
|
235 }; |
|
236 |
|
237 #include <logview.inl> |
|
238 |
|
239 #endif |