emailuis/emailui/inc/FreestyleMessageHeaderHTML.h
changeset 0 8466d47a6819
child 1 12c456ceeff2
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Message header HTML
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CFREESTYLE_MESSAGE_HEADER_HTML_H__
       
    19 #define __CFREESTYLE_MESSAGE_HEADER_HTML_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 #include "CFSMailMessage.h"
       
    24 #include "CFSMailAddress.h"
       
    25 #include "FreestyleMessageHeaderURLFactory.h"
       
    26 
       
    27 class RWriteStream;
       
    28 class RFs;
       
    29 class RFile;
       
    30 
       
    31 
       
    32 class CFreestyleMessageHeaderHTML : public CBase
       
    33     {
       
    34 public:
       
    35     IMPORT_C static void ExportL( CFSMailMessage& aMailMessage, RWriteStream& aWriteStream );
       
    36     IMPORT_C static void ExportL( CFSMailMessage& aMailMessage, RFile& aFile );
       
    37     IMPORT_C static void ExportL( CFSMailMessage& aMailMessage, RFs& aFs, const TPath& aFilePath);
       
    38     
       
    39     IMPORT_C static CFreestyleMessageHeaderHTML* NewL( CFSMailMessage& aMailMessage );
       
    40     
       
    41     ~CFreestyleMessageHeaderHTML();
       
    42     
       
    43     IMPORT_C void ExportL( RWriteStream& aWriteStream ) const;
       
    44     IMPORT_C void ExportL( RFile& aFile ) const;
       
    45     IMPORT_C void ExportL( RFs& aFs, const TPath& aFilePath) const;
       
    46     
       
    47 private:
       
    48     CFreestyleMessageHeaderHTML( CFSMailMessage& aMailMessage );
       
    49     void ConstructL();
       
    50     
       
    51     void HTMLStartL( RWriteStream& aWriteStream ) const;
       
    52     void HTMLEndL( RWriteStream& aWriteStream ) const;
       
    53     
       
    54     void ExportHTMLHeaderL( RWriteStream& aWriteStream ) const;
       
    55     void HTMLHeaderStartL( RWriteStream& aWriteStream ) const;
       
    56     void HTMLMetaL( RWriteStream& aWriteStream ) const;
       
    57     void HTMLHeaderEndL( RWriteStream& aWriteStream ) const;
       
    58 
       
    59     void ExportHTMLBodyL( RWriteStream& aWriteStream ) const;
       
    60     void HTMLBodyStartL( RWriteStream& aWriteStream ) const;
       
    61     void HTMLBodyEndL( RWriteStream& aWriteStream ) const;
       
    62     
       
    63     void ExportSubjectL( RWriteStream& aWriteStream ) const;
       
    64     void ExportFromL( RWriteStream& aWriteStream ) const;
       
    65     void ExportToL( RWriteStream& aWriteStream ) const;
       
    66     void ExportCcL( RWriteStream& aWriteStream ) const;
       
    67     void ExportBccL( RWriteStream& aWriteStream ) const;
       
    68     void ExportSentTimeL( RWriteStream& aWriteStream ) const;
       
    69     void ExportAttachmentsL( RWriteStream& aWriteStream ) const;
       
    70     
       
    71     void ExportEmailAddressesL( RWriteStream& aWriteStream, 
       
    72                                 FreestyleMessageHeaderURLFactory::TEmailAddressType aEmailAddressType, 
       
    73                                 const RPointerArray<CFSMailAddress>& aEmailAddresses ) const;
       
    74     
       
    75     void AddEmailAddressL( RWriteStream& aWriteStream, 
       
    76                            FreestyleMessageHeaderURLFactory::TEmailAddressType aEmailAddressType, 
       
    77                            const CFSMailAddress& aEmailAddress ) const;
       
    78     
       
    79     void AddAttachmentL( RWriteStream& aWriteStream, CFSMailMessagePart& aAttachment ) const;
       
    80 
       
    81     void StartHyperlinkL( RWriteStream& aWriteStream, const TDesC8& aUrl ) const;
       
    82     void EndHyperlinkL( RWriteStream& aWriteStream ) const;
       
    83     
       
    84     void AddImageL( RWriteStream& aWriteStream, const TDesC8& aImageUrl ) const;
       
    85     void AddImageL( RWriteStream& aWriteStream, const TDesC8& aImageId, const TDesC8& aImageUrl, const TDesC8& aImageEvent ) const;
       
    86     
       
    87     void StartHeaderTableL( RWriteStream& aWriteStream, const TDesC8& aTableId ) const;
       
    88     void EndHeaderTableL( RWriteStream& aWriteStream ) const;
       
    89 
       
    90     void StartTableL( RWriteStream& aWriteStream, const TDesC8& aTableId ) const;
       
    91     void EndTableL( RWriteStream& aWriteStream ) const;
       
    92     
       
    93     void AddShowDetailL( RWriteStream& aWriteStream ) const;
       
    94     
       
    95     HBufC8* ClickImageEventL( const TDesC8& aImageName ) const;
       
    96 
       
    97     void AddJavascriptL( RWriteStream& aWriteStream ) const;    
       
    98     
       
    99     HBufC8* HeadingTextLC( TInt aId ) const;
       
   100     HBufC8* HeadingTextLC( TInt aId, TInt aSize ) const;
       
   101     
       
   102     void ExportInitialTableL( RWriteStream& aWriteStream ) const;
       
   103     
       
   104     void AddStyleSheetL( RWriteStream& aWriteStream ) const;
       
   105     void StartDivL( RWriteStream& aWriteStream ) const;
       
   106     void EndDivL( RWriteStream& aWriteStream ) const;
       
   107     
       
   108 private:
       
   109     CFSMailMessage& iMailMessage; 
       
   110     
       
   111     RPointerArray<CFSMailMessagePart> iAttachments;
       
   112 };
       
   113 
       
   114 #endif //__CFREESTYLE_MESSAGE_HEADER_HTML_H__