author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 19 Feb 2010 23:43:21 +0200 | |
branch | RCL_3 |
changeset 32 | 4ac3198c2c5b |
parent 26 | 5d0ec8b709be |
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: Header file for location SAPI core implementation. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef C_LOGINTERFACE_H |
|
19 |
#define C_LOGINTERFACE_H |
|
20 |
||
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
21 |
#include <liwcommon.h> |
5 | 22 |
#include "serviceerrno.h" |
23 |
||
24 |
/** |
|
25 |
* Forward Declarations |
|
26 |
*/ |
|
27 |
class CLoggingService ; |
|
28 |
||
29 |
/** |
|
30 |
* error message |
|
31 |
*/ |
|
32 |
||
33 |
const TInt KMaxMsgSize = 256; |
|
34 |
const TInt KMaxKeySize = 128; |
|
35 |
_LIT( KInvalid, "Invalid" ); |
|
36 |
_LIT( KMissing, " Missing" ); |
|
37 |
_LIT( KMsgErr, "Logging:"); |
|
38 |
_LIT( KColon, ":"); |
|
39 |
_LIT8( KErrorMessage, "ErrorMessage"); |
|
40 |
_LIT( KErrLogCmdName, "Invalid commandName" ); |
|
41 |
_LIT( KErrMissingCallback, "Missing Callback" ); |
|
42 |
_LIT(KInterfaceMissing,"Logging: Interface name missing"); |
|
43 |
||
44 |
||
45 |
/** |
|
46 |
* Content Type |
|
47 |
*/ |
|
48 |
_LIT(KContentType , "Log") ; |
|
49 |
||
50 |
/** |
|
51 |
* ContentType Key |
|
52 |
*/ |
|
53 |
_LIT8(KContentTypeKey , "Type") ; |
|
54 |
/** |
|
55 |
* Error Indntifier in Output parameter list |
|
56 |
*/ |
|
57 |
_LIT8(KErrorCode , "ErrorCode") ; |
|
58 |
||
59 |
||
60 |
/** |
|
61 |
* Operations on the IDatasource(Logging) interface |
|
62 |
*/ |
|
63 |
_LIT8(KCmdAdd , "Add") ; |
|
64 |
_LIT8(KCmdDelete , "Delete") ; |
|
65 |
_LIT8(KCmdGetList ,"GetList") ; |
|
66 |
_LIT8(KCmdRequestNotification ,"RequestNotification") ; |
|
67 |
_LIT8(KCmdCancel ,"Cancel") ; |
|
68 |
||
69 |
||
70 |
/** |
|
71 |
* Transaction id, which will be part of outparamlist for asynchronous request |
|
72 |
*/ |
|
73 |
_LIT8(KTransactionId, "TransactionID"); |
|
74 |
||
75 |
/** |
|
76 |
* Event map that contains the details of the event to be logged |
|
77 |
*/ |
|
78 |
_LIT8(KEventDetails , "Item") ; |
|
79 |
||
80 |
/** |
|
81 |
* Filter for getlist operation |
|
82 |
*/ |
|
83 |
_LIT8(KFilter , "Filter") ; |
|
84 |
||
85 |
/** |
|
86 |
* DelayInterval |
|
87 |
*/ |
|
88 |
_LIT8(KDelayTime , "DelayTime") ; |
|
89 |
||
90 |
/** |
|
91 |
* Key for identifying the type of the event in event map |
|
92 |
*/ |
|
93 |
_LIT8(KEventTypeKey , "EventType") ; |
|
94 |
||
95 |
/** |
|
96 |
* Key for identifying the remote party in event map |
|
97 |
*/ |
|
98 |
_LIT8(KRemotePartyKey , "RemoteParty") ; |
|
99 |
||
100 |
/** |
|
101 |
* Key for identifying the direction in event map |
|
102 |
*/ |
|
103 |
_LIT8(KDirectionKey , "Direction") ; |
|
104 |
||
105 |
/** |
|
106 |
* Key for identifying the time in event map |
|
107 |
*/ |
|
108 |
_LIT8(KEventTimeKey , "EventTime") ; |
|
109 |
||
110 |
/** |
|
111 |
* Key for identifying the duration in event map |
|
112 |
*/ |
|
113 |
_LIT8(KEventDurationKey , "EventDuration") ; |
|
114 |
||
115 |
/** |
|
116 |
* Key for identifying the deliverystatus in event map |
|
117 |
*/ |
|
118 |
_LIT8(KDeliveryStatusKey , "DeliveryStatus") ; |
|
119 |
||
120 |
/** |
|
121 |
* Key for identifying the subject in event map |
|
122 |
*/ |
|
123 |
_LIT8(KSubjectKey , "Subject") ; |
|
124 |
||
125 |
/** |
|
126 |
* Key for identifying the phonenumber in event map |
|
127 |
*/ |
|
128 |
_LIT8(KPhoneNumberKey , "PhoneNumber") ; |
|
129 |
||
130 |
/** |
|
131 |
* Key for identifying the description in event map |
|
132 |
*/ |
|
133 |
_LIT8(KDescriptionKey , "Description") ; |
|
134 |
||
135 |
/** |
|
136 |
* Key for identifying the eventdata in event map |
|
137 |
*/ |
|
138 |
_LIT8(KEventDataKey , "EventData") ; |
|
139 |
||
140 |
/** |
|
141 |
* Key for identifying the link in event map |
|
142 |
*/ |
|
143 |
_LIT8(KLinkKey , "Link") ; |
|
144 |
||
145 |
/** |
|
146 |
* Key for the flags fields |
|
147 |
*/ |
|
148 |
_LIT8(KFlagsKey , "LogFlags") ; |
|
149 |
||
150 |
/** |
|
151 |
* EndTime Key, for getlist filter |
|
152 |
*/ |
|
153 |
_LIT8(KEndTimeKey , "EndTime") ; |
|
154 |
||
155 |
/** |
|
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
156 |
* StartTime Key, for getlist filter |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
157 |
*/ |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
158 |
_LIT8(KStartTimeKey , "StartTime") ; |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
159 |
|
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
23
diff
changeset
|
160 |
/** |
5 | 161 |
* Error Code |
162 |
*/ |
|
163 |
_LIT8(KErrCode , "ErrorCode") ; |
|
164 |
||
165 |
/** |
|
166 |
* Key for RecentList for Filter |
|
167 |
*/ |
|
168 |
_LIT8(KRecentListKey , "RecentList") ; |
|
169 |
||
170 |
/** |
|
171 |
* Key for id |
|
172 |
*/ |
|
173 |
_LIT8(KLogId , "id") ; |
|
174 |
||
175 |
/** |
|
176 |
* Key for Data Map |
|
177 |
*/ |
|
178 |
_LIT8(KData , "Data") ; |
|
179 |
||
180 |
/** |
|
181 |
* output returnvalue key |
|
182 |
*/ |
|
183 |
_LIT8(KResponse,"ReturnValue"); |
|
184 |
||
185 |
||
186 |
/** |
|
187 |
* Forward declarations |
|
188 |
*/ |
|
189 |
class MLiwInterface ; |
|
190 |
class CLogIter ; |
|
191 |
||
192 |
/** |
|
193 |
* This class provides the Calendar SAPI interface to LIW Framework |
|
194 |
*/ |
|
195 |
class CLoggingInterface : public CBase, public MLiwInterface |
|
196 |
{ |
|
197 |
public : |
|
198 |
||
199 |
/** |
|
200 |
*Enums for position pased parsing |
|
201 |
*/ |
|
202 |
enum |
|
203 |
{ |
|
204 |
EIndex0 = 0 , |
|
205 |
EIndex1 , |
|
206 |
EIndex2 , |
|
207 |
EIndex3 , |
|
208 |
||
209 |
/** |
|
210 |
* Event Types |
|
211 |
*/ |
|
212 |
EKLogCallEventType = 0, |
|
213 |
EKLogDataEventType , |
|
214 |
EKLogFaxEventType , |
|
215 |
EKLogShortMessageEventType , |
|
216 |
EKLogPacketDataEventType , |
|
217 |
EKEventTypeNotPresent =-1, |
|
218 |
/** |
|
219 |
* RecentList types |
|
220 |
*/ |
|
221 |
EKLogNullRecentList = -1 , |
|
222 |
EKLogRecentIncomingCalls = 1, |
|
223 |
EKLogRecentOutgoingCalls , |
|
224 |
EKLogRecentMissedCalls , |
|
225 |
||
226 |
||
227 |
/** |
|
228 |
* Event Status |
|
229 |
*/ |
|
230 |
||
231 |
EStatusPending = 0 , |
|
232 |
EStatusSent, |
|
233 |
EStatusFalied, |
|
234 |
EStatusNone , |
|
235 |
EStatusDone , |
|
236 |
EStatusNotSent, |
|
237 |
EStatusScheduled, |
|
238 |
EStatusNotPresent =-1, |
|
239 |
/** |
|
240 |
* Event Flags |
|
241 |
*/ |
|
242 |
EKLogEventContactSearched = 0 , |
|
243 |
EKLogEventRead , |
|
244 |
EFlagNotPresent =-1, |
|
245 |
||
246 |
/** |
|
247 |
* Direction flags |
|
248 |
*/ |
|
249 |
EIncomingEvent = 0, |
|
250 |
EOutgoingEvent , |
|
251 |
EIncomingEventAlternateline, |
|
252 |
EOutgoingEventAlternateline, |
|
253 |
EFetchedEvent , |
|
254 |
EMissedEvent , |
|
255 |
EMissedEventAlternateline, |
|
256 |
EDirectionNotPresent = -1, |
|
257 |
}; |
|
258 |
||
259 |
public: |
|
260 |
||
261 |
/** |
|
262 |
* NewL: Two phased construction |
|
263 |
*/ |
|
264 |
static CLoggingInterface* NewL(); |
|
265 |
||
266 |
/** |
|
267 |
* NewLC: Creates an instance of CLoggingServiceClass |
|
268 |
* Two Phased constructor |
|
269 |
* returns newly allocated object. |
|
270 |
*/ |
|
271 |
static CLoggingInterface* NewLC() ; |
|
272 |
||
273 |
/** |
|
274 |
* Destructor. |
|
275 |
*/ |
|
276 |
virtual ~CLoggingInterface(); |
|
277 |
||
278 |
/** |
|
279 |
* ExecuteCmdL parses the input parameters and then calls an appropriate method on iLoggingServic |
|
280 |
* |
|
281 |
* @param aCmdName the name of the service command which the consumer wants to invoke |
|
282 |
* @param aInParamList the input parameter list, can be empty list |
|
283 |
* @param [in,out] aOutParamList the output parameter list, can be empty lis. The |
|
284 |
* service provider can use the output parameter list to fill in necessary return values |
|
285 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
286 |
* @param aCallback callback to be registered by consumer application |
|
287 |
* |
|
288 |
* @see TLiwServiceCmdOptions |
|
289 |
* @see CLiwGenericParamList |
|
290 |
* @see MLiwNotifyCallback |
|
291 |
*/ |
|
292 |
||
293 |
virtual void ExecuteCmdL( const TDesC8& aCmdName, |
|
294 |
const CLiwGenericParamList& aInParamList, |
|
295 |
CLiwGenericParamList& aOutParamList, |
|
296 |
TUint aCmdOptions = 0, |
|
297 |
MLiwNotifyCallback* aCallback = 0 ); |
|
298 |
||
299 |
||
300 |
/** |
|
301 |
* ConvertToSapiError function |
|
302 |
*/ |
|
303 |
static TInt ConvertToSapiError( TInt aSymbianErrorCode ); |
|
304 |
||
305 |
/** |
|
306 |
* Closes the interface |
|
307 |
*/ |
|
308 |
virtual void Close(); |
|
309 |
||
310 |
protected: |
|
311 |
||
312 |
/** |
|
313 |
* ConstructL(): Internal method to construct members |
|
314 |
*/ |
|
315 |
void ConstructL() ; |
|
316 |
||
317 |
/** |
|
318 |
* Default constructor |
|
319 |
*/ |
|
320 |
CLoggingInterface() ; |
|
321 |
||
322 |
/** |
|
323 |
* Internal CmdExecute function which parses the input parameters |
|
324 |
* this function is called by ExecuteCmdL() function |
|
325 |
* |
|
326 |
* @param aCmdName the name of the service command which the consumer wants to invoke |
|
327 |
* @param aInParamList the input parameter list, can be empty list |
|
328 |
* @param [in,out] aOutParamList the output parameter list, can be empty lis. The |
|
329 |
* service provider can use the output parameter list to fill in necessary return values |
|
330 |
* @param aCmdOptions Options for the command, see TLiwServiceCmdOptions in LiwCommon.hrh. |
|
331 |
* @param aCallback callback to be registered by consumer application |
|
332 |
* @see TLiwServiceCmdOptions |
|
333 |
* @see CLiwGenericParamList |
|
334 |
* @see MLiwNotifyCallback |
|
335 |
* |
|
336 |
*/ |
|
337 |
||
338 |
void CmdExecuteL( const TDesC8& aCmdName, |
|
339 |
const CLiwGenericParamList& aInParamList , |
|
340 |
CLiwGenericParamList& aOutParamList, |
|
341 |
TUint aCmdOptions, |
|
342 |
MLiwNotifyCallback* aCallback ); |
|
343 |
||
344 |
/** |
|
345 |
* Internal utility method, used for Add from the core class |
|
346 |
* |
|
347 |
* @param aParam, input paramater containg the eventdetails. |
|
348 |
* @param aCallback, callback address for notification requests. |
|
349 |
* @param aTransId, transaction id. |
|
350 |
*/ |
|
351 |
||
352 |
TInt32 AddEventL( const TLiwGenericParam *eventdetails , |
|
353 |
TUint& aTansId , |
|
354 |
TUint aCmdOptions, |
|
355 |
MLiwNotifyCallback *aCallBack = NULL ) ; |
|
356 |
||
357 |
/** |
|
358 |
* Internal utility method, used to getlist from the core class |
|
359 |
* |
|
360 |
* @param aFilter, filter for getlist on core class |
|
361 |
* @param aIter, Valure result argument(TransactionId for async calls) |
|
362 |
* @param aCallback, callback method for async events |
|
363 |
*/ |
|
364 |
||
365 |
CLogIter* GetListL( const TLiwGenericParam *aFilter , |
|
366 |
TUint& aTransId, |
|
367 |
TUint aCmdOptions, |
|
368 |
MLiwNotifyCallback *aCallBack = NULL) ; |
|
369 |
||
370 |
/** |
|
371 |
* Internal utility method, used for notification registration |
|
372 |
* |
|
373 |
* @param aParam, input paramater containg the delay details/ |
|
374 |
* @param aCallback, callback address for notification requests. |
|
375 |
* @param aTransId, transaction id. |
|
376 |
*/ |
|
377 |
TInt RequestNotificationsL( const TLiwGenericParam *aParam , |
|
378 |
MLiwNotifyCallback *aCallback , |
|
379 |
TUint& aTransId, |
|
380 |
TUint aCmdOptions ) ; |
|
381 |
||
382 |
/** |
|
383 |
* Internal utility method, used for Delete from the core class |
|
384 |
* |
|
385 |
* @param aParam, input paramater containg the logid |
|
386 |
* @param aCallback, callback address for notification requests. |
|
387 |
* @param aTransId, transaction id. |
|
388 |
*/ |
|
389 |
||
390 |
TInt DeleteEventL( const TLiwGenericParam *aParam, |
|
391 |
TUint& aTansId, |
|
392 |
TUint aCmdOptions, |
|
393 |
MLiwNotifyCallback *aCallBack = NULL ); |
|
394 |
||
395 |
/** |
|
396 |
* IncorrectValueL function |
|
397 |
*/ |
|
398 |
void IncorrectValueL( const TDesC8* aErrorArgument ); |
|
399 |
||
400 |
/** |
|
401 |
* MissingValueL function |
|
402 |
*/ |
|
403 |
void MissingValueL( const TDesC8* aErrorArgument ); |
|
404 |
||
405 |
/** |
|
406 |
* CheckInputTypeL function |
|
407 |
*/ |
|
408 |
void CheckInputTypeL( const TLiwVariant* aSource, |
|
409 |
LIW::TVariantTypeId aExpectedtype, |
|
410 |
const TDesC8* aErrorArgument ); |
|
411 |
||
412 |
private: |
|
413 |
||
414 |
/** |
|
415 |
* Handle to core location class for performing location operations |
|
416 |
*/ |
|
417 |
||
418 |
CLoggingService *iLogService ; |
|
419 |
||
420 |
/** |
|
421 |
* ErrorString |
|
422 |
*/ |
|
423 |
||
424 |
HBufC16* iErrorString; |
|
425 |
||
426 |
}; |
|
427 |
||
428 |
||
429 |
#endif //C_LOGINTERFACE_H |