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