williamr@2
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef _CIMPLAINBODYTEXT_H_
|
williamr@2
|
17 |
#define _CIMPLAINBODYTEXT_H_
|
williamr@2
|
18 |
|
williamr@2
|
19 |
class CImEmailMessage;
|
williamr@2
|
20 |
class CImStoreMessagePart;
|
williamr@2
|
21 |
class CMsgActive;
|
williamr@2
|
22 |
/**
|
williamr@2
|
23 |
This class is a wrapper over CMsvPlainBodyText class of message server.
|
williamr@2
|
24 |
The pointer to this class can be obtained by calling OpenPlainBodyTextForReadL
|
williamr@2
|
25 |
or OpenPlainBodyTextForWriteL API of the CImEmailMessage class.
|
williamr@2
|
26 |
This can be used to store/restore a email message created by using the
|
williamr@2
|
27 |
CImEmailOperation class.
|
williamr@2
|
28 |
|
williamr@2
|
29 |
@see CImEmailMessage, CImEmailOperation
|
williamr@2
|
30 |
@publishedAll
|
williamr@2
|
31 |
@released
|
williamr@2
|
32 |
*/
|
williamr@2
|
33 |
|
williamr@2
|
34 |
class CImPlainBodyText: public CMsgActive
|
williamr@2
|
35 |
{
|
williamr@2
|
36 |
public:
|
williamr@2
|
37 |
static CImPlainBodyText* NewL(CImEmailMessage& aEmailMessage, CMsvEntry& aMsvEntry, CImEmailMessage::TImEmailEntryType aEntryType, TInt aChunkLength, TBool aEditMode);
|
williamr@2
|
38 |
IMPORT_C ~CImPlainBodyText();
|
williamr@2
|
39 |
|
williamr@2
|
40 |
IMPORT_C void StoreChunkL(const TDesC8& aChunk, TRequestStatus& aStatus);
|
williamr@2
|
41 |
IMPORT_C void StoreChunkL(const TDesC8& aChunk);
|
williamr@2
|
42 |
|
williamr@2
|
43 |
IMPORT_C void StoreChunkL(const TDesC16& aChunk, TRequestStatus& aStatus);
|
williamr@2
|
44 |
IMPORT_C void StoreChunkL(const TDesC16& aChunk);
|
williamr@2
|
45 |
|
williamr@2
|
46 |
IMPORT_C void StoreRichTextAsPlainTextL(CRichText& aRichText);
|
williamr@2
|
47 |
|
williamr@2
|
48 |
IMPORT_C void CommitL(TRequestStatus& aStatus);
|
williamr@2
|
49 |
IMPORT_C void CommitL(TRequestStatus& aStatus, CImMimeHeader& aMimeHeader);
|
williamr@2
|
50 |
|
williamr@2
|
51 |
IMPORT_C void NextChunkL(TDes8& aChunk, TRequestStatus& aStatus);
|
williamr@2
|
52 |
IMPORT_C void NextChunkL(TDes8& aChunk);
|
williamr@2
|
53 |
|
williamr@2
|
54 |
IMPORT_C void NextChunkL(TDes16& aChunk, TRequestStatus& aStatus);
|
williamr@2
|
55 |
IMPORT_C void NextChunkL(TDes16& aChunk);
|
williamr@2
|
56 |
|
williamr@2
|
57 |
IMPORT_C void PreviousChunkL(TDes8& aChunk, TRequestStatus& aStatus);
|
williamr@2
|
58 |
IMPORT_C void PreviousChunkL(TDes8& aChunk);
|
williamr@2
|
59 |
|
williamr@2
|
60 |
IMPORT_C void PreviousChunkL(TDes16& aChunk, TRequestStatus& aStatus);
|
williamr@2
|
61 |
IMPORT_C void PreviousChunkL(TDes16& aChunk);
|
williamr@2
|
62 |
|
williamr@2
|
63 |
private:
|
williamr@2
|
64 |
CImPlainBodyText(CImEmailMessage& aEmailMessage, CMsvEntry& aMsvEntry);
|
williamr@2
|
65 |
void ConstructL(TInt aChunkLength, CImEmailMessage::TImEmailEntryType aEntryType, TBool aEditMode);
|
williamr@2
|
66 |
void DoRunL(); // From CMsgActive
|
williamr@2
|
67 |
void DoCancel();
|
williamr@2
|
68 |
private:
|
williamr@2
|
69 |
CImEmailMessage& iEmailMessage;
|
williamr@2
|
70 |
CImStoreMessagePart* iStoreMessagePart;
|
williamr@2
|
71 |
/** The CMsvEntry associated with the message being stored/restored.*/
|
williamr@2
|
72 |
CMsvEntry& iMsvEntry;
|
williamr@2
|
73 |
/** The array of framework/server class to store/restore body text in chunks.*/
|
williamr@2
|
74 |
RPointerArray<CMsvPlainBodyText> iPlainTextArray;
|
williamr@2
|
75 |
/** The id of the message. */
|
williamr@2
|
76 |
TMsvId iMessageId;
|
williamr@2
|
77 |
/** The Store associated with the message being stored/restored.*/
|
williamr@2
|
78 |
CMsvStore* iStore;
|
williamr@2
|
79 |
/** For indexing the plaintext array */
|
williamr@2
|
80 |
TInt iIndex;
|
williamr@2
|
81 |
/** The 16-bit pointer to a chunk that will be populated with data when asynchronous
|
williamr@2
|
82 |
16-bit versions of NextChunkL / PreviousChunkL returns.*/
|
williamr@2
|
83 |
TDes16* iChunk16;
|
williamr@2
|
84 |
/** The 8-bit pointer to a chunk that will be populated with data when asynchronous
|
williamr@2
|
85 |
8-bit versions of NextChunkL / PreviousChunkL returns.*/
|
williamr@2
|
86 |
TDes8* iChunk8;
|
williamr@2
|
87 |
|
williamr@2
|
88 |
/** Enum indicating which asynchronous chunk retrieving method resulted in a
|
williamr@2
|
89 |
call to DoRunl.*/
|
williamr@2
|
90 |
enum TChunkRetrievalState
|
williamr@2
|
91 |
{
|
williamr@2
|
92 |
EIdleState,
|
williamr@2
|
93 |
ENextChunk8Bit,
|
williamr@2
|
94 |
ENextChunk16Bit,
|
williamr@2
|
95 |
EPreviousChunk8Bit,
|
williamr@2
|
96 |
EPreviousChunk16Bit,
|
williamr@2
|
97 |
} iChunkRetrievalState;
|
williamr@2
|
98 |
};
|
williamr@2
|
99 |
|
williamr@2
|
100 |
#endif //_CIMPLAINBODYTEXT_H_
|