31
|
1 |
/*
|
|
2 |
* Copyright (c) 2005 - 2006 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 "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: MMS Codec Client offers API to multimedia message handling
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef MMSCODECCLIENT_H
|
|
22 |
#define MMSCODECCLIENT_H
|
|
23 |
|
|
24 |
// INCLUDES
|
|
25 |
#include <e32base.h> // CActive
|
|
26 |
#include <msvstd.h> // TMsvId
|
|
27 |
|
|
28 |
|
|
29 |
// CONSTANTS
|
|
30 |
|
|
31 |
|
|
32 |
// MACROS
|
|
33 |
|
|
34 |
|
|
35 |
// DATA TYPES
|
|
36 |
|
|
37 |
|
|
38 |
// DATA TYPES
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
// FUNCTION PROTOTYPES
|
|
43 |
//
|
|
44 |
// FORWARD DECLARATIONS
|
|
45 |
class CClientMtmRegistry;
|
|
46 |
class CMsvOperation;
|
|
47 |
class CMsvSession;
|
|
48 |
class CMmsSettings;
|
|
49 |
class CMmsClientEntry;
|
|
50 |
class CMmsClientMtm;
|
|
51 |
class CMmsHeaders;
|
|
52 |
class CMmsDecode;
|
|
53 |
class CMmsEncode;
|
|
54 |
|
|
55 |
// CLASS DECLARATION
|
|
56 |
/**
|
|
57 |
* This is a class declaration of CMmsCodecClient. It is a part of MMS Engine
|
|
58 |
* and it used for adding, fetching and sending multimedia messages from and into
|
|
59 |
* the message store in binary format. Also move, replace and some flag modifications
|
|
60 |
* provided.
|
|
61 |
*
|
|
62 |
* The exported functions may be called in any order EXCEPT
|
|
63 |
* CreateNewMessageEntryL() MUST be called BEFORE AddMML().
|
|
64 |
* If this rule is violated the operation may not be continued.
|
|
65 |
* The chunked transfer also must be done in order as described below.
|
|
66 |
* One message must be complete before another one is transferred.
|
|
67 |
*
|
|
68 |
* Chunked transfer added to version 3.2.
|
|
69 |
* To support synchronizing large messages without the need of large linear
|
|
70 |
* buffer, chunked mode of data transfer has been added to the API
|
|
71 |
*
|
|
72 |
* Chunked transfer from phone to PC:
|
|
73 |
*
|
|
74 |
* 1) Initialize retrieve (InitializeChunkedRetrievingL)
|
|
75 |
* 2) get a data chunk (GetNextDataPart)
|
|
76 |
* 3) release data chunk (ReleaseData)
|
|
77 |
* repeat steps 2 and 3 until all data has been processed
|
|
78 |
*
|
|
79 |
* Chunked transfer from PC to phone:
|
|
80 |
* The same procedure can be used both for creating new entries
|
|
81 |
* or replacing existing entries.
|
|
82 |
*
|
|
83 |
* 1) Create an entry or specify an entry to be replaced
|
|
84 |
* (InitializeChunkedAddingL or InitializeChunkedReplacingL)
|
|
85 |
* 2) Give next data chunk until last one has been reached (NextDataPart)
|
|
86 |
*
|
|
87 |
* If a chunked transfer to either direction is not totally completed
|
|
88 |
* before a new operation starts, the new operation will reset the state
|
|
89 |
* of the previous operation and delete possible incomplete entry.
|
|
90 |
* The next operation will proceed normally.
|
|
91 |
*
|
|
92 |
* Setting the flags:
|
|
93 |
* Some information is not transferred inside the binary data in message headers.
|
|
94 |
* That's why some data is transferred in flags. The flag info is moved
|
|
95 |
* to the codec client in AddMML, ReplaceMML and SetFlags functions. To the caller
|
|
96 |
* the info is transferred in RetrieveMML function.
|
|
97 |
* The unread flag is starightforward, it is just a boolean which tells if the
|
|
98 |
* message has been read or not.
|
|
99 |
* The other flags (TUint32) is just like TMsvEntry.iMtmData1 (See mmsconst.h).
|
|
100 |
* but only the following bits are used, others are zero:
|
|
101 |
* EMmsDrmCorruptedAttachment , if the corrupted DRM attachments has been removed
|
|
102 |
* KMmsMessageMobileTerminated , modbile terminated message
|
|
103 |
* KMmsMessageEditorOriented , mobile originated message
|
|
104 |
* The last two must be set exclusive e.g the may not be set at the same time
|
|
105 |
*
|
|
106 |
* Folders:
|
|
107 |
* User of this class may only access messages in the standard folders:
|
|
108 |
* KMsvGlobalInBoxIndexEntryId = 0x1002
|
|
109 |
* KMsvGlobalOutBoxIndexEntryId=0x1003
|
|
110 |
* KMsvDraftEntryId= 0x1004
|
|
111 |
* KMsvSentEntryId=0x1005
|
|
112 |
*
|
|
113 |
* @lib mmscodecclient.lib
|
|
114 |
*/
|
|
115 |
class CMmsCodecClient : public CActive
|
|
116 |
{
|
|
117 |
public: // Constructors and destructor
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Two-phased constructor.
|
|
121 |
*
|
|
122 |
* @param aMsvSession Message Server Session handle
|
|
123 |
*/
|
|
124 |
IMPORT_C static CMmsCodecClient* NewL( CMsvSession& aMsvSession );
|
|
125 |
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Destructor.
|
|
129 |
*/
|
|
130 |
virtual ~CMmsCodecClient();
|
|
131 |
|
|
132 |
public: // New functions
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Add a multimedia message. The given multimedia message is stored to
|
|
136 |
* the target folder. The flags are set correctly.
|
|
137 |
* CreateNewMessageEntryL must be called before this function.
|
|
138 |
*
|
|
139 |
*
|
|
140 |
* @param aMm the MM in binary format, which will be added to
|
|
141 |
* the messaging store
|
|
142 |
* @param aFolder the folder in which the MM will be stored
|
|
143 |
* @param aFlags the flags of the MM, which go to iMtmData1
|
|
144 |
* @param aUnread if the MM is unread or not
|
|
145 |
* @param aMmId the index, which was created for the added MM by
|
|
146 |
* the caller.
|
|
147 |
* @param aStatus request status of the calling active object
|
|
148 |
*
|
|
149 |
* Return values:
|
|
150 |
* @return KErrNone, if everything proceeds fine
|
|
151 |
* @return KErrArgument, if aMm or aFolder is invalid.
|
|
152 |
*/
|
|
153 |
IMPORT_C void AddMML(
|
|
154 |
CBufFlat& aMm,
|
|
155 |
TMsvId aFolder,
|
|
156 |
TUint32 aFlags,
|
|
157 |
TBool aUnread,
|
|
158 |
TMsvId& aMmId,
|
|
159 |
TRequestStatus& aStatus );
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Delete a multimedia message.
|
|
163 |
*
|
|
164 |
* @param aMmId The index to the MM, which will be deleted
|
|
165 |
* @return KErrNone, if everything proceeds fine or if the multimedia is
|
|
166 |
* not found.
|
|
167 |
* @return Error value in exceptional cases
|
|
168 |
*
|
|
169 |
*/
|
|
170 |
IMPORT_C TInt DeleteMM( TMsvId aMmId );
|
|
171 |
|
|
172 |
/**
|
|
173 |
* Retrieves a multimedia message. This function provides an MM in the
|
|
174 |
* binary format, the folder where the MM is stored and its flags.
|
|
175 |
*
|
|
176 |
*
|
|
177 |
* @param aMm The MM
|
|
178 |
* @param aFolder The folder, in which the message is stored.
|
|
179 |
* @param aFlags the flags of the MM, from the iMtmData1
|
|
180 |
* @param aUnread if the MM is unread or not
|
|
181 |
* @param aMmId Index to the MM, which will be retrieved
|
|
182 |
* @param aStatus request status of the calling active object
|
|
183 |
*
|
|
184 |
* @return KErrNone, if everything proceeds fine.
|
|
185 |
* @return Error value in exceptional cases
|
|
186 |
*/
|
|
187 |
IMPORT_C void RetrieveMML(
|
|
188 |
TMsvId aMmId,
|
|
189 |
CBufFlat& aMM,
|
|
190 |
TMsvId& aFolder,
|
|
191 |
TUint32& aFlags,
|
|
192 |
TBool& aUnread,
|
|
193 |
TRequestStatus& aStatus );
|
|
194 |
|
|
195 |
/**
|
|
196 |
* Sends the specified MM.The message is moved to the Outbox before
|
|
197 |
* sending. The caller of the method should not delete CMsvOperation,
|
|
198 |
* which is returned from the function until aStatus has completed.
|
|
199 |
* If CMsvOperation is destroyed too early, the sending is canceled.
|
|
200 |
*
|
|
201 |
*
|
|
202 |
* @param aMmId Index to the MM, which will be sent.
|
|
203 |
* @param aStatus request status of the calling active object
|
|
204 |
|
|
205 |
* @return pointer to CMsvOperation object. Caller must take care of
|
|
206 |
* deleting the pointer after the operation completes.
|
|
207 |
*/
|
|
208 |
IMPORT_C CMsvOperation* SendMML(
|
|
209 |
TMsvId aMmId,
|
|
210 |
TRequestStatus& aStatus );
|
|
211 |
|
|
212 |
/**
|
|
213 |
* A multimedia message is replaced.
|
|
214 |
* First the attachments of the original message is destroyed.
|
|
215 |
* Then the new message is stored to the same entry. Flags are set as
|
|
216 |
* defined. If the message is in the Outbox, it is not allowed to be
|
|
217 |
* replaced.
|
|
218 |
*
|
|
219 |
* @param aMmId the index to the replaceable MM
|
|
220 |
* @param aMm The new MMS
|
|
221 |
* @param aFlags the flags of the MM, which go to iMtmData1
|
|
222 |
* @param aUnread if the MM is unread or not
|
|
223 |
* @param aStatus request status of the calling active object
|
|
224 |
*
|
|
225 |
*/
|
|
226 |
IMPORT_C void ReplaceMML (
|
|
227 |
TMsvId& aMmId,
|
|
228 |
CBufFlat& aMm,
|
|
229 |
TUint32 aFlags,
|
|
230 |
TBool aUnread,
|
|
231 |
TRequestStatus& aStatus );
|
|
232 |
|
|
233 |
|
|
234 |
/**
|
|
235 |
* A multimedia message is moved from a standard folder to another.
|
|
236 |
* Moving to outbox is not allowed.
|
|
237 |
* @since 3.0
|
|
238 |
*
|
|
239 |
* @param aMmId the id to the moved MM
|
|
240 |
* @param aParentId New folder
|
|
241 |
*
|
|
242 |
*/
|
|
243 |
IMPORT_C void MoveMML(
|
|
244 |
TMsvId aMmId,
|
|
245 |
TMsvId aParentId,
|
|
246 |
TRequestStatus& aStatus );
|
|
247 |
|
|
248 |
|
|
249 |
/**
|
|
250 |
* This function sets flags of the MM.
|
|
251 |
* Note that it is not allowed to change the flags,
|
|
252 |
* if the MM is in outbox.
|
|
253 |
*
|
|
254 |
* @param aMmId Index to the MM
|
|
255 |
* @param aFlags the flags of the MM, which go to iMtmData1
|
|
256 |
* @param aUnread if the MM is unread or not
|
|
257 |
*
|
|
258 |
* @return KErrNone, if everything proceeds fine.
|
|
259 |
* @return KErrNotSupported, if the message is in Outbox.
|
|
260 |
*
|
|
261 |
*/
|
|
262 |
IMPORT_C TInt SetFlags(
|
|
263 |
TMsvId aMmId,
|
|
264 |
TUint32 aFlags,
|
|
265 |
TBool aUnread );
|
|
266 |
|
|
267 |
/*
|
|
268 |
* Create a message entry into the target folder. This function must be
|
|
269 |
* called
|
|
270 |
* before the AddMML function.
|
|
271 |
*
|
|
272 |
* @since 3.0
|
|
273 |
* @param aFolder the folder under which the entry is created.
|
|
274 |
* @param aCreatedId The new creared entry ID.
|
|
275 |
*
|
|
276 |
* @return KErrNone the function succeeded.
|
|
277 |
* @return Error values in exceptional cases.
|
|
278 |
*/
|
|
279 |
IMPORT_C TInt CreateNewMessageEntryL(
|
|
280 |
TMsvId aFolder,
|
|
281 |
TMsvId& aCreatedId );
|
|
282 |
|
|
283 |
|
|
284 |
/**
|
|
285 |
* Check if disk space is below critical level when storing data.
|
|
286 |
* This is a wrapper function.
|
|
287 |
* @since 3.0
|
|
288 |
*
|
|
289 |
* @param aDataSize amount of data to be added. If aDataSize == 0,
|
|
290 |
* returns info if disk space is already below critical level.
|
|
291 |
* @return error code KErrDiskFull if data does not fit,
|
|
292 |
* KErrNone if data fits.
|
|
293 |
* May return some other error code if appropriate.
|
|
294 |
* KErrNone always means it is all right to save the data.
|
|
295 |
*/
|
|
296 |
IMPORT_C TInt DiskSpaceBelowCriticalLevelL( TInt aSize );
|
|
297 |
|
|
298 |
// New methods to support chunked transfer.
|
|
299 |
|
|
300 |
/**
|
|
301 |
* Initialize retrieving a message in chunked mode.
|
|
302 |
* Data will be obtained by repeatedly calling GetNextDataPart()
|
|
303 |
* and ReleaseData().
|
|
304 |
* Function encodes the first data part into its internal buffer
|
|
305 |
* ready to be fetched by calling GetNextDataPart()
|
|
306 |
*
|
|
307 |
* @since S60 v3.1
|
|
308 |
* @param aMessageId Id of the message to be retrieved
|
|
309 |
* @param aFolder The folder where the message is stored
|
|
310 |
* @param aFlags The flags of the message, from the iMtmData1
|
|
311 |
* @param aUnread If the message is unread or not
|
|
312 |
* @param aOverallDataSize The total size of the encoded data
|
|
313 |
* if the size can be determined. -1 means the size could not be
|
|
314 |
* determined, and the return value of GetNextDataPart() function
|
|
315 |
* should be used to determine when the last data part has been
|
|
316 |
* reached. The buffer will be smaller than the total data size
|
|
317 |
* except in the case of small messages that may fit in the buffer
|
|
318 |
* in one chunk.
|
|
319 |
* @param aStatus request status of the calling active object
|
|
320 |
* Leaves with some system wide error code or completes with error
|
|
321 |
* if something goes wrong. If the function leaves, the caller
|
|
322 |
* must not set itself active as it was not set pending and will
|
|
323 |
* not be completed.
|
|
324 |
*/
|
|
325 |
|
|
326 |
IMPORT_C void InitializeChunkedRetrievingL(
|
|
327 |
TMsvId aMessageId,
|
|
328 |
TMsvId& aFolder,
|
|
329 |
TUint32& aFlags,
|
|
330 |
TBool& aUnread,
|
|
331 |
TInt& aOverallDataSize,
|
|
332 |
TRequestStatus& aStatus );
|
|
333 |
|
|
334 |
/**
|
|
335 |
* Obtain a data part from the supplier.
|
|
336 |
* The data is guaranteed to survive until a call is made to ReleaseData().
|
|
337 |
* If the component that is receiving the data cannot receive all data
|
|
338 |
* in one chunk, data can be given forward in smaller chunks. The data will
|
|
339 |
* will remain in the internal buffer of CodecClient until it has been
|
|
340 |
* released by calling ReleaseData().
|
|
341 |
*
|
|
342 |
* @since S60 v3.1
|
|
343 |
* @param aDataPart Pointer to the data that has been encoded into internal buffer
|
|
344 |
* The length of the pointer is set to reflect the amount of data.
|
|
345 |
* @param aLastDataChunk
|
|
346 |
* ETrue if this is the last data chunk
|
|
347 |
* EFalse if this is not the last data chunk
|
|
348 |
* @return error code, KErrNone if all is well.
|
|
349 |
* If returns some other error, transaction should be ended.
|
|
350 |
*/
|
|
351 |
IMPORT_C TInt GetNextDataPart( TPtrC8& aDataPart, TBool& aLastDataChunk );
|
|
352 |
|
|
353 |
/**
|
|
354 |
* Release the current data part being held at the data supplier.
|
|
355 |
* This call indicates to the supplier that the part
|
|
356 |
* is no longer needed, and another one can be provided.
|
|
357 |
* When this function is called, the next data part will be encoded
|
|
358 |
* into the buffer. When this function returns, a new data part
|
|
359 |
* can be fetched with GetNextDataPart.
|
|
360 |
* This function must always be called after the data obtained by
|
|
361 |
* GetNextDataPart() call has been processed.
|
|
362 |
* This function must also be called after last data chunk has
|
|
363 |
* been processed so that the state of the data supplier can be reset.
|
|
364 |
*
|
|
365 |
* @since S60 v3.1
|
|
366 |
* @return error code, KErrNone if all is well.
|
|
367 |
* If returns some other error, transaction must be ended.
|
|
368 |
*/
|
|
369 |
IMPORT_C TInt ReleaseData();
|
|
370 |
|
|
371 |
/**
|
|
372 |
* Initialize adding a message in chunked mode.
|
|
373 |
* An empty invisible message entry is created into the folder specified.
|
|
374 |
*
|
|
375 |
* @since S60 v3.1
|
|
376 |
* @param aFolder The folder where the message will be added
|
|
377 |
* @param aMessageId The ID of the message that has been created
|
|
378 |
* @param aFlags The flags of the MM to be stored in iMtmData1
|
|
379 |
* @param aUnread Specifies if the message is unread or not
|
|
380 |
* Leaves with KErrArgument if aFolder is invalid or if called
|
|
381 |
* in the middle of some other operation
|
|
382 |
* Leaves with some system wide error code if something goes wrong.
|
|
383 |
*/
|
|
384 |
IMPORT_C void InitializeChunkedAddingL(
|
|
385 |
TMsvId aFolder,
|
|
386 |
TMsvId& aMessageId,
|
|
387 |
TUint32 aFlags,
|
|
388 |
TBool aUnread );
|
|
389 |
|
|
390 |
/**
|
|
391 |
* Initialize replacing a message in chunked mode.
|
|
392 |
* The present content of the message entry is deleted.
|
|
393 |
* The data is added by calling NextDataPart()
|
|
394 |
*
|
|
395 |
* @since S60 v3.1
|
|
396 |
* @param aMessageId The ID of the message that will be replaced
|
|
397 |
* @param aFlags The flags of the MM to be stored in iMtmData1
|
|
398 |
* @param aUnread Specifies if the message is unread or not
|
|
399 |
* Leaves with KErrArgument if aFolder is invalid or if called
|
|
400 |
* in the middle of some other operation.
|
|
401 |
* Leaves with some system wide error code if something goes wrong.
|
|
402 |
*/
|
|
403 |
IMPORT_C void InitializeChunkedReplacingL(
|
|
404 |
TMsvId aMessageId,
|
|
405 |
TUint32 aFlags,
|
|
406 |
TBool aUnread );
|
|
407 |
|
|
408 |
/**
|
|
409 |
* Gives the next data part to be decoded.
|
|
410 |
* Decoding is synchronous. When the code returns, data can be released.
|
|
411 |
* MMS Decode may not be able to handle incomplete headers. MMS Codec Client
|
|
412 |
* will take care of buffering the incoming data and saving possible
|
|
413 |
* uncoded data in a flat buffer the same way CMmsTransaction does.
|
|
414 |
* The data should be provided in chunks that are small enough to be
|
|
415 |
* copied to an internal buffer without fear of running out of memory.
|
|
416 |
* HTTP stack provides data in chunks that are less than 10 kB.
|
|
417 |
* A similar size would be recommended but there is no absolute
|
|
418 |
* requirement as to the size of the data chunk. A compromise between
|
|
419 |
* performance and memory consumption may be used to determine an appropriate
|
|
420 |
* buffer size.
|
|
421 |
*
|
|
422 |
* @since S60 v3.1
|
|
423 |
* @param aDataPart the data to be decoded.
|
|
424 |
* @param aLastChunk ETrue if the data chunk in the buffer is the last one.
|
|
425 |
* When the last chunk has been decoded, the message entry is finalized.
|
|
426 |
* The flags are put into the entry, and the entry is made visible.
|
|
427 |
* @return error code, KErrNone if decoding succeeds
|
|
428 |
* If returns some other error, the entry that was created in InitializeChunkedAddingL
|
|
429 |
* will be deleted.
|
|
430 |
*/
|
|
431 |
IMPORT_C TInt NextDataPart(
|
|
432 |
TPtrC8& aDataPart,
|
|
433 |
TBool aLastDataChunk );
|
|
434 |
|
|
435 |
|
|
436 |
|
|
437 |
public: // Functions from base classes
|
|
438 |
|
|
439 |
|
|
440 |
|
|
441 |
protected: // New functions
|
|
442 |
|
|
443 |
|
|
444 |
protected: // Functions from base classes
|
|
445 |
|
|
446 |
|
|
447 |
/**
|
|
448 |
* From CActive
|
|
449 |
*/
|
|
450 |
virtual void DoCancel();
|
|
451 |
|
|
452 |
|
|
453 |
/**
|
|
454 |
* From CActive.
|
|
455 |
*/
|
|
456 |
virtual void RunL();
|
|
457 |
|
|
458 |
/**
|
|
459 |
* From CActive.
|
|
460 |
*/
|
|
461 |
TInt RunError(TInt aError);
|
|
462 |
|
|
463 |
private:
|
|
464 |
|
|
465 |
/**
|
|
466 |
* C++ default constructor.
|
|
467 |
* C++ default constructor can NOT contain any code, that
|
|
468 |
* might leave.
|
|
469 |
*/
|
|
470 |
CMmsCodecClient();
|
|
471 |
|
|
472 |
/**
|
|
473 |
* By default Symbian 2nd phase constructor is private.
|
|
474 |
*/
|
|
475 |
void ConstructL( CMsvSession& aMsvSession );
|
|
476 |
|
|
477 |
/*
|
|
478 |
* This function finalizes an entry, which has a decoded MM.
|
|
479 |
*/
|
|
480 |
void FinalizeDecodedMML( );
|
|
481 |
|
|
482 |
/*
|
|
483 |
* This function generates iDetails for TMsvEntry::iMtmData1
|
|
484 |
* in case of outgoing messages
|
|
485 |
*/
|
|
486 |
void GenerateRecipientsL( TDes& aDetails );
|
|
487 |
|
|
488 |
/*
|
|
489 |
* This function generates iDetails for TMsvEntry::iMtmData1
|
|
490 |
* in case of incoming messages
|
|
491 |
*/
|
|
492 |
void GenerateSenderL ( TDes& aDetails );
|
|
493 |
|
|
494 |
/*
|
|
495 |
* Retrieve flags of the MM
|
|
496 |
*
|
|
497 |
* @param aEntry The entry, which flags are given.
|
|
498 |
* @param aFlags the flags, from the iMtmData1
|
|
499 |
* @param aUnread if the MM is unread or not
|
|
500 |
*/
|
|
501 |
void RetrieveFlags(
|
|
502 |
TMsvEntry aEntry,
|
|
503 |
TUint32 &aFlags,
|
|
504 |
TBool &aUnread );
|
|
505 |
|
|
506 |
/*
|
|
507 |
* Set flags to the TMsvEntry
|
|
508 |
*
|
|
509 |
* @param aEntry The entry, which flags are set.
|
|
510 |
*
|
|
511 |
*/
|
|
512 |
|
|
513 |
void SetFlagsToTMsvEntry(
|
|
514 |
TMsvEntry& aEntry );
|
|
515 |
|
|
516 |
/*
|
|
517 |
* Check if the entry's parent is Outbox.
|
|
518 |
*
|
|
519 |
* @param aMmId Index to the MM
|
|
520 |
*
|
|
521 |
* @return ETrue when the parent is Outbox.
|
|
522 |
* @return EFalse when the parent is Outbox.
|
|
523 |
*/
|
|
524 |
|
|
525 |
TBool ParentOutbox(
|
|
526 |
TMsvId aMmId );
|
|
527 |
|
|
528 |
/*
|
|
529 |
* Deletes the current entry.
|
|
530 |
*/
|
|
531 |
void DeleteCurrentEntryL();
|
|
532 |
|
|
533 |
/*
|
|
534 |
* If a chunked operation has not completed properly, reset the state
|
|
535 |
*/
|
|
536 |
void ResetChunkedMode();
|
|
537 |
|
|
538 |
/*
|
|
539 |
* After last chunk has been fetched, an error encountered during
|
|
540 |
* retrieve or if caller starts a new operation without completing
|
|
541 |
* previous fetch, the entry being handled is put back to read only
|
|
542 |
* state if needed.
|
|
543 |
*/
|
|
544 |
void ReleaseRetrievedEntry();
|
|
545 |
|
|
546 |
public: // Data
|
|
547 |
|
|
548 |
|
|
549 |
protected: // Data
|
|
550 |
|
|
551 |
|
|
552 |
private: // Data
|
|
553 |
|
|
554 |
CMsvSession* iMsvSession;
|
|
555 |
CMsvEntry* iClientEntry;
|
|
556 |
|
|
557 |
RFs iFs; // file system
|
|
558 |
CMmsClientMtm* iMmsClient;
|
|
559 |
CMmsClientEntry* iClientEntryWrapper;
|
|
560 |
CClientMtmRegistry* iClientMtmRegistry;
|
|
561 |
|
|
562 |
CMmsHeaders* iMmsHeaders;
|
|
563 |
CMmsDecode* iDecoder;
|
|
564 |
CMmsEncode* iEncoder;
|
|
565 |
TMsvId iEntryBeingHandled;
|
|
566 |
|
|
567 |
TMsvId iFolder;
|
|
568 |
|
|
569 |
TUint32 iFlags;
|
|
570 |
TBool iUnread;
|
|
571 |
|
|
572 |
TRequestStatus* iClientStatus; // status of the client
|
|
573 |
|
|
574 |
// Private encode buffer for copying incoming data as partial headers
|
|
575 |
// cannot be decoded, and it is possible that partial data will be left
|
|
576 |
// in the buffer and more data appended to the end.
|
|
577 |
// The procedure is the same as in CMmsTransaction.
|
|
578 |
CBufFlat* iEncodeBuffer;
|
|
579 |
// Position where the data will be written into buffer. There may be some old
|
|
580 |
// unhandled data left.
|
|
581 |
TInt iPosition;
|
|
582 |
// keep track if we already got last chunk
|
|
583 |
TBool iLastChunk;
|
|
584 |
|
|
585 |
// MMS encapsulation versio to be used if the version is not defined
|
|
586 |
// in the messages
|
|
587 |
TInt16 iMmsVersion;
|
|
588 |
|
|
589 |
|
|
590 |
enum TState
|
|
591 |
{
|
|
592 |
EIdle = 0,
|
|
593 |
EFinalizeDecodedMM,
|
|
594 |
EFinalizeEncodedMM,
|
|
595 |
ESendMM,
|
|
596 |
EEntryCreated,
|
|
597 |
EChunkedRetrieve, // not an active state
|
|
598 |
EChunkedAdd, // not an active state
|
|
599 |
EChunkedReplace // not an active state
|
|
600 |
};
|
|
601 |
TState iState; // The state of the active object
|
|
602 |
|
|
603 |
};
|
|
604 |
|
|
605 |
#endif // MMSCODECCLIENT_H
|
|
606 |
|
|
607 |
// End of File
|