web_plat/multipart_parser_api/inc/BodyPart.h
changeset 0 dd21522fd290
child 74 91031d3aab7d
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2005 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 the License "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:  Implementation of the Multipart Body Part
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BODYPART_H
       
    21 #define BODYPART_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 
       
    27 
       
    28 //  CONSTANTS
       
    29 
       
    30 
       
    31 // DATA TYPES
       
    32 
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 
       
    36 
       
    37 // CLASS DECLARATION
       
    38 /**
       
    39 *  Implementation of the Multipart Body Part
       
    40 *
       
    41 *  \b Library: MultipartParser.lib
       
    42 *
       
    43 *  @since 3.0
       
    44 */
       
    45 class CBodyPart : public CBase
       
    46     {
       
    47     public:  // Constructors and destructor
       
    48         
       
    49         /**
       
    50         * Two-phased constructor.
       
    51         */
       
    52         IMPORT_C static CBodyPart* NewL();
       
    53         
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         IMPORT_C virtual ~CBodyPart();
       
    58 
       
    59     public: // New functions
       
    60 
       
    61         /**
       
    62         * @since 3.0
       
    63         * @return The body of this body part
       
    64         */
       
    65 	    inline const TDesC8& Body() { return iBody; }
       
    66 
       
    67         /**
       
    68         * @since 3.0
       
    69         * @return The content type of this body part
       
    70         */
       
    71 	    inline const TDesC8& ContentType() { return iContentType; }
       
    72 
       
    73         /**
       
    74         * @since 3.0
       
    75         * @return The charset of this body part
       
    76         */
       
    77 	    inline const TDesC8& Charset() { return iCharset; }	
       
    78 
       
    79         /**
       
    80         * @since 3.0
       
    81         * @return The content ID of this body part
       
    82         */
       
    83 	    inline const TDesC8& ContentID() { return iContentID; }
       
    84 
       
    85         /**
       
    86         * @since 3.0
       
    87         * @return The url of this body part
       
    88         */
       
    89 	    inline const TDesC16& Url() { return *iUrl; }
       
    90 
       
    91         /**
       
    92         * @since 3.0
       
    93         * @return The headers of this body part
       
    94         */
       
    95 	    inline const TDesC8& Headers() { return iHeaders; }
       
    96 
       
    97         /**
       
    98         * @since 3.0
       
    99         * @return The boundary of this body part
       
   100         */
       
   101         const TDesC8& Boundary();
       
   102 
       
   103         /**
       
   104         * @since 3.0
       
   105         * @return The content-base of this body part
       
   106         */
       
   107         const TDesC8& ContentBase();
       
   108 
       
   109         /**
       
   110         * @since 3.0
       
   111         * @return The content-location of this body part
       
   112         */
       
   113         const TDesC8& ContentLocation();
       
   114 
       
   115         /**
       
   116         * @since 3.0
       
   117         * @return The content-transfer-encoding of this body part
       
   118         */
       
   119         const TDesC8& ContentTransferEncoding();
       
   120 
       
   121         /**
       
   122         * @since 3.0
       
   123         * @return If the body of the body part is decoded or unzipped
       
   124         */
       
   125         TBool IsDecodedBody();
       
   126 
       
   127         /**
       
   128         * @since 3.0
       
   129         * @param aBody   The body of the body part
       
   130         * @return void
       
   131         */
       
   132         inline void SetBody( const TDesC8& aBody ) { iBody.Set( aBody ); }
       
   133 
       
   134         /**
       
   135         * @since 3.0
       
   136         * @param aBoundary   The boundary of the body part
       
   137         * @return void
       
   138         */
       
   139         void SetBoundary( const TDesC8& aBoundary );
       
   140 
       
   141         /**
       
   142         * @since 3.0
       
   143         * @param aCharset   The charset of the body part
       
   144         * @return void
       
   145         */
       
   146         void SetCharset( const TDesC8& aCharset );
       
   147 
       
   148         /**
       
   149         * @since 3.0
       
   150         * @param aContentBase   The content-base of the body part
       
   151         * @return void
       
   152         */
       
   153         void SetContentBase( const TDesC8& aContentBase );
       
   154 
       
   155         /**
       
   156         * @since 3.0
       
   157         * @param aContentLocation   The content-location of the body part
       
   158         * @return void
       
   159         */
       
   160         void SetContentLocation( const TDesC8& aContentLocation );
       
   161 
       
   162         /**
       
   163         * @since 3.0
       
   164         * @param aContentTransferEncoding   The content-transfer-encoding of the body part
       
   165         * @return void
       
   166         */
       
   167         void SetContentTransferEncoding( const TDesC8& aContentTransferEncoding );
       
   168 
       
   169         /**
       
   170         * @since 3.0
       
   171         * @param aContentType   The content-type of the body part
       
   172         * @return void
       
   173         */
       
   174         void SetContentType( const TDesC8& aContentType );
       
   175 
       
   176         /**
       
   177         * @since 3.0
       
   178         * @param aContentID   The content-ID of the body part
       
   179         * @return void
       
   180         */
       
   181         void SetContentID( const TDesC8& aContentID );
       
   182 
       
   183         /**
       
   184         * @since 3.0
       
   185         * @param aHeaders   The headers of the body part
       
   186         * @return void
       
   187         */
       
   188         inline void SetHeaders( const TDesC8& aHeaders ) { iHeaders.Set( aHeaders ); }
       
   189 
       
   190         /**
       
   191         * @since 3.0
       
   192         * @param aIsDecodedBody   If the body of the body part is decoded or unzipped
       
   193         * @return void
       
   194         */
       
   195         void SetIsDecodedBody( TBool aIsDecodedBody );
       
   196 
       
   197         /**
       
   198         * @since 3.0
       
   199         * @param aUrl   The URL of the body part
       
   200         * @return void
       
   201         */
       
   202         void SetUrl( HBufC16* aUrl );
       
   203 
       
   204 
       
   205         
       
   206     public: // Functions from base classes
       
   207         
       
   208 
       
   209     protected:  // Functions from base classes
       
   210         
       
   211 
       
   212     private:
       
   213 
       
   214         /**
       
   215         * C++ default constructor.
       
   216         */
       
   217         CBodyPart();
       
   218 
       
   219         /**
       
   220         * By default Symbian 2nd phase constructor is private.
       
   221         */
       
   222         void ConstructL();
       
   223 
       
   224 
       
   225     private:    // Data
       
   226         TPtrC8   iBody;
       
   227         TPtrC8   iBoundary;
       
   228         TPtrC8   iCharset;
       
   229         TPtrC8   iContentBase;
       
   230         TPtrC8   iContentLocation;
       
   231         TPtrC8   iContentTransferEncoding;
       
   232         TPtrC8   iContentType;
       
   233         TPtrC8   iContentID;
       
   234         TPtrC8   iHeaders;
       
   235         TBool    iIsDecodedBody;  ///< if true, this class responsible for freeing the memory of iBody
       
   236         HBufC16* iUrl;
       
   237     };
       
   238 
       
   239 #endif      // BODYPART_H   
       
   240             
       
   241 // End of File