email/imap4mtm/imapmailstore/inc/cfetchbodyinfo.h
author hgs
Thu, 04 Nov 2010 02:02:03 +0530
changeset 81 2043ea884c04
parent 80 8b14b30db193
permissions -rw-r--r--
201044_03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
80
8b14b30db193 201044_02
hgs
parents:
diff changeset
     1
// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
8b14b30db193 201044_02
hgs
parents:
diff changeset
     2
// All rights reserved.
8b14b30db193 201044_02
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
8b14b30db193 201044_02
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
8b14b30db193 201044_02
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
8b14b30db193 201044_02
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
8b14b30db193 201044_02
hgs
parents:
diff changeset
     7
//
8b14b30db193 201044_02
hgs
parents:
diff changeset
     8
// Initial Contributors:
8b14b30db193 201044_02
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
8b14b30db193 201044_02
hgs
parents:
diff changeset
    10
//
8b14b30db193 201044_02
hgs
parents:
diff changeset
    11
// Contributors:
8b14b30db193 201044_02
hgs
parents:
diff changeset
    12
//
8b14b30db193 201044_02
hgs
parents:
diff changeset
    13
// Description:
8b14b30db193 201044_02
hgs
parents:
diff changeset
    14
//
8b14b30db193 201044_02
hgs
parents:
diff changeset
    15
8b14b30db193 201044_02
hgs
parents:
diff changeset
    16
#ifndef __CFETCHBODYINFO_H__
8b14b30db193 201044_02
hgs
parents:
diff changeset
    17
#define __CFETCHBODYINFO_H__
8b14b30db193 201044_02
hgs
parents:
diff changeset
    18
8b14b30db193 201044_02
hgs
parents:
diff changeset
    19
#include <e32std.h>
8b14b30db193 201044_02
hgs
parents:
diff changeset
    20
#include <msvstd.h>
8b14b30db193 201044_02
hgs
parents:
diff changeset
    21
#include <miuthdr.h>
8b14b30db193 201044_02
hgs
parents:
diff changeset
    22
#include <cimcaf.h>
8b14b30db193 201044_02
hgs
parents:
diff changeset
    23
8b14b30db193 201044_02
hgs
parents:
diff changeset
    24
/**
8b14b30db193 201044_02
hgs
parents:
diff changeset
    25
Represents a message body or attachent part  
8b14b30db193 201044_02
hgs
parents:
diff changeset
    26
@internalTechnology
8b14b30db193 201044_02
hgs
parents:
diff changeset
    27
@prototype
8b14b30db193 201044_02
hgs
parents:
diff changeset
    28
*/
8b14b30db193 201044_02
hgs
parents:
diff changeset
    29
8b14b30db193 201044_02
hgs
parents:
diff changeset
    30
class CFetchBodyInfo : public CBase
8b14b30db193 201044_02
hgs
parents:
diff changeset
    31
	{
8b14b30db193 201044_02
hgs
parents:
diff changeset
    32
public:
8b14b30db193 201044_02
hgs
parents:
diff changeset
    33
	IMPORT_C static CFetchBodyInfo* NewLC(TMsvId aPartId);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    34
	IMPORT_C static CFetchBodyInfo* NewL(TMsvId aPartId);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    35
	~CFetchBodyInfo();
8b14b30db193 201044_02
hgs
parents:
diff changeset
    36
	
8b14b30db193 201044_02
hgs
parents:
diff changeset
    37
	IMPORT_C TInt32 SizeToFetch();
8b14b30db193 201044_02
hgs
parents:
diff changeset
    38
	IMPORT_C TMsvId PartId();
8b14b30db193 201044_02
hgs
parents:
diff changeset
    39
	IMPORT_C HBufC8* RelativePath() const;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    40
	IMPORT_C TInt32 BodyPartRemainingSize();
8b14b30db193 201044_02
hgs
parents:
diff changeset
    41
	IMPORT_C TBool IsText();
8b14b30db193 201044_02
hgs
parents:
diff changeset
    42
	
8b14b30db193 201044_02
hgs
parents:
diff changeset
    43
	IMPORT_C void SetSizeToFetch(TInt32 aSize);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    44
	IMPORT_C void SetIsText(TBool aIsText);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    45
	IMPORT_C void SetPartId(const TMsvId aId);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    46
	IMPORT_C void SetRelativePathL(const TDesC8& aPath); 
8b14b30db193 201044_02
hgs
parents:
diff changeset
    47
	IMPORT_C void SetBodyPartRemainingSize(const TInt32 aSize);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    48
	IMPORT_C void SetContentTransferEncoding(const TImEncodingType);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    49
	IMPORT_C void SetCharsetId(const TUint aCharsetId);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    50
	IMPORT_C TImEncodingType ContentTransferEncoding() const;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    51
	IMPORT_C TUint CharsetId() const;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    52
	IMPORT_C void SetCaf(CImCaf* aCaf);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    53
	IMPORT_C void ResetCaf();
8b14b30db193 201044_02
hgs
parents:
diff changeset
    54
	IMPORT_C CImCaf* Caf() const;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    55
	IMPORT_C TInt32 BytesFetched();
8b14b30db193 201044_02
hgs
parents:
diff changeset
    56
	IMPORT_C void IncrementBytesFetched(TInt32 aByteCount);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    57
	inline TBool PartialDownload();
8b14b30db193 201044_02
hgs
parents:
diff changeset
    58
	inline void SetPartialDownload(TBool aFlag);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    59
public:
8b14b30db193 201044_02
hgs
parents:
diff changeset
    60
	TBool iEmbed;	
8b14b30db193 201044_02
hgs
parents:
diff changeset
    61
8b14b30db193 201044_02
hgs
parents:
diff changeset
    62
private:
8b14b30db193 201044_02
hgs
parents:
diff changeset
    63
	CFetchBodyInfo(TMsvId aPartId);
8b14b30db193 201044_02
hgs
parents:
diff changeset
    64
	void ConstructL();
8b14b30db193 201044_02
hgs
parents:
diff changeset
    65
8b14b30db193 201044_02
hgs
parents:
diff changeset
    66
private:
8b14b30db193 201044_02
hgs
parents:
diff changeset
    67
	//the size of the data we want to retrieve
8b14b30db193 201044_02
hgs
parents:
diff changeset
    68
	TInt32 iSizeToFetch;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    69
	//if the data is text then its a body part, otherwise its an attachment
8b14b30db193 201044_02
hgs
parents:
diff changeset
    70
	TBool iIsText;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    71
	// the tmsvid where the data will be stored in the message store
8b14b30db193 201044_02
hgs
parents:
diff changeset
    72
	TMsvId  iPartId;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    73
	//  the body sections we will be retrieving, eg 1, or 1.2 or 1.text
8b14b30db193 201044_02
hgs
parents:
diff changeset
    74
	HBufC8* iRelativePath;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    75
	//for a partial fetch this is the amount of data not being fetched
8b14b30db193 201044_02
hgs
parents:
diff changeset
    76
	TInt32  iBodyPartRemainingSize;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    77
	// the encoding method thats been used to encode the data
8b14b30db193 201044_02
hgs
parents:
diff changeset
    78
	TImEncodingType iContentTransferEncoding;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    79
	// the chrachter set id
8b14b30db193 201044_02
hgs
parents:
diff changeset
    80
	TUint iCharsetId;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    81
	//Content Access Framework Wrapper class, not owned by this class.
8b14b30db193 201044_02
hgs
parents:
diff changeset
    82
	CImCaf* iCaf;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    83
	//A count of the bytes that have been fetched.
8b14b30db193 201044_02
hgs
parents:
diff changeset
    84
	TInt32 iBytesFetched;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    85
   //Flag to indicate whether we are downloading the mail, partially or fully ..
8b14b30db193 201044_02
hgs
parents:
diff changeset
    86
   TBool iPartialDownload;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    87
	};
8b14b30db193 201044_02
hgs
parents:
diff changeset
    88
8b14b30db193 201044_02
hgs
parents:
diff changeset
    89
inline TBool CFetchBodyInfo::PartialDownload()
8b14b30db193 201044_02
hgs
parents:
diff changeset
    90
    {
8b14b30db193 201044_02
hgs
parents:
diff changeset
    91
    return iPartialDownload;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    92
    }
8b14b30db193 201044_02
hgs
parents:
diff changeset
    93
8b14b30db193 201044_02
hgs
parents:
diff changeset
    94
inline void CFetchBodyInfo::SetPartialDownload(TBool aFlag)
8b14b30db193 201044_02
hgs
parents:
diff changeset
    95
    {
8b14b30db193 201044_02
hgs
parents:
diff changeset
    96
    iPartialDownload =aFlag;
8b14b30db193 201044_02
hgs
parents:
diff changeset
    97
    }
8b14b30db193 201044_02
hgs
parents:
diff changeset
    98
8b14b30db193 201044_02
hgs
parents:
diff changeset
    99
#endif // __CFETCHBODYINFO_H__