author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 17 Dec 2009 09:09:50 +0200 | |
changeset 26 | 5d0ec8b709be |
parent 5 | 989d2f495d90 |
permissions | -rw-r--r-- |
5 | 1 |
/* |
2 |
* Copyright (c) 2006-2007 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 the License "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: Includes logging asynchronous core class methods. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef LOGGINGASYNCSERVICE_H |
|
20 |
#define LOGGINGASYNCSERVICE_H |
|
21 |
||
22 |
#include <e32base.h> |
|
23 |
#include <logcli.h> |
|
24 |
#include <logview.h> |
|
25 |
#include <f32file.h> |
|
26 |
#include <logwrap.h> |
|
27 |
||
28 |
enum |
|
29 |
{ |
|
30 |
EAddEvent , |
|
31 |
EAddEventType, |
|
32 |
EDeleteEvent , |
|
33 |
EReadEvents , |
|
34 |
ESleep , |
|
35 |
EGetRecent , |
|
36 |
ENotification , |
|
37 |
EGetEvent, |
|
38 |
EErrorEvent, |
|
39 |
}; |
|
40 |
||
41 |
/** |
|
42 |
* Forward Declaration |
|
43 |
*/ |
|
44 |
||
45 |
class MLoggingCallback ; |
|
46 |
class CLogsEvent ; |
|
47 |
class CLogsFilter ; |
|
48 |
class CLogIter ; |
|
49 |
||
50 |
/** |
|
51 |
* Core class which deals with all the async methods |
|
52 |
*/ |
|
53 |
||
54 |
class CLogAsyncService : public CActive |
|
55 |
{ |
|
56 |
public: |
|
57 |
||
58 |
/** |
|
59 |
* NewL: Two phased construction |
|
60 |
*/ |
|
61 |
||
62 |
IMPORT_C static CLogAsyncService* NewL( MLoggingCallback* aCallback = NULL ) ; |
|
63 |
||
64 |
/** |
|
65 |
* NewLC: Creates an instance of CLogSyncServiceClass |
|
66 |
* Two Phased constructor |
|
67 |
* returns newly allocated object. |
|
68 |
*/ |
|
69 |
||
70 |
static CLogAsyncService* NewLC( MLoggingCallback* aCallback ) ; |
|
71 |
||
72 |
/** |
|
73 |
* Async AddEvent function. adds an Event asynchronously |
|
74 |
* do event database |
|
75 |
* @param aEvent, details of the event to be added to the |
|
76 |
* event database |
|
77 |
*/ |
|
78 |
||
79 |
IMPORT_C void AddL( TUint aTransId ,CLogEvent* aEvent ) ; |
|
80 |
||
81 |
/** |
|
82 |
* Deletes a event from the event database |
|
83 |
* @param aLogId Event id of the event in the database |
|
84 |
* @param aFilter, search criteria for this event in event database |
|
85 |
*/ |
|
86 |
||
87 |
IMPORT_C void Delete( TUint aTransId , TLogId aLogId ) ; |
|
88 |
||
89 |
/** |
|
90 |
* Gets the Events list asynchronously |
|
91 |
* @param aFilter: Query Criteria |
|
92 |
* @param aCallback: callback address |
|
93 |
*/ |
|
94 |
||
95 |
IMPORT_C void GetListL( TUint aTransId , CLogFilter *aFilter ) ; |
|
96 |
||
97 |
/** |
|
98 |
* Read recent Events from the database |
|
99 |
* |
|
100 |
* @param Transaction id of the async event |
|
101 |
* @param RecentList |
|
102 |
* @param Filter for events to appear in the view. |
|
103 |
*/ |
|
104 |
||
105 |
TBool ReadRecentEventsL( TUint aTransId , |
|
106 |
TLogRecentList aRecentList , |
|
107 |
const CLogFilter *aFilter = NULL ) ; |
|
108 |
||
109 |
/** |
|
110 |
* Notify Update: Notifies the updates happening to |
|
111 |
* logdatabase. |
|
112 |
* |
|
113 |
* @param aDelay, minium duration for reciving the updates |
|
114 |
*/ |
|
115 |
||
116 |
IMPORT_C void NotifyUpdates( TUint aTransId ,TTimeIntervalMicroSeconds32 aDelay ) ; |
|
117 |
||
118 |
/** |
|
119 |
* Gets the details of the event, as specified by the input |
|
120 |
* paramater |
|
121 |
* |
|
122 |
* @param, Transactoin id of the asynchronous event |
|
123 |
* @param, details of the event to be fetched from the database |
|
124 |
*/ |
|
125 |
||
126 |
IMPORT_C void GetEventL( TUint aTransId , CLogEvent* aEvent ) ; |
|
127 |
||
128 |
/** |
|
129 |
* SetInterval function |
|
130 |
*/ |
|
131 |
||
132 |
inline void SetInterval( TTimeIntervalMicroSeconds32 aInterval ) |
|
133 |
{ |
|
134 |
iInterval = aInterval ; |
|
135 |
} |
|
136 |
||
137 |
/** |
|
138 |
* Default Desturctor |
|
139 |
*/ |
|
140 |
||
141 |
~CLogAsyncService() ; |
|
142 |
||
143 |
||
144 |
protected : |
|
145 |
||
146 |
/** |
|
147 |
* Protected constructor |
|
148 |
*/ |
|
149 |
||
150 |
CLogAsyncService() ; |
|
151 |
||
152 |
/** |
|
153 |
* ConstructL Method to construct the class members |
|
154 |
*/ |
|
155 |
||
156 |
void ConstructL(MLoggingCallback* aCallback) ; |
|
157 |
||
158 |
/** |
|
159 |
* DoInitalise Method to intalise the class members |
|
160 |
*/ |
|
161 |
||
162 |
void DoInitialiseL() ; |
|
163 |
||
164 |
/** |
|
165 |
* From CActive |
|
166 |
*/ |
|
167 |
||
168 |
void DoCancel() ; |
|
169 |
||
170 |
/** |
|
171 |
* From CActive |
|
172 |
*/ |
|
173 |
||
174 |
void RunL() ; |
|
175 |
||
176 |
/** |
|
177 |
* RunCmL method |
|
178 |
*/ |
|
179 |
||
180 |
void RunCmdL() ; |
|
181 |
||
182 |
||
183 |
private : |
|
184 |
||
185 |
/** |
|
186 |
* Members of AsyncService Class |
|
187 |
*/ |
|
188 |
||
189 |
CLogClient* iLogClient ; |
|
190 |
MLoggingCallback* iCallback ; |
|
191 |
TUint iTransId ; |
|
192 |
CLogsEvent *iUpdatedEvent ; |
|
193 |
CLogIter* iIter ; |
|
194 |
TInt iTask ; |
|
195 |
RFs iFs ; |
|
196 |
TTimeIntervalMicroSeconds32 iInterval ; |
|
197 |
||
198 |
}; |
|
199 |
||
200 |
/** |
|
201 |
* Notify Callback class, used to get notifications for async events |
|
202 |
*/ |
|
203 |
||
204 |
class MLoggingCallback |
|
205 |
{ |
|
206 |
||
207 |
public : |
|
208 |
||
209 |
/** |
|
210 |
* HandleNotifyL , generic method to get updates on the async |
|
211 |
* methods |
|
212 |
* @param aTransId , Transaction id |
|
213 |
* @param aStatus |
|
214 |
* @param iter , Logging iterator |
|
215 |
*/ |
|
216 |
virtual void HandleNotifyL(TUint aTransid ,TUint aStatus , CLogIter *iter ) = 0 ; |
|
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
217 |
|
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
218 |
/** |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
219 |
* HandleRequestL , method to get log data on an event |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
220 |
* methods |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
221 |
* @param aTransId , Transaction id |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
222 |
* @param aStatus |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
223 |
* @param aEvent , data for the occured event |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
224 |
*/ |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
225 |
virtual void HandleRequestL(TUint aTransid ,TUint aStatus , CLogsEvent *event ) = 0 ; |
5 | 226 |
|
227 |
/** |
|
228 |
* CancelNotifyL , generic method to get updates on the async |
|
229 |
* methods |
|
230 |
* |
|
231 |
* @param aTransId , Transaction id |
|
232 |
*/ |
|
233 |
||
234 |
virtual void CancelNotifyL(TUint aTransid) = 0 ; |
|
235 |
||
236 |
/** |
|
237 |
* Default Desturctor |
|
238 |
*/ |
|
239 |
||
240 |
virtual ~MLoggingCallback() |
|
241 |
{ |
|
242 |
; |
|
243 |
} |
|
244 |
||
245 |
} ; |
|
246 |
||
247 |
#endif |