author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 17 Dec 2009 09:09:50 +0200 | |
changeset 26 | 5d0ec8b709be |
parent 23 | 50974a8b132e |
permissions | -rw-r--r-- |
5 | 1 |
/* |
2 |
* Copyright (c) 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: Defination of class CMessagingInterface |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef __MESSAGINGINTERFACE_H |
|
20 |
#define __MESSAGINGINTERFACE_H |
|
21 |
||
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
22 |
#include <liwcommon.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
23 |
#include <liwserviceifbase.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
10
diff
changeset
|
24 |
#include <liwbufferextension.h> |
5 | 25 |
|
26 |
#include "messageheader.h" |
|
27 |
||
28 |
class CMessagingService; |
|
29 |
class TInputValidator; |
|
30 |
/** |
|
31 |
* This class provides the Messaging SAPI interface to LIW Framework |
|
32 |
*/ |
|
33 |
class CMessagingInterface : public CBase, public MLiwInterface |
|
34 |
{ |
|
35 |
public: |
|
36 |
||
37 |
/** |
|
38 |
* Two-phased constructor. |
|
39 |
* @return CMessagingInterface* |
|
40 |
*/ |
|
41 |
static CMessagingInterface* NewL(); |
|
42 |
||
43 |
/** |
|
44 |
* Destructor. |
|
45 |
*/ |
|
46 |
virtual ~CMessagingInterface(); |
|
47 |
||
48 |
private: |
|
49 |
||
50 |
/** |
|
51 |
* Constructor |
|
52 |
*/ |
|
53 |
CMessagingInterface(); |
|
54 |
||
55 |
/** |
|
56 |
* Symbian Constructor |
|
57 |
*/ |
|
58 |
void ConstructL(); |
|
59 |
||
60 |
/* |
|
61 |
* Function which checks the type of the source and leaves upon |
|
62 |
* setting the error message accordingly if the aLeaveFlag is set and |
|
63 |
* returns ETrue in case of success, EFalse in case of failure and not leaving |
|
64 |
* |
|
65 |
* @param aSource |
|
66 |
* @param aLeaveFlag |
|
67 |
* @param aExpectedType |
|
68 |
* @param aCmdName Command Name |
|
69 |
* @param aParameter Parameter Name |
|
70 |
* @param aMessage Error message |
|
71 |
* |
|
72 |
* @return TBool |
|
73 |
*/ |
|
74 |
TBool CMessagingInterface::CheckInputTypeL( const TLiwVariant* aSource, |
|
75 |
TBool aLeaveFlag, |
|
76 |
LIW::TVariantTypeId aExpectedtype, |
|
77 |
const TDesC8& aCmdName, |
|
78 |
const TDesC8& aParameter, |
|
79 |
const TDesC& aMessage ); |
|
80 |
||
81 |
||
82 |
/** |
|
83 |
* Appends error message |
|
84 |
* @param aCmdName Command Name |
|
85 |
* @param aParameter Parameter Name |
|
86 |
* @param aMessage Error message |
|
87 |
* @param aMissingOrIncorrectOrNone 0 for none or 1 for missing or 2 for incorrect |
|
88 |
* For missing it leave with errorcode SErrMissingArgument |
|
89 |
* For incorrect it leaves with errorcode KErrArgument |
|
90 |
* For none it wont leave |
|
91 |
* |
|
92 |
* @return void |
|
93 |
*/ |
|
94 |
void AppendErrorMessageL( const TDesC8& aCmdName, |
|
95 |
const TDesC8& aParameter, |
|
96 |
const TDesC& aMessage, |
|
97 |
TInt aNoneOrMissingOrIncorrect ); |
|
98 |
||
99 |
||
100 |
/** |
|
101 |
* Function called from sync APIs to check whether Async set up is done |
|
102 |
* if yes then leaves |
|
103 |
* |
|
104 |
* @param aCmdOptions Command option |
|
105 |
* @param aCallback Callback object pointer |
|
106 |
* @param aCmdName Command Name |
|
107 |
* @param aMessage Error message |
|
108 |
* |
|
109 |
* @return void |
|
110 |
*/ |
|
111 |
void LeaveIfAsynchronousL( TUint aCmdOptions, |
|
112 |
MLiwNotifyCallback* aCallback, |
|
113 |
const TDesC8& aCmdName, |
|
114 |
const TDesC& aMessage ); |
|
115 |
||
116 |
||
117 |
// MLiwInterface member functions |
|
118 |
public: |
|
119 |
||
120 |
/** |
|
121 |
* Executes the SAPI as per params |
|
122 |
* @param aCmdName Command name defining which operation is to be performed |
|
123 |
* @param aInParamList Input param list |
|
124 |
* @param aOutParamList Output list |
|
125 |
* @param aCmdOptions Command option |
|
126 |
* @param aCallback Callback object pointer |
|
127 |
*/ |
|
128 |
virtual void ExecuteCmdL( const TDesC8& aCmdName, |
|
129 |
const CLiwGenericParamList& aInParamList, |
|
130 |
CLiwGenericParamList& aOutParamList, |
|
131 |
TUint aCmdOptions = 0, |
|
132 |
MLiwNotifyCallback* aCallback = 0 ); |
|
133 |
||
134 |
/** |
|
135 |
* Closes the interface |
|
136 |
*/ |
|
137 |
virtual void Close(); |
|
138 |
||
139 |
private: |
|
140 |
||
141 |
/** |
|
142 |
* Issues SendMessage request to Messaging Service |
|
143 |
* @param aInParamList Input param list |
|
144 |
* @param aOutParamList Output list |
|
145 |
* @param aCmdOptions Command option |
|
146 |
* @param aCallback Callback object pointer |
|
147 |
*/ |
|
148 |
void SendMessageL( const CLiwGenericParamList& aInParamList, |
|
149 |
CLiwGenericParamList& aOutParamList, |
|
150 |
TUint aCmdOptions, |
|
151 |
MLiwNotifyCallback* aCallback ); |
|
152 |
||
153 |
/** |
|
154 |
* Cancels the async operation issued earlier |
|
155 |
* @param aCmdName Command name i.e.., Cancel |
|
156 |
* @param aInParamList Input param list |
|
157 |
* @param aOutParamList Output list |
|
158 |
* @param aCmdOptions Command option |
|
159 |
*/ |
|
160 |
void CancelAsyncL( const TDesC8& aCmdName, |
|
161 |
const CLiwGenericParamList& aInParamList, |
|
162 |
CLiwGenericParamList& aOutParamList, |
|
163 |
TUint aCmdOptions); |
|
164 |
/** |
|
165 |
* Issues GetList request to Messaging Service |
|
166 |
* @param aInParamList Input param list |
|
167 |
* @param aOutParamList Output list |
|
168 |
* @param aCmdOptions Command option |
|
169 |
* @param aCallback Callback object pointer |
|
170 |
*/ |
|
171 |
void GetHeaderListL( const CLiwGenericParamList& aInParamList, |
|
172 |
CLiwGenericParamList& aOutParamList, |
|
173 |
TUint aCmdOptions, |
|
174 |
MLiwNotifyCallback* aCallback ); |
|
175 |
||
176 |
/** |
|
177 |
* Issues New Message notification request to Messaging Service |
|
178 |
* @param aInParamList Input param list |
|
179 |
* @param aOutParamList Output list |
|
180 |
* @param aCmdOptions Command option |
|
181 |
* @param aCallback Callback object pointer |
|
182 |
*/ |
|
183 |
void RequestNotificationL( const CLiwGenericParamList& aInParamList, |
|
184 |
CLiwGenericParamList& aOutParamList, |
|
185 |
TUint aCmdOptions, |
|
186 |
MLiwNotifyCallback* aCallback ); |
|
187 |
||
188 |
/** |
|
189 |
* Cancels New Message notification Messaging Service |
|
190 |
* @param aInParamList Input param list |
|
191 |
* @param aOutParamList Output list |
|
192 |
* @param aCmdOptions Command option |
|
193 |
* @param aCallback Callback object pointer |
|
194 |
*/ |
|
195 |
void CancelNotificationL( const CLiwGenericParamList& aInParamList, |
|
196 |
CLiwGenericParamList& aOutParamList, |
|
197 |
TUint aCmdOptions, |
|
198 |
MLiwNotifyCallback* aCallback ); |
|
199 |
||
200 |
/** |
|
201 |
* Issues request for Deleteing Message to Messaging Service |
|
202 |
* @param aInParamList Input param list |
|
203 |
* @param aOutParamList Output list |
|
204 |
* @param aCmdOptions Command option |
|
205 |
* @param aCallback Callback object pointer |
|
206 |
*/ |
|
207 |
void DeleteMessageL( const CLiwGenericParamList& aInParamList, |
|
208 |
CLiwGenericParamList& aOutParamList, |
|
209 |
TUint aCmdOptions, |
|
210 |
MLiwNotifyCallback* aCallback ); |
|
211 |
||
212 |
/** |
|
213 |
* Issues request for Changing message status to Messaging Service |
|
214 |
* @param aInParamList Input param list |
|
215 |
* @param aOutParamList Output list |
|
216 |
* @param aCmdOptions Command option |
|
217 |
* @param aCallback Callback object pointer |
|
218 |
*/ |
|
219 |
void ChangeStatusL( const CLiwGenericParamList& aInParamList, |
|
220 |
CLiwGenericParamList& aOutParamList, |
|
221 |
TUint aCmdOptions, |
|
222 |
MLiwNotifyCallback* aCallback ); |
|
223 |
||
224 |
/** |
|
225 |
* Gets the param list for sending message form the inputparam list |
|
226 |
* @param aInParamList A CLiwGenericParamList containing required input params |
|
227 |
* @return TSendMessageParams* A send message params structure |
|
228 |
*/ |
|
229 |
CSendMessageParams* GetSendParametersL( const CLiwGenericParamList& aInParamList ); |
|
230 |
||
231 |
/** |
|
232 |
* Gets the filter parameters, sorting option from the inputparam list |
|
233 |
* @param aInParamList A CLiwGenericParamList containing required input parameters |
|
234 |
* @return CFilterParamInfo* Filter parameter structure |
|
235 |
*/ |
|
236 |
CFilterParamInfo* GetFilterParametersL( const CLiwGenericParamList& aInParamList, TBool aIndexBaseInp ); |
|
237 |
||
238 |
/** |
|
239 |
* Gets the message id from liw input parameter |
|
240 |
* @param aInParamList input param list |
|
241 |
* @param aMessageId Output parameter containing message id |
|
242 |
* @return TInt Error code |
|
243 |
*/ |
|
244 |
void GetMessageIdL( const CLiwGenericParamList& aInParamList, TMsvId& aMessageId, |
|
245 |
const TDesC8& aCmdName ); |
|
246 |
||
247 |
/** |
|
248 |
* Gets the transaction id from liw input parameter |
|
249 |
* @param aInParamList input param list |
|
250 |
* @param aTransactionId Output param containing transaction id |
|
251 |
* @return TInt Error code |
|
252 |
*/ |
|
253 |
void GetTransactionIdL( const CLiwGenericParamList& aInParamList, |
|
254 |
TInt32& aTransactionId, |
|
255 |
const TDesC8& aCmdName ); |
|
256 |
||
257 |
/** |
|
258 |
* Gets the status flag and its value |
|
259 |
* @param aInParamList input param list |
|
260 |
* @param aStatusFlag Status flag |
|
261 |
* @param aFlagValue Flag value |
|
262 |
* @return TInt Error code |
|
263 |
*/ |
|
264 |
void GetStatusFlagAndValueL( const CLiwGenericParamList& aInParamList, |
|
265 |
TMessageStatusFlag& aStatusFlag, |
|
266 |
TBool& aFlagValue, |
|
267 |
const TDesC8& aCmdName ); |
|
268 |
||
269 |
/** |
|
270 |
* Gets the notification type |
|
271 |
* @param aInParamList input param list |
|
272 |
* @param aNotificationType Notification type |
|
273 |
* @return void |
|
274 |
*/ |
|
275 |
void GetNotificationTypeL( const CLiwGenericParamList& aInParamList, |
|
276 |
TNotificationType& aNotificationType, |
|
277 |
const TDesC8& aCmdName ); |
|
278 |
||
279 |
/** |
|
280 |
* Gives the sort type |
|
281 |
* @param aSortField Sort Field as input string |
|
282 |
* @param aSortOrder Sort type as input string |
|
283 |
* @return TMsvSorting Sort type |
|
284 |
*/ |
|
285 |
TMsvSorting SortType( const TDesC& aSortField, const TDesC& aSortOrder ); |
|
286 |
||
287 |
||
288 |
private: |
|
289 |
||
290 |
/** |
|
291 |
* CMessagingService class pointer |
|
292 |
*/ |
|
293 |
CMessagingService* iMsgService; |
|
294 |
||
295 |
/** |
|
296 |
* iErrorString Heap Descriptor used to store the error message |
|
297 |
* in case of error, initially set to NULL |
|
298 |
*/ |
|
299 |
HBufC* iErrorMessage; |
|
300 |
}; |
|
301 |
||
302 |
/** |
|
303 |
* Callback class for asynchronous SAPI whose result is Integer |
|
304 |
*/ |
|
305 |
class CMsgCallbackInt : public CMsgCallbackBase |
|
306 |
{ |
|
307 |
private: |
|
308 |
||
309 |
/** |
|
310 |
* Constructor |
|
311 |
*/ |
|
312 |
CMsgCallbackInt(); |
|
313 |
||
314 |
public: |
|
315 |
||
316 |
/** |
|
317 |
* Two-phase Constructor |
|
318 |
* @return CMsgCallbackBase* |
|
319 |
*/ |
|
320 |
static CMsgCallbackBase* NewL(); |
|
321 |
||
322 |
/** |
|
323 |
* Gives the result of asynchronous SAPI |
|
324 |
* @param aErrCode errcode |
|
325 |
* @param aResult Result |
|
326 |
*/ |
|
327 |
void NotifyResultL(TInt aErrCode, TAny* aResult); |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
328 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
329 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
330 |
* Gives the result of asynchronous SAPI |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
331 |
* @param aErrCode errcode |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
332 |
* @param aEntrySelection Entryselection |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
333 |
* @param aFilter Filter |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
334 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
335 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
336 |
void HandleGetlistL (TInt aErrCode, CMsvEntrySelection* aEntrySelection, CFilterParamInfo* aFilter); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
337 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
338 |
|
5 | 339 |
}; |
340 |
||
341 |
/** |
|
342 |
* Callback class for asynchronous SAPI message header |
|
343 |
*/ |
|
344 |
class CMsgCallbackHeader : public CMsgCallbackBase |
|
345 |
{ |
|
346 |
public: |
|
347 |
||
348 |
/** |
|
349 |
* Two-phase Constructor |
|
350 |
* @return CMsgCallbackHeader* |
|
351 |
*/ |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
352 |
static CMsgCallbackHeader* NewL(CMessagingService* aMsgService); |
5 | 353 |
|
354 |
/** |
|
355 |
* Destructor |
|
356 |
*/ |
|
357 |
virtual ~CMsgCallbackHeader(); |
|
358 |
||
359 |
private: |
|
360 |
||
361 |
/** |
|
362 |
* Constructor |
|
363 |
*/ |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
364 |
CMsgCallbackHeader(CMessagingService* aMsgService); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
365 |
|
5 | 366 |
public: |
367 |
||
368 |
/** |
|
369 |
* Gives the result of asynchronous SAPI |
|
370 |
* @param aErrCode errcode |
|
371 |
* @param aResult Result |
|
372 |
*/ |
|
373 |
virtual void NotifyResultL(TInt aErrCode, TAny* aResult); |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
374 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
375 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
376 |
* Gives the result of asynchronous SAPI |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
377 |
* @param aErrCode errcode |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
378 |
* @param aEntrySelection Entryselection |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
379 |
* @param aFilter Filter |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
380 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
381 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
382 |
virtual void HandleGetlistL (TInt aErrCode, CMsvEntrySelection* aEntrySelection, CFilterParamInfo* aFilter); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
383 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
384 |
private: |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
385 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
386 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
387 |
* CMessagingService class pointer |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
388 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
389 |
CMessagingService* iMsg; |
5 | 390 |
}; |
391 |
||
392 |
/** |
|
393 |
* Implemenation of abstract interface to iterate over the collection of message IDs. |
|
394 |
* |
|
395 |
* @see CLiwIterable |
|
396 |
* |
|
397 |
*/ |
|
398 |
class CIterableIdList : public CLiwIterable |
|
399 |
{ |
|
400 |
public: |
|
401 |
/** |
|
402 |
* Two-phase Constructor |
|
403 |
* @param aList list to be iterated |
|
404 |
* @return new CIterableIdList object |
|
405 |
*/ |
|
406 |
static CIterableIdList* NewL(CMsvEntrySelection* aList, |
|
407 |
CMessagingService* aMsgService, |
|
408 |
CFilterParamInfo* aFilter ); |
|
409 |
||
410 |
/** |
|
411 |
* Resets the iterator. |
|
412 |
* |
|
413 |
*/ |
|
414 |
void Reset(); |
|
415 |
||
416 |
/** |
|
417 |
* Iterates over the collection entries to fetch the next data element. |
|
418 |
* |
|
419 |
* @param aEntry contains the next data element and its corresponding data type |
|
420 |
* |
|
421 |
* @return false if there are no more data elements to be fetched; |
|
422 |
* true otherwise |
|
423 |
* |
|
424 |
*/ |
|
425 |
TBool NextL(TLiwVariant&); |
|
426 |
||
427 |
/** |
|
428 |
* Destructor. |
|
429 |
*/ |
|
430 |
~CIterableIdList(); |
|
431 |
||
432 |
private: |
|
433 |
||
434 |
/** |
|
435 |
* Constructor |
|
436 |
* @param aList list to be iterated |
|
437 |
* @return void |
|
438 |
*/ |
|
439 |
CIterableIdList(CMsvEntrySelection* aList, |
|
440 |
CMessagingService* aMsgService, |
|
441 |
CFilterParamInfo* aFilter ); |
|
442 |
||
443 |
||
444 |
private: |
|
445 |
||
446 |
/** |
|
447 |
* CMsvEntrySelection class pointer |
|
448 |
*/ |
|
449 |
CMsvEntrySelection* iList; |
|
450 |
||
451 |
/** |
|
452 |
* CMessagingService class pointer |
|
453 |
*/ |
|
454 |
CMessagingService* iMsgService; |
|
455 |
||
456 |
/** |
|
457 |
* CFilterParamInfo class pointer |
|
458 |
*/ |
|
459 |
CFilterParamInfo* iFilter; |
|
460 |
||
461 |
/** |
|
462 |
* Index on list |
|
463 |
*/ |
|
464 |
TInt iIndex; |
|
465 |
}; |
|
466 |
||
467 |
/** |
|
468 |
* An associative array or dictionary class. The collection |
|
469 |
* key entries are of type string (Descriptor type) and their |
|
470 |
* associated values can be an variant type. |
|
471 |
* |
|
472 |
* \c CLiwDefaultMap provides default map implementation to |
|
473 |
* <ul> |
|
474 |
* <li>insert a key-value pair</li> |
|
475 |
* <li>find a stored value based on a key</li> |
|
476 |
* <li>get a key based on an index</li> |
|
477 |
* <li>remove a key-value pair based on a key</li> |
|
478 |
* <li>get the total number of stored key-value pairs</li> |
|
479 |
* </ul> |
|
480 |
* |
|
481 |
* |
|
482 |
* @see CLiwContainer |
|
483 |
* @see TLiwVariant |
|
484 |
* @see CLiwMap |
|
485 |
* |
|
486 |
*/ |
|
487 |
class CLiwMessagingMap : public CLiwMap |
|
488 |
{ |
|
489 |
public: |
|
490 |
||
491 |
/* |
|
492 |
* Creates an instance of \c CLiwMessagingMap |
|
493 |
* |
|
494 |
* @return an instance of \c CLiwMessagingMap |
|
495 |
*/ |
|
496 |
static CLiwMessagingMap* NewL( CMessagingService* aMsgService ); |
|
497 |
||
498 |
||
499 |
/** |
|
500 |
* Inserts a key-value pair element to the map collection. If |
|
501 |
* the specified key already exists, it will be removed from |
|
502 |
* the collection and the new key-value pair will be added to the |
|
503 |
* map. |
|
504 |
* |
|
505 |
* @param aKey the key to be stored |
|
506 |
* @param aValue the value associated with the key to be stored |
|
507 |
*/ |
|
508 |
void InsertL(const TDesC8& aKey, const TLiwVariant& aValue); |
|
509 |
||
510 |
/** |
|
511 |
* Finds a value stored in the map collection based on the key. |
|
512 |
* |
|
513 |
* @param aKey the key to be searched |
|
514 |
* @param aFndValue the value associated with the found key |
|
515 |
* |
|
516 |
* @return false if there is no key stored; true otherwise |
|
517 |
*/ |
|
518 |
TBool FindL(const TDesC8& aKey, TLiwVariant& aValue) const; |
|
519 |
||
520 |
/** |
|
521 |
* Returns the number of key-value pair stored in the map collection. |
|
522 |
* |
|
523 |
* @return the number of key-value pair stored in the map collection |
|
524 |
*/ |
|
525 |
TInt Count() const; |
|
526 |
||
527 |
/** |
|
528 |
* Returns the key stored at a specified index. |
|
529 |
* |
|
530 |
* @param aIndex the index of the key to be found |
|
531 |
* @param aFndKey the key found at the passed index |
|
532 |
* |
|
533 |
* @return true if a key-value entry is found at the passed index; |
|
534 |
* false otherwise |
|
535 |
*/ |
|
536 |
TBool AtL(TInt aIndex, TDes8& aFndKey) const; |
|
537 |
||
538 |
/** |
|
539 |
* Removes a key from the map collection. |
|
540 |
* |
|
541 |
* @param aKey the key to be removed from the map |
|
542 |
*/ |
|
543 |
void Remove(const TDesC8& aKey); |
|
544 |
||
545 |
private: |
|
546 |
||
547 |
/* |
|
548 |
* Constructor |
|
549 |
*/ |
|
550 |
CLiwMessagingMap(CLiwGenericParamList* aMap, CMessagingService* aMsgService) |
|
551 |
: iMap(aMap), iMsgService(aMsgService) |
|
552 |
{} |
|
553 |
||
554 |
/* |
|
555 |
* Destructor |
|
556 |
*/ |
|
557 |
virtual ~CLiwMessagingMap(); |
|
558 |
||
559 |
/* |
|
560 |
* the underlying generic parameter list |
|
561 |
*/ |
|
562 |
CLiwGenericParamList* iMap; |
|
563 |
||
564 |
/** |
|
565 |
* CMessagingService class pointer |
|
566 |
*/ |
|
567 |
CMessagingService* iMsgService; |
|
568 |
||
569 |
}; |
|
570 |
||
571 |
class CMsgFileBuffer : public CLiwFileBuffer |
|
572 |
{ |
|
573 |
public: |
|
574 |
/** |
|
575 |
* Two-phase Constructor |
|
576 |
* @param aFile file handle |
|
577 |
* @return new CMsgFileBuffer object |
|
578 |
*/ |
|
579 |
static CMsgFileBuffer* NewL(RFile& aFile); |
|
580 |
||
581 |
/** |
|
582 |
* Destructor. |
|
583 |
*/ |
|
584 |
~CMsgFileBuffer(); |
|
585 |
||
586 |
/* |
|
587 |
* @return RFile handle |
|
588 |
*/ |
|
589 |
RFile& AsFile(); |
|
590 |
||
591 |
/* |
|
592 |
* Returns the pointer to the underlying buffer |
|
593 |
* |
|
594 |
* @return the pointer to the underlying buffer |
|
595 |
*/ |
|
596 |
TUint8* Buf() const; |
|
597 |
||
598 |
/* |
|
599 |
* Returns the length of the buffer data |
|
600 |
* |
|
601 |
* @return the length of the buffer data |
|
602 |
*/ |
|
603 |
TInt Len(); |
|
604 |
||
605 |
/* |
|
606 |
* Reads the specified number of bytes of buffer data |
|
607 |
* |
|
608 |
* @param aPtr the pointer to the area into which buffer data is read |
|
609 |
* @param aLength the number of bytes to be read from the buffer |
|
610 |
* |
|
611 |
* @return KErrNone if the operation is successful; Otherwise |
|
612 |
* TLiwBufferAccess::KLiwBufferNonReadable |
|
613 |
* |
|
614 |
*/ |
|
615 |
TInt Read(TUint8* aPtr,TInt aLength); |
|
616 |
||
617 |
/* |
|
618 |
* Writes the specified number of bytes into the buffer |
|
619 |
* |
|
620 |
* @param aPtr the pointer to the data to be written into buffer |
|
621 |
* @param aLength the number of bytes to be written into buffer |
|
622 |
* |
|
623 |
* @return KErrNone if the operation is successful; Otherwise |
|
624 |
* TLiwBufferAccess::KLiwBufferReadOnly if writing is not supported |
|
625 |
* |
|
626 |
*/ |
|
627 |
TInt Write(const TUint8 aPtr, TInt aLength); |
|
628 |
||
629 |
/* |
|
630 |
* Releases the buffer. The service provider implementing concrete buffer |
|
631 |
* type should provide appropriate implementation |
|
632 |
*/ |
|
633 |
void Release(); |
|
634 |
||
635 |
/* |
|
636 |
* Returns the appropriate type of buffer. |
|
637 |
*/ |
|
638 |
TInt TypeID(); |
|
639 |
||
640 |
/* |
|
641 |
* The concrete implementation of buffer types should perform equality operation |
|
642 |
* check |
|
643 |
*/ |
|
644 |
virtual TBool operator==(CLiwBuffer& aBuffer); |
|
645 |
||
646 |
private: |
|
647 |
CMsgFileBuffer(RFile& aFile); |
|
648 |
||
649 |
private: |
|
650 |
RFile iFile; |
|
651 |
}; |
|
652 |
||
653 |
||
654 |
/** |
|
655 |
* Input Validator Class used internally to check Inputs |
|
656 |
*/ |
|
657 |
class TInputValidator |
|
658 |
{ |
|
659 |
public: |
|
660 |
TInputValidator(); |
|
661 |
||
662 |
/* |
|
663 |
* Check whether aTime is valid or not |
|
664 |
*/ |
|
665 |
TBool CheckValidDate( const TTime &aTime ); |
|
666 |
||
667 |
/* |
|
668 |
* Check whether aDes contains valid number or not |
|
669 |
*/ |
|
670 |
TBool CheckValidNumber( const TDesC &aDes ); |
|
671 |
||
672 |
/* |
|
673 |
* Check whether aFileName is a valid file or not |
|
674 |
*/ |
|
675 |
TBool CheckValidFile( const TDesC &aFileName ); |
|
676 |
||
677 |
/* |
|
678 |
* Check whether aDesc is a valid phone number |
|
679 |
*/ |
|
680 |
TBool CheckValidNumberWithPlus( const TDesC &aDes ); |
|
681 |
||
682 |
/* |
|
683 |
* Check whether aDesc size is not zero |
|
684 |
*/ |
|
685 |
TBool CheckDesSize( const TDesC &aDes ); |
|
686 |
}; |
|
687 |
||
688 |
#endif __MESSAGINGINTERFACE_H |