Update contrib.
1 // Copyright (c) 2005-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Implementation of the Multipart Body Part
32 Implementation of the MIME Multipart Body Part
35 NONSHARABLE_CLASS(CBodyPart) : public CBase
39 /** Allocates and constructs a new CBodyPart object */
40 IMPORT_C static CBodyPart* NewL();
43 IMPORT_C virtual ~CBodyPart();
46 @return The body of this body part
48 inline const TDesC8& Body() { return iBody; }
50 /** Gets the Content-Type
51 @return The Content-Type of this body part
53 inline const TDesC8& ContentType() { return iContentType; }
56 @return The charset of this body part
58 inline const TDesC8& Charset() { return iCharset; }
60 /** Gets the Content ID
61 @return The content ID of this body part
63 inline const TDesC8& ContentID() { return iContentID; }
66 @return The URL of this body part
68 inline const TDesC16& Url() { return *iUrl; }
71 @return The headers of this body part
73 inline const TDesC8& Headers() { return iHeaders; }
76 @return The boundary of this body part
78 const TDesC8& Boundary();
80 /** Gets the Content-Base
81 @return The Content-Base of this body part
83 const TDesC8& ContentBase();
85 /** Gets the Content-Location
86 @return The Content-Location of this body part
88 const TDesC8& ContentLocation();
90 /** Gets the Content-Transfer-Encoding
91 @return The Content-Transfer-Encoding of this body part
93 const TDesC8& ContentTransferEncoding();
95 /** Check if the body is decoded or unzipped
96 @return If the body of the body part is decoded or unzipped
98 TBool IsDecodedBody();
101 @param aBody The body to set
103 inline void SetBody( const TDesC8& aBody ) { iBody.Set( aBody ); }
105 /** Sets the Boundary
106 @param aBoundary The boundary to set
108 void SetBoundary( const TDesC8& aBoundary );
111 @param aCharset The charset to set
113 void SetCharset( const TDesC8& aCharset );
115 /** Sets the Content-Base
116 @param aContentBase The Content-Base to set
118 void SetContentBase( const TDesC8& aContentBase );
120 /** Sets the Content-Location
121 @param aContentLocation The Content-Location to set
123 void SetContentLocation( const TDesC8& aContentLocation );
125 /** Sets the Content-Transfer-Encoding
126 @param aContentTransferEncoding The Content-Transfer-Encoding to set
128 void SetContentTransferEncoding( const TDesC8& aContentTransferEncoding );
130 /** Set the Content-Type
131 @param aContentType The Content-Type to set
133 void SetContentType( const TDesC8& aContentType );
135 /** Sets the Content ID
136 @param aContentID The content-ID to set
138 void SetContentID( const TDesC8& aContentID );
141 @param aHeaders The headers to set
143 inline void SetHeaders( const TDesC8& aHeaders ) { iHeaders.Set( aHeaders ); }
145 /** Sets whether the body part is decoded or unzipped
146 @param aIsDecodedBody If the body of the body part is decoded or unzipped
148 void SetIsDecodedBody( TBool aIsDecodedBody );
151 * @param aUrl The URL to set
153 void SetUrl( HBufC16* aUrl );
157 /** Default constructor */
160 /** 2nd phase constructor */
169 TPtrC8 iContentLocation;
170 TPtrC8 iContentTransferEncoding;
174 TBool iIsDecodedBody; // if ETrue, this class is responsible for freeing the memory of iBody