email/imap4mtm/imapmailstore/inc/cbodyqueueentry8.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 #ifndef _CBODYQUEUEENTRY8_H__
       
    17 #define _CBODYQUEUEENTRY8_H__
       
    18 
       
    19 #include <miuthdr.h>
       
    20 #include "cqueueentrybase.h"
       
    21 #include "cstoreutilities.h"
       
    22 
       
    23 class CBufBase;
       
    24 class CMsvBodyText;
       
    25 /**
       
    26 Used to hold chunk info when sorting chunks into the correct order.
       
    27 @internalComponent
       
    28 @prototype
       
    29 */
       
    30 class CBodyChunk8Info : public CBase
       
    31 	{
       
    32 public:
       
    33 	CBodyChunk8Info(TInt aChunkNumber,HBufC8* aData);
       
    34 	~CBodyChunk8Info();
       
    35 public:
       
    36 	TInt iChunkNumber;
       
    37 	HBufC8* iData;	
       
    38 	};
       
    39 
       
    40 /**
       
    41 Used for requests to store body text.
       
    42 @internalComponent
       
    43 @prototype
       
    44 */
       
    45 class CBodyQueueEntry8 : public CQueueEntryBase
       
    46 	{
       
    47 public:		
       
    48 	static CBodyQueueEntry8* NewL(TInt aTotalChunks,CImapMailStore& aParent,CMsvServerEntry& aServerEntry,CImapSettings& aImapSettings,CFetchBodyInfo& aFetchBodyInfo,TInt aLogId,MMailStoreObserver& aObserver, TBool aBinaryCap);
       
    49 	~CBodyQueueEntry8();
       
    50 	void AddChunkL(HBufC8* aData,TInt aChunkNumber, TInt aExtraFetchRequestCount);
       
    51 protected:
       
    52 	virtual void RunL();
       
    53 	virtual TInt RunError(TInt aError);
       
    54 private:
       
    55 	void ConstructL();
       
    56 	CBodyQueueEntry8(TInt aTotalChunks,CImapMailStore& aParent,CMsvServerEntry& aServerEntry,CImapSettings& aImapSettings,CFetchBodyInfo& aFetchBodyInfo,TInt aLogId,MMailStoreObserver& aObserver, TBool aBinaryCap);
       
    57 	static TInt CompareChunks(const CBodyChunk8Info& aChunkBodyInfo1,const CBodyChunk8Info& aChunkBodyInfo2);
       
    58 private:	
       
    59 	CBufBase* iBodyBuf;
       
    60 	CMsvBodyText* iBodyText;
       
    61 	TInt iTotalChunks;
       
    62 	TInt iNextExpectedChunk;
       
    63 	TImEncodingType iEncoding;
       
    64 	TUint iCharsetId;
       
    65 	//for a partial fetch this is the amount of data not being fetched
       
    66 	TInt32  iBodyPartRemainingSize;
       
    67 	RPointerArray<CBodyChunk8Info> iDataArray;
       
    68 	CStoreUtilities* iStoreUtilities;
       
    69 	CImConvertCharconv*	iCharConv;
       
    70 	CCnvCharacterSetConverter* iCharacterConverter;
       
    71 	CImapSettings& iImapSettings;
       
    72 	TInt iLogId;
       
    73 #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)		
       
    74 	/** Flag to check if BINARY capability is set */
       
    75 	TBool iBinaryCap;
       
    76 	/** For message body download using Binary Fetch, this value indicates the extra Fetch Request given
       
    77 	which is not required.
       
    78 	*/
       
    79 	TInt iExtraFetchRequestCount;
       
    80 #endif
       
    81 	};
       
    82 	
       
    83 #endif// _CBODYQUEUEENTRY8_H__