email/imap4mtm/imapsession/inc/cimapenvelope.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2006-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 #ifndef __CIMAPENVELOPE_H__
       
    17 #define __CIMAPENVELOPE_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 /**
       
    22 Represents an "envelope" component of
       
    23 a BODYSTRUCTURE.  See section 9 of RFC3501
       
    24 @internalTechnology
       
    25 @prototype
       
    26 */
       
    27 class CImapEnvelope : public CBase
       
    28 	{
       
    29 public:
       
    30 	static CImapEnvelope* NewL();
       
    31 	~CImapEnvelope();
       
    32 	
       
    33 	/**
       
    34 	Represents an IMAP address structure.
       
    35 	The three main fields typically map to an email address of the form
       
    36 		"iName" <iMailbox@iHost>
       
    37 	See RFC2822 for the full meaning of each field.
       
    38 	*/
       
    39 	struct TAddress
       
    40 		{
       
    41 	public:		
       
    42 		IMPORT_C HBufC16* CreateAddressStringL() const;
       
    43 		
       
    44 		void SetName(const TDesC8& aName);
       
    45 		void SetAdl(const TDesC8& aAdl);
       
    46 		void SetMailbox(const TDesC8& aMailbox);
       
    47 		void SetHost(const TDesC8& aHost);
       
    48 
       
    49 	private:		
       
    50 		/**
       
    51 		addr-name = nstring
       
    52 		*/
       
    53 		TPtrC8 iName;
       
    54 		/** 
       
    55 		addr-adl = nstring
       
    56 		This contains routing information.
       
    57 		*/
       
    58 		TPtrC8 iAdl;
       
    59 		/**
       
    60 		addr-mailbox = nstring
       
    61 		*/
       
    62 		TPtrC8 iMailbox;
       
    63 		/**
       
    64 		addr-host = nstring
       
    65 		*/
       
    66 		TPtrC8 iHost;
       
    67 		};
       
    68 	
       
    69 	/**
       
    70 	An array of TAddress structures.
       
    71 	@see CImapEnvelope::TAddress
       
    72 	*/
       
    73 	typedef RArray<const TAddress> RArrayTAddress;
       
    74 	
       
    75 	IMPORT_C const TDesC8& EnvDate();
       
    76 	IMPORT_C const TDesC8& EnvSubject();
       
    77 	IMPORT_C const RArrayTAddress& EnvFrom();
       
    78 	IMPORT_C const RArrayTAddress& EnvSender();
       
    79 	IMPORT_C const RArrayTAddress& EnvReplyTo();
       
    80 	IMPORT_C const RArrayTAddress& EnvTo();
       
    81 	IMPORT_C const RArrayTAddress& EnvCc();
       
    82 	IMPORT_C const RArrayTAddress& EnvBcc();
       
    83 	IMPORT_C const TDesC8& EnvInReplyTo();
       
    84 	IMPORT_C const TDesC8& EnvMessageId();
       
    85 	
       
    86 	void SetEnvDate(const TDesC8& aEnvDate);
       
    87 	void SetEnvSubject(const TDesC8& aEnvSubject);
       
    88 	void AppendEnvFromL(const TAddress& aAddress);
       
    89 	void AppendEnvSenderL(const TAddress& aAddress);
       
    90 	void AppendEnvReplyToL(const TAddress& aAddress);
       
    91 	void AppendEnvToL(const TAddress& aAddress);
       
    92 	void AppendEnvCcL(const TAddress& aAddress);
       
    93 	void AppendEnvBccL(const TAddress& aAddress);
       
    94 	void SetEnvInReplyTo(const TDesC8& aEnvInReplyTo);
       
    95 	void SetEnvMessageId(const TDesC8& aEnvMessageId);
       
    96 	
       
    97 protected:
       
    98 	CImapEnvelope();
       
    99 	
       
   100 private:
       
   101 		
       
   102 	TPtrC8 iEnvDate;
       
   103 	TPtrC8 iEnvSubject;
       
   104 	RArrayTAddress iEnvFrom;
       
   105 	RArrayTAddress iEnvSender;
       
   106 	RArrayTAddress iEnvReplyTo;
       
   107 	RArrayTAddress iEnvTo;
       
   108 	RArrayTAddress iEnvCc;
       
   109 	RArrayTAddress iEnvBcc;
       
   110 	TPtrC8 iEnvInReplyTo;
       
   111 	TPtrC8 iEnvMessageId;
       
   112 	};
       
   113 
       
   114 #endif // __CIMAPENVELOPE_H__