email/imap4mtm/imapmailstore/inc/cstoreutilities.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2006-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 #ifndef __CSTOREUTILITIES_H__
       
    18 #define __CSTOREUTILITIES_H__
       
    19 
       
    20 #include <imcvsend.h>
       
    21 #include <cmsvbodytext.h>
       
    22 #include "cimapsettings.h"
       
    23 
       
    24 /**
       
    25 Used for requests to store CImHeader objects.
       
    26 @internalComponent
       
    27 @prototype
       
    28 */
       
    29 class CStoreUtilities : public CBase
       
    30 	{
       
    31 public:
       
    32 	static CStoreUtilities* NewL(TImEncodingType aEncodingType,TUint aCharsetId,RFs& aFs);
       
    33 	virtual ~CStoreUtilities();
       
    34 	HBufC8* DecodeL(const TPtrC8& aBodyData, const TBool aEndOfStream);
       
    35 	void WriteToBodyL(const TDesC8& aText,CRichText* aMessageBody);
       
    36 	void AttachFooterInfoL(TInt32 aBodyPartRemainingSize,CImapSettings& aImapSettings,HBufC8*& aDecodedData);
       
    37 private:
       
    38 	CStoreUtilities(TImEncodingType aEncodingType,TUint aCharsetId,RFs& aFs);
       
    39 	void ConstructL();
       
    40 	void AppendExtendL(HBufC8** aBufferPtr, const TDesC8& aText);
       
    41 	TBool CheckUUEStartL(const TDesC8& aSourceLine);
       
    42 private:
       
    43 	TBuf8<20>				iLeftOver;
       
    44 	// Decoder used for fetch in progres
       
    45 	TImCodecB64				iB64Decoder;
       
    46 	TImCodecUU				iUUDecoder;
       
    47 	TImCodecQP				iQPDecoder;
       
    48 	HBufC8*					iPartialLine;
       
    49 	// Bool to indicate that we are in between of a UUEncoded start and end tag.
       
    50 	TBool					iUUDecoding;
       
    51 	HBufC*					iFooterString;
       
    52 	TImEncodingType			iEncodingType;
       
    53 	CImConvertCharconv*		iCharConv;
       
    54 	CCnvCharacterSetConverter* iCharacterConverter;
       
    55 	TUint					iCharsetId;
       
    56 	RFs&					iFs;
       
    57 	};
       
    58 
       
    59 #endif //__CSTOREUTILITIES_H__