email/email/smtp/inc/cimmessagepart.h
author Maciej Seroka <maciejs@symbian.org>
Fri, 05 Mar 2010 11:15:10 +0000
branchSymbian3
changeset 18 147b85a37c23
permissions -rw-r--r--
Fixed Email Smoke Test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
// under the terms of the License "Symbian Foundation License v1.0"
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     7
//
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
//
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
// Contributors:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
//
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
// Description:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
// cimmessagepart.h
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
//
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
/**
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
 * @file 
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
 * @
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
 * @released
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
 */
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
#ifndef __CIMMESSAGEPART_H__
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
#define __CIMMESSAGEPART_H__
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
class CImEmailMessage;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
class CImMimeHeader;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
class CMsvMimeHeaders;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
class CImHtmlConverter;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
class TImCreateMessageOptions
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
/**
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
@internalComponent
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
@released
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
*/
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
	{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
public:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
	TMsvPartList		iMsvPartList;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
	TMsvEmailTypeList	iMsvEmailTypeList;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
	TUid				iMessageType;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
	};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
class CImRemoveMessagePart : public CMsvOperation
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
/**
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
@internalComponent
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
@released
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
*/
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
	{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
public:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
	static CImRemoveMessagePart* DeleteAttachmentL(TRequestStatus &aStatus, CMsvEntry& aMsvEntry, TMsvId aMessageId, TMsvId aAttachmentId);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
	static CImRemoveMessagePart* DeleteAttachedMessageL(TRequestStatus &aStatus, CMsvEntry& aMsvEntry, TMsvId aMessageId, TMsvId aAttachedMessageId);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
	~CImRemoveMessagePart();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
	const TDesC8& FinalProgress();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
	void DoCancel();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
	void RunL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
	const TDesC8& ProgressL();		// returns NULL until operation completed - then returns MessageId
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
	TMsvId RemovedAttachmentId();	
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
private:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
	CImRemoveMessagePart(TRequestStatus& aStatus, CMsvEntry& aMsvEntry, TMsvId aMessageId);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
	void ConstructL(TMsvId aAttachmentId);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
	void ErrorRecovery(TInt aError);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
	void SelectNextStateL();					// selects next state to go to
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
	void ChangeStateL();					// initiates the next state operation
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
	void SelectAndChangeToNextStateL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
	void RequestComplete(TInt aError);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
	void Recover();							// leave message in a 'good' state
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
	void CheckAttachmentParentTypeL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
	void MoveOtherEntryToParentOfFolderL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
	void DeleteAttachmentEntryL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
	void DeleteFolderEntryL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
	void CompleteRemoveMessagePartL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
private:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
	enum TImRemoveMessagePartState
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
		{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
		ECheckAttachmentParentType,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
		EMoveOtherEntryToParentOfFolder,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
		EDeleteAttachmentEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
		EDeleteFolderEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
		ECompleteRemoveMessagePart,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
		EFinished
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
		};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    84
	CMsvEntry&			iMsvEntry;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    85
	CMsvOperation*		iMsvOperation;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    86
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    87
	CMsvEntrySelection*	iMessageEntrySelection;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    88
	CImEmailMessage*	iEmailMessage;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    89
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    90
	TInt				iState;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    91
	TPckgBuf<TMsvId>	iDataMember;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    92
	TMsvId				iMessageId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    93
	TMsvId				iFolderToDeleteId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
	TInt				iAttachmentSize;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
	TMsvId				iAttachmentId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
	TMsvId				iEntryToMoveId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
	};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
class CImStoreMessagePart : public CMsvOperation
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   100
/**
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   101
@internalComponent
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   102
@released
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   103
*/
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
	{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
public:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
	static CImStoreMessagePart* AddAttachmentL(TMsvId aMessageId, const TDesC& aFilePath, CMsvEntry& aMsvEntry,CMsvAttachment* aAttachmentInfo,TRequestStatus& aStatus );
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
	static CImStoreMessagePart* AddEntryAsAttachmentL(TMsvId aMessageId,TMsvId aAttachmentMessageId, CMsvEntry& aMsvEntry, CMsvAttachment* aAttachmentInfo,TRequestStatus& aStatus);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
	static CImStoreMessagePart* AddAttachmentL(TMsvId aMessageId,RFile& aFile, CMsvEntry& aMsvEntry, CMsvAttachment* aAttachmentInfo, TRequestStatus& aStatus);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
	static CImStoreMessagePart* AddLinkedAttachmentL(TMsvId aMessageId,const TDesC& aFilePath, CMsvEntry& aMsvEntry,CMsvAttachment* aAttachmentInfo,TRequestStatus& aStatus );	
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
	static CImStoreMessagePart* CreateAttachmentL(TMsvId aMessageId,const TDesC& aFileName, RFile& aAttachmentFile,CMsvEntry& aMsvEntry, CMsvAttachment* aAttachmentInfo, TRequestStatus& aStatus);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
	static CImStoreMessagePart* AddRelatedPartL(TRequestStatus &aStatus, CMsvEntry& aMsvEntry, TMsvId aMessageId, const TDesC& aAttachmentFullName, TMsvId aRelatedPartId, const TDesC8& aContentId);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   112
	static CImStoreMessagePart* StoreBodyTextL(TRequestStatus& aStatus, CMsvEntry& aMsvEntry, TMsvId aMessageId, CRichText& aRichText, TBool aUsePlainTextStorage = EFalse);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   113
	static CImStoreMessagePart* StoreBodyTextWithMimeHeaderL(TRequestStatus& aStatus, CMsvEntry& aMsvEntry, TMsvId aMessageId, CRichText& aRichText, const CImMimeHeader& aMimeHeader, TBool aUsePlainTextStorage = EFalse);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   114
	static CImStoreMessagePart* StorePlainBodyTextL(TRequestStatus& aStatus, CMsvEntry& aMsvEntry, TMsvId aMessageId, TBool aUsePlainTextStorage = ETrue);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   115
	static CImStoreMessagePart* StorePlainBodyTextL(TRequestStatus& aStatus, CMsvEntry& aMsvEntry, TMsvId aMessageId, CImMimeHeader& aMimeHeader, TBool aUsePlainTextStorage = ETrue);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   116
	~CImStoreMessagePart();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   117
	const TDesC8& FinalProgress();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   118
	void DoCancel();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   119
	void RunL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   120
	const TDesC8& ProgressL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   121
private:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   122
	enum TImMessagePart
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   123
		{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   124
		EMessagePartAttachment,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   125
		EMessagePartBody,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   126
		EMessagePartMessageAttachment
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   127
		};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   128
	void ConstructL(RFile& aFile);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   129
	void ConstructL(RFile& aFile,const TDesC& aAttachmentName);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
	void ConstructL(const TDesC& aAttachmentFullName, const TDesC8& aContentId);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   131
	void ConstructAttachmentInfo(CMsvAttachment* aAttachmentInfo,TInt aAttachmentCreationState);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
	CImStoreMessagePart(TRequestStatus& aStatus, CMsvEntry& aMsvEntry, TMsvId aMessageId, TBool aUsePlainTextStorage = EFalse);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
	
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
	void ConstructL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
	void ConstructL(const TDesC& aAttachmentFullName);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
	void ConstructL(TMsvId aAttachmentMessageId);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
	void ConstructL(const TDesC& aAttachmentFullName, TMsvId aRelatedPartId, const TDesC8& aContentId);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
	void ConstructL(CRichText& aRichText);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
	void ConstructL(CRichText& aRichText, const CImMimeHeader& aMimeHeader);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
	void ConstructL(CImMimeHeader& aMimeHeader);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
	void ConstructL(TImMessagePart aMessagePart);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
	void ErrorRecovery(TInt error);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   143
	void SelectNextStateL();				// selects next state to go to
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   144
	void ChangeStateL();					// initiates the next state operation
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
	void SelectAndChangeToNextStateL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
	void RequestComplete(TInt aError);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   147
	void Recover();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   148
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   149
	TBool HTMLMessage() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   150
	void SetHTMLMessage(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   151
	TBool MultipartMixedExists() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
	void SetMultipartMixedExists(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
	TBool MultipartMixedCreated() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
	void SetMultipartMixedCreated(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
	TBool MultipartAlternativeExists() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
	void SetMultipartAlternativeExists(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
	TBool MultipartAlternativeCreated() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
	void SetMultipartAlternativeCreated(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
	TBool MultipartRelatedExists() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
	void SetMultipartRelatedExists(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
	TBool MultipartRelatedCreated() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
	void SetMultipartRelatedCreated(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   163
	TBool TextPartExists() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
	void SetTextPartExists(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
	TBool TextPartCreated() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   166
	void SetTextPartCreated(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   167
 	TBool AttachmentEntryCreated() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
	void SetAttachmentEntryCreated(TBool aFlag);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   170
	void FindMultipartRelatedFolderL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   171
	void CheckForSubfolderL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   172
	void CreateAttachmentEntryL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   173
	void CopyOrigMessageToMessageL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   174
	void CreateMultipartMixedFolderEntryL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   175
	void CreateMultipartAlternativeFolderEntryL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   176
	void CreateMultipartRelatedFolderEntryL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   177
	void MoveOriginalMessageEntryChildrenToNewFolderL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   178
	void CreateTextEntryL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
	void StoreRichTextL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   180
	void CompleteStoreMessagePartL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   181
	void CreateHTMLEntryL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
	void PrepareToStoreHTMLEntryTextL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   183
	void StoreHTMLEntryTextL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
	void RemoveHTMLEntryL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
	void MoveTextEntryToAltFolderL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
	TPtrC GetDefaultAttachmentName();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
	void OpenAndReadResourceFileL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
	void StoreMimeHeaderL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
	TBool CreateAttachmentMimeHeaderL(CImMimeHeader& aMimeHeader, const TDesC& aDetails);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
	void CreateFolderMimeHeaderL(CImMimeHeader& aMimeHeader);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
	void CreateMessageMimeHeaderL(CImMimeHeader& aMimeHeader);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
	void AddAttachmentL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
	void AddAttachmentUsingFileHandleL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
	void AddLinkedAttachmentL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
	void AddEntryAsAttachmentL();	
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
	void CreateAttachmentL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
	void DoAttachmentStoreL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
	TInt CheckMimeInAttachmentInfoL(CMsvMimeHeaders& aMsvMimeHeaders);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
	CImMimeHeader* ProcessAttachmentMimeHeadersL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   200
	void SetEntryDetailsL(TMsvEntry& aEntry);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   201
	void StorePlainTextL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
private:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   203
	enum TImStoreMessagePartState
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
		{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
		EFindMultipartRelatedFolder,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
		ECheckForSubfolder,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
		ECreateAttachmentEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
		EStoreAttachment,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   209
		ECopyOrigMessageToMessage,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
		ECreateMultipartMixedFolderEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
		ECreateMultipartRelatedFolderEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   212
		ECreateMultipartAlternativeFolderEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   213
		EMoveOriginalMessageEntryChildrenToNewFolder,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   214
		ECreateTextEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   215
		EStoreRichText,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   216
		ERemoveHTMLEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
		EMoveTextToAlternativeFolder,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
		ECreateHTMLEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   219
		EPrepareToStoreHTMLEntryText,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   220
		EStoreHTMLEntryText,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   221
		ECompleteStoreMessage,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   222
		EFinished
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   223
		,EStoreHTMLTextInEntry,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   224
		EAddEntryAttachment	
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
		};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   227
	enum TImStoreMessagePartFlags
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   228
		{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   229
		KStoreMessagePartClearFlag							= 0x00000000,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
		KStoreMessagePartHTMLMessage						= 0x00000001,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
		KStoreMessagePartMultipartMixedExists				= 0x00000002,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
		KStoreMessagePartMultipartMixedCreated				= 0x00000004,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   233
		KStoreMessagePartMultipartAlternativeExists			= 0x00000008,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   234
		KStoreMessagePartMultipartAlternativeCreated		= 0x00000010,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   235
		KStoreMessagePartTextPartExists						= 0x00000020,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
		KStoreMessagePartTextPartCreated					= 0x00000040,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   237
		KStoreMessagePartAttachmentEntryCreated				= 0x00000080,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   238
		KStoreMessagePartOrigMessageEntryChildrenCopied		= 0x00000100,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   239
		KStoreMessagePartOrigMessageEntryChildrenDeleted	= 0x00000200,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   240
		KStoreMessagePartMultipartRelatedExists				= 0x00000400,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
		KStoreMessagePartMultipartRelatedCreated			= 0x00000800
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
		};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
	CMsvEntry&			iMsvEntry;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   244
	CMsvOperation*		iMsvOperation;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   245
	
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
	CRichText*			iRichTextToStore; // I don't own this object!
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
	CImMimeHeader*		iMimeHeaderOfBodyText;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
	CRichText*			iRichText;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
	CFileMan*			iFileMan;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
	CMsvEntrySelection* iMessageEntrySelection;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   252
	TInt				iState;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   253
	TPckgBuf<TMsvId>	iDataMember;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
	TMsvId				iMessageId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
	TImMessagePart		iMessagePart;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   256
	TMsvId				iMixFolderId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   257
	TMsvId				iAltFolderId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
	TMsvId				iRelFolderId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
	HBufC*				iAttachmentFullName;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   260
	TInt				iAttachmentSize;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   261
	TMsvId				iAttachmentId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   262
	TMsvId				iTextId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   263
	TMsvId				iHtmlId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
	TMsvId				iRelatedPartId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   265
	TMsvId				iAttachmentMessageId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   266
	TUint32				iFlags;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
	HBufC8*				iContentId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   268
	CImEmailMessage*	iEmailMessage;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   269
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   270
	// Used when converting rich text to html
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   271
	CParaFormatLayer*	iParaLayer;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   272
	CCharFormatLayer*	iCharLayer;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   273
	CImHtmlConverter* 	iHtmlConverter;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
	TBool iFinishedConvertingHTML;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
	CMsvAttachment*		iAttachmentInfo;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
	CMsvStore* 			iStore;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   277
	TInt 				iAttachmentCreateState;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   278
	TBool				iIsAddByFileHandle;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
	RFile*				iFileHandle;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
	RFile               iFile;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
	// Indicates whether to store message body as CRichText or plaintext.
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
	TBool 				iUsePlainTextStorage;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
	// Size of the plain text body.
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
	TInt				iSizeOfBody;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
	// Size of the Fwd'ed/ReplyTo plaintext body part.
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   286
	TInt				iSizeFwdReplyBody;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   287
	// The error value returned when CRichText is populated with message body text.
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   288
	TInt 				iRestoreErr;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   289
	enum TImAttachmentCreation
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   290
		{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   291
		EAddAttachment,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   292
		EAddAttachmentUsingFileHandle,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   293
		EAddLinkedAttachment,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   294
		EAddEntryAsAttachment,
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   295
		ECreateAttachment
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   296
		};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   297
	};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   298
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   299
class CImHtmlConverter : public CBase
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   300
/**
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   301
@internalComponent
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   302
@released
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   303
*/
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   304
	{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   305
public:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   306
	static CImHtmlConverter* NewL(CMsvEntry& aMsvEntry, CParaFormatLayer& aParaLayer, CCharFormatLayer& aCharLayer);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   307
	~CImHtmlConverter();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   308
	void PrepareToStoreHTMLEntryTextL(TMsvId& aHtmlId, const TMsvId aTextId);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   309
	void ResetStoreL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   310
	void ResetStoreWithoutCommit();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   311
	TBool StoreHTMLEntryTextAL(TRequestStatus& aStatus);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   312
	CMsvOperation* ChangeHTMLTextInEnrtyL(TRequestStatus& aStatus);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   313
	
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   314
	void ReadDefaultAttachmentNameL( RResourceFile& resourceFile);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   315
	TInt Size() const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   316
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   317
private:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   318
	CImHtmlConverter(CMsvEntry&	aMsvEntry, CParaFormatLayer& aParaLayer, CCharFormatLayer& aCharLayer);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   319
	TFileName HtmlFilename(CMsvEntry& aEntry, TPtrC aFileName);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   320
	TPtrC GetDefaultAttachmentName();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   321
	void ConstructL();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   322
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   323
private:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   324
	CMsvEntry&			iMsvEntry;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   325
	CParaFormatLayer&	iParaLayer;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   326
	CCharFormatLayer&	iCharLayer;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   327
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   328
	CConverterBase*		iToHTMLConverter;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   329
	CCnaConverterList*	iConverterList;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   330
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   331
	TMsvId				iTextId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   332
	TMsvId				iHtmlId;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   333
	TInt				iSize;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   334
	HBufC*				iDefaultAttachmentName;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   335
	CRichText*			iRichText;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   336
	RDesReadStream 		iSourceStream;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   337
	RFileWriteStream	iTargetStream;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   338
	CMsvStore*			iStore;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   339
	RFile 				iFile;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   340
	};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   341
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   342
class CImStoreResolver : public CBase, public MRichTextStoreResolver
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   343
/**
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   344
@internalComponent
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   345
@released
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   346
*/
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   347
	{
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   348
public:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   349
	CImStoreResolver(CStreamStore* aStore);
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   350
	~CImStoreResolver();
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   351
	//
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   352
private:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   353
	const CStreamStore& StreamStoreL(TInt aPos)const;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   354
	//
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   355
private:
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   356
	CStreamStore* iStore;
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   357
	};
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   358
147b85a37c23 Fixed Email Smoke Test
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   359
#endif //__CIMMESSAGEPART_H__