1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef _CIMPLAINBODYTEXT_H_
17 #define _CIMPLAINBODYTEXT_H_
19 class CImEmailMessage;
20 class CImStoreMessagePart;
23 This class is a wrapper over CMsvPlainBodyText class of message server.
24 The pointer to this class can be obtained by calling OpenPlainBodyTextForReadL
25 or OpenPlainBodyTextForWriteL API of the CImEmailMessage class.
26 This can be used to store/restore a email message created by using the
27 CImEmailOperation class.
29 @see CImEmailMessage, CImEmailOperation
34 class CImPlainBodyText: public CMsgActive
37 static CImPlainBodyText* NewL(CImEmailMessage& aEmailMessage, CMsvEntry& aMsvEntry, CImEmailMessage::TImEmailEntryType aEntryType, TInt aChunkLength, TBool aEditMode);
38 IMPORT_C ~CImPlainBodyText();
40 IMPORT_C void StoreChunkL(const TDesC8& aChunk, TRequestStatus& aStatus);
41 IMPORT_C void StoreChunkL(const TDesC8& aChunk);
43 IMPORT_C void StoreChunkL(const TDesC16& aChunk, TRequestStatus& aStatus);
44 IMPORT_C void StoreChunkL(const TDesC16& aChunk);
46 IMPORT_C void StoreRichTextAsPlainTextL(CRichText& aRichText);
48 IMPORT_C void CommitL(TRequestStatus& aStatus);
49 IMPORT_C void CommitL(TRequestStatus& aStatus, CImMimeHeader& aMimeHeader);
51 IMPORT_C void NextChunkL(TDes8& aChunk, TRequestStatus& aStatus);
52 IMPORT_C void NextChunkL(TDes8& aChunk);
54 IMPORT_C void NextChunkL(TDes16& aChunk, TRequestStatus& aStatus);
55 IMPORT_C void NextChunkL(TDes16& aChunk);
57 IMPORT_C void PreviousChunkL(TDes8& aChunk, TRequestStatus& aStatus);
58 IMPORT_C void PreviousChunkL(TDes8& aChunk);
60 IMPORT_C void PreviousChunkL(TDes16& aChunk, TRequestStatus& aStatus);
61 IMPORT_C void PreviousChunkL(TDes16& aChunk);
64 CImPlainBodyText(CImEmailMessage& aEmailMessage, CMsvEntry& aMsvEntry);
65 void ConstructL(TInt aChunkLength, CImEmailMessage::TImEmailEntryType aEntryType, TBool aEditMode);
66 void DoRunL(); // From CMsgActive
69 CImEmailMessage& iEmailMessage;
70 CImStoreMessagePart* iStoreMessagePart;
71 /** The CMsvEntry associated with the message being stored/restored.*/
73 /** The array of framework/server class to store/restore body text in chunks.*/
74 RPointerArray<CMsvPlainBodyText> iPlainTextArray;
75 /** The id of the message. */
77 /** The Store associated with the message being stored/restored.*/
79 /** For indexing the plaintext array */
81 /** The 16-bit pointer to a chunk that will be populated with data when asynchronous
82 16-bit versions of NextChunkL / PreviousChunkL returns.*/
84 /** The 8-bit pointer to a chunk that will be populated with data when asynchronous
85 8-bit versions of NextChunkL / PreviousChunkL returns.*/
88 /** Enum indicating which asynchronous chunk retrieving method resulted in a
90 enum TChunkRetrievalState
97 } iChunkRetrievalState;
100 #endif //_CIMPLAINBODYTEXT_H_