emailservices/emailframework/commonlib/inc/CFSMailMessage.h
changeset 4 e7aa27f58ae1
parent 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
3:a4d6f1ea0416 4:e7aa27f58ae1
    17 
    17 
    18 #ifndef __CFSMAILMESSAGE_H
    18 #ifndef __CFSMAILMESSAGE_H
    19 #define __CFSMAILMESSAGE_H
    19 #define __CFSMAILMESSAGE_H
    20 
    20 
    21 //<cmail>
    21 //<cmail>
    22 #include "cfsmailmessagepart.h"
    22 #include "CFSMailMessagePart.h"
    23 //</cmail>
    23 //</cmail>
    24 
    24 
    25 /**
    25 /**
    26  *  email data handling
    26  *  email data handling
    27  *
    27  *
    35     /**
    35     /**
    36      * Two-phased constructor.
    36      * Two-phased constructor.
    37      *
    37      *
    38      * @param aMessageId message id in plugin containing email
    38      * @param aMessageId message id in plugin containing email
    39      */
    39      */
    40    	 IMPORT_C static CFSMailMessage* NewL( TFSMailMsgId aMessageId );
    40      IMPORT_C static CFSMailMessage* NewL( TFSMailMsgId aMessageId );
    41     
    41     
    42     /**
    42     /**
    43      * Two-phased constructor.
    43      * Two-phased constructor.
    44      *
    44      *
    45      * @param aMessageId message id in plugin containing email
    45      * @param aMessageId message id in plugin containing email
    46      */
    46      */
    47      IMPORT_C static CFSMailMessage* NewLC( TFSMailMsgId aMessageId );
    47      IMPORT_C static CFSMailMessage* NewLC( TFSMailMsgId aMessageId );
    48 
    48 
    49    	/**
    49     /**
    50      * saves this message
    50      * saves this message
    51      */
    51      */
    52      IMPORT_C void SaveMessageL();
    52      IMPORT_C void SaveMessageL();
    53 
    53 
    54     /**
    54     /**
    55      * destructor
    55      * destructor
    56      */  
    56      */  
    57   	 IMPORT_C ~CFSMailMessage();
    57      IMPORT_C ~CFSMailMessage();
    58 
    58 
    59     /**
    59     /**
    60      * Adds new attachment to this email.
    60      * Adds new attachment to this email.
    61      * 
    61      * 
    62      * @param aFilePath contains full path to new attachment file.
    62      * @param aFilePath contains full path to new attachment file.
    79       */ 
    79       */ 
    80      IMPORT_C CFSMailMessagePart* AddNewAttachmentL( RFile& aFile, 
    80      IMPORT_C CFSMailMessagePart* AddNewAttachmentL( RFile& aFile, 
    81                                                      const TDesC8& aMimeType );
    81                                                      const TDesC8& aMimeType );
    82 
    82 
    83      /**
    83      /**
    84 	 * Returns a flat list of message parts that can be handled as attachments.
    84      * Returns a flat list of message parts that can be handled as attachments.
    85 	 * Excludes message parts that are multipart and parts that are considered
    85      * Excludes message parts that are multipart and parts that are considered
    86 	 * plain text or html body.
    86      * plain text or html body.
    87 	 * 
    87      * 
    88 	 * @param aParts contains flat list of attachments
    88      * @param aParts contains flat list of attachments
    89 	 */        
    89      */        
    90 	 IMPORT_C void AttachmentListL(RPointerArray<CFSMailMessagePart>& aParts);
    90      IMPORT_C void AttachmentListL(RPointerArray<CFSMailMessagePart>& aParts);
    91 
    91 
    92 	/**
    92     /**
    93 	 * Returns plain text body part for this email or NULL if not found.
    93      * Returns plain text body part for this email or NULL if not found.
    94 	 * 
    94      * 
    95 	 * @return plain text email body part, ownership is transferred to user
    95      * @return plain text email body part, ownership is transferred to user
    96 	 */        
    96      */        
    97 	 IMPORT_C CFSMailMessagePart* PlainTextBodyPartL();
    97      IMPORT_C CFSMailMessagePart* PlainTextBodyPartL();
    98 
    98 
    99 	/**
    99     /**
   100 	 * Returns html body part for this message or NULL if not found.
   100      * Returns html body part for this message or NULL if not found.
   101 	 * 
   101      * 
   102 	 * @return html email body part, ownership is transferred to user
   102      * @return html email body part, ownership is transferred to user
   103 	 */        
   103      */        
   104 	 IMPORT_C CFSMailMessagePart* HtmlBodyPartL();
   104      IMPORT_C CFSMailMessagePart* HtmlBodyPartL();
   105 
   105 
   106     /**
   106     /**
   107      * Returns ETrue if this part is actually a message.
   107      * Returns ETrue if this part is actually a message.
   108      * In that case it shoud safe to cast this part to CFSMailMessage
   108      * In that case it shoud safe to cast this part to CFSMailMessage
   109      * 
   109      * 
   110      * @return true if this message part is a message
   110      * @return true if this message part is a message
   111      */        
   111      */        
   112 	 IMPORT_C TBool IsMessageL() const;
   112      IMPORT_C TBool IsMessageL() const;
   113 
   113 
   114 	 /**
   114      /**
   115      * Returns a flat list of message parts that can be handled as attachments.
   115      * Returns a flat list of message parts that can be handled as attachments.
   116      * Excludes message parts that are multipart and parts that are considered
   116      * Excludes message parts that are multipart and parts that are considered
   117      * plain text or html body.
   117      * plain text or html body.
   118      * 
   118      * 
   119      * @param aParts contains flat list of attachments
   119      * @param aParts contains flat list of attachments
   125  private:
   125  private:
   126 
   126 
   127     /**
   127     /**
   128      * C++ default constructor.
   128      * C++ default constructor.
   129      */
   129      */
   130   	CFSMailMessage();
   130     CFSMailMessage();
   131 
   131 
   132  	/**
   132     /**
   133      * Two-phased constructor
   133      * Two-phased constructor
   134      */
   134      */
   135   	 void ConstructL( TFSMailMsgId aMessageId );
   135      void ConstructL( TFSMailMsgId aMessageId );
   136 
   136 
   137     /**
   137     /**
   138      * Returns content-type parameters and their associated values.
   138      * Returns content-type parameters and their associated values.
   139      * This function is made private to prevent usage from CFSMailMessage
   139      * This function is made private to prevent usage from CFSMailMessage
   140      * 
   140      * 
   141      * @return content type parameters
   141      * @return content type parameters
   142      */
   142      */
   143 	CDesCArray& ContentTypeParameters();
   143     CDesCArray& ContentTypeParameters();
   144 
   144 
   145  private: // data
   145  private: // data
   146 	 
   146      
   147 };
   147 };
   148 
   148 
   149 
   149 
   150 #endif // __CFSMAILMESSAGE_H
   150 #endif // __CFSMAILMESSAGE_H