|         |      1 // Copyright (c) 2004-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 __CMTF_TEST_ACTION_UTILS_EMAIL_MESSAGE_H__ | 
|         |     18 #define __CMTF_TEST_ACTION_UTILS_EMAIL_MESSAGE_H__ | 
|         |     19  | 
|         |     20 // System include | 
|         |     21 #include <e32base.h> | 
|         |     22 #include <msvapi.h> | 
|         |     23 #include <msvstd.h> | 
|         |     24 #include <miutmsg.h> | 
|         |     25  | 
|         |     26 #include "CMtfTestCase.h" | 
|         |     27  | 
|         |     28 /** | 
|         |     29   Stores the information of an email message. Creates and CImEmailMessage object  | 
|         |     30   for the message. Any operations related to the email message can be perfored using | 
|         |     31   this the CImEmailMessage object. | 
|         |     32    | 
|         |     33   The class stores the message part Id and the size information for  | 
|         |     34   Body Text and Html and also the Html path. | 
|         |     35    | 
|         |     36   If the Body Text part is modified, then StoreBodyTextInfoL() function needs to be  | 
|         |     37   called to update the stored Body Text information.  Similarly, StoreHtmlInfoL() function | 
|         |     38   needs to be called when Html part is modified by the email message object. | 
|         |     39      | 
|         |     40   @internalTechnology | 
|         |     41 */ | 
|         |     42 class CMtfTestActionUtilsEmailMessage | 
|         |     43 	{ | 
|         |     44 public: | 
|         |     45 	static CMtfTestActionUtilsEmailMessage* NewL(CMsvEntry& aMsvEntry, CMtfTestCase& aTestCase); | 
|         |     46  | 
|         |     47 	// Destructor | 
|         |     48 	~CMtfTestActionUtilsEmailMessage(); | 
|         |     49  | 
|         |     50 	// Sets the information about the Body text, Html and attachment parts | 
|         |     51 	TInt ProcessMessageInfoL(); | 
|         |     52 	 | 
|         |     53 	// Email message | 
|         |     54 	CImEmailMessage* GetEmailMessageL(); | 
|         |     55  | 
|         |     56 	// TMsvId of the email message | 
|         |     57 	TInt GetMessageId(TMsvId& aMsgId); | 
|         |     58  | 
|         |     59 	// Size of the email message | 
|         |     60 	TInt GetMessageSize(TInt32& aMsgSize); | 
|         |     61  | 
|         |     62 	// TMsvId of the Plain text part | 
|         |     63 	TMsvId GetBodyTextId(); | 
|         |     64  | 
|         |     65 	// Size of the Plain text part | 
|         |     66 	TInt32 GetBodyTextSize(); | 
|         |     67  | 
|         |     68 	// TMsvId of the Html part | 
|         |     69 	TMsvId GetHtmlEntryId(); | 
|         |     70  | 
|         |     71 	// Size of the Html part | 
|         |     72 	TInt32 GetHtmlSize(); | 
|         |     73  | 
|         |     74 	// Body Text | 
|         |     75 	void GetBodyTextL(CRichText& aRichText, CParaFormatLayer& aParaFormatLayer, | 
|         |     76 											CCharFormatLayer& aCharFormatLayer); | 
|         |     77  | 
|         |     78 	// Html file name | 
|         |     79 	TInt HtmlFileName(TPtrC& aHtmlFileName); | 
|         |     80  | 
|         |     81 	// Call asynchronous function to get the attachment list for the email message | 
|         |     82 	TInt GetMessageAttachmentListL(); | 
|         |     83  | 
|         |     84 	// Store the Id, size, and content information for the plain body text | 
|         |     85 	TInt StoreBodyTextInfoL(); | 
|         |     86  | 
|         |     87 	// Store the Id, size, and File name information for the Html part | 
|         |     88 	TInt StoreHtmlInfoL(); | 
|         |     89  | 
|         |     90 	// Check for the complete flag of the message part | 
|         |     91 	TInt CheckCompleteFlagL(TMsvId aMsgId, TBool& aCompleteFlate); | 
|         |     92  | 
|         |     93 	// Check for the partial download flag of the message part | 
|         |     94 	TInt CheckPartialDownloadFlagL(TMsvId aMsgId, TBool& aPartialDownloadFlag); | 
|         |     95  | 
|         |     96 private: | 
|         |     97 	// Constructor | 
|         |     98 	CMtfTestActionUtilsEmailMessage(CMsvEntry& aMsvEntry, CMtfTestCase& aTestCase); | 
|         |     99  | 
|         |    100 	void ConstructL(); | 
|         |    101 	 | 
|         |    102 private: | 
|         |    103 	/** Id of the email message */ | 
|         |    104 	CMsvEntry& iEmailEntry; | 
|         |    105 	 | 
|         |    106 	/** Email message */ | 
|         |    107 	CImEmailMessage* imEmailMessage; | 
|         |    108 	 | 
|         |    109 	/** Id of the Body Text of the email message */ | 
|         |    110 	TMsvId iBodyTextId; | 
|         |    111 	 | 
|         |    112 	/** Size of the Body Text of the email message */ | 
|         |    113 	TInt32 iBodyTextSize; | 
|         |    114  | 
|         |    115 	/** Id of  Html part of the email message */ | 
|         |    116 	TMsvId iHtmlEntryId; | 
|         |    117  | 
|         |    118 	/** Size of the Html part of the email message */ | 
|         |    119 	TInt32 iHtmlSize; | 
|         |    120 	 | 
|         |    121 	/** Name of Html file */ | 
|         |    122 	TPtrC iHtmlFileName; | 
|         |    123 	 | 
|         |    124 	/** Reference to the current Test Case */ | 
|         |    125 	CMtfTestCase& iTestCase; | 
|         |    126 	}; | 
|         |    127  | 
|         |    128 #endif //__CMTF_TEST_ACTION_UTILS_EMAIL_MESSAGE_H__ |