email/mail/PluginSrc/MailPlainView/MailLoadStateHtml.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  State machine for mesage loading
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef PLAIN_MAILLOADSTATEHTML_H
       
    21 #define PLAIN_MAILLOADSTATEHTML_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <f32file.h>
       
    26 #include <MMessageLoadObserver.h>
       
    27 #include "MMailState.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CLoadInlineImages;
       
    31 class MStateMachine;
       
    32 class MMailAppUiInterface;
       
    33 class MLoadState;
       
    34 class CMailMessage;
       
    35 class CMsgMailViewerHtmlConv;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 *  CLoadHtmlFile
       
    41 *  Load and set html message
       
    42 *
       
    43 *  @since Series 60 3.0
       
    44 */
       
    45 class CLoadHtmlFile : public CActive, public MLoadState
       
    46 	{
       
    47 	public:
       
    48 		
       
    49 		~CLoadHtmlFile();	
       
    50 
       
    51 	private: // Functions from base classes
       
    52 		// From: MMessageLoadObserver
       
    53 		void MessageLoadingL(TInt aStatus, CMailMessage& aMessage);
       
    54 		// From MLoadState
       
    55 		MLoadState* NextStateL();
       
    56         // From MLoadState
       
    57 		void MakeRequestL( 
       
    58 			TRequestStatus& aStatus,
       
    59 			CMailMessage& aMessage );		
       
    60 
       
    61     protected: // From CActive
       
    62         void RunL();
       
    63         TInt RunError( TInt aError );
       
    64         void DoCancel();
       
    65         
       
    66 	public:
       
    67 		/// Ctor
       
    68 		CLoadHtmlFile( 
       
    69 			MMailAppUiInterface* aAppUI, 
       
    70 			MStateMachine& aStateMachine );
       
    71 	    
       
    72 	private: // implementation
       
    73 	
       
    74 	    void HandleBodyTextReadyL( CMailMessage& aMessage );
       
    75 		void ShowHtmlErrorNoteIfNeededL( TInt aResult );
       
    76 		// Adds message html body part as an attachment
       
    77 		void AddHtmlFileAttachmentL(CMailMessage& aMessage, RFile aFile );
       
    78 		void ParseHtmlFileL(CMailMessage& aMessage, RFile aFile );
       
    79 		void CompleteRequest( TInt aError );
       
    80 		// Adds message html body part as an attachment and ads charset info if necessary
       
    81 		void AddHtmlFileAttachmentAndCharsetL( CMailMessage& aMessage, RFile& aHandle );
       
    82 		
       
    83 	private: // Data 
       
    84 	    // Own. HTML to Plain text converter
       
    85 	    CMsgMailViewerHtmlConv* iConverter;
       
    86 	    
       
    87 	    // Not own. Email message 
       
    88 	    CMailMessage* iMessage;
       
    89     
       
    90 	};
       
    91 
       
    92 #endif      // PLAIN_MAILLOADSTATEHTML_H   
       
    93             
       
    94 // End of File