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