omadrm/drmengine/roap/inc/RoapResponse.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ROAP_RESPONSE_H
       
    20 #define ROAP_RESPONSE_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 #include <apmstd.h>
       
    25 #include "MultipartHandler.h"
       
    26 
       
    27 namespace Roap
       
    28 {
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 class CRoapResponse: public CBase, public TMultipartHandler
       
    33     {
       
    34     public:
       
    35     
       
    36         enum TMultipartState
       
    37             {
       
    38             ERights,
       
    39             EDcf,
       
    40             EOther
       
    41             };
       
    42     
       
    43     public:     // Construct / destruct
       
    44      
       
    45         static CRoapResponse* NewL();
       
    46         
       
    47         virtual ~CRoapResponse();
       
    48 
       
    49     public:
       
    50 
       
    51         const TDesC8& ProtocolUnit() const;
       
    52         
       
    53         const TFileName& DcfFileName() const;
       
    54         
       
    55         const TDataType& DataType() const;
       
    56         
       
    57         void SetDcfPathL( const TPath& aPath );
       
    58         
       
    59         void AppendMultipartDataL( const TDesC8& aData );
       
    60 
       
    61         virtual void HandleBodyDataL( const TDesC8& aData );
       
    62 
       
    63         virtual void StartBodyPartL();
       
    64         
       
    65         virtual void EndBodyPartL();
       
    66         
       
    67         void SetContentNameL( const TDes& aName );
       
    68         
       
    69         void GetContentNameLC( HBufC*& aName ) const;
       
    70         
       
    71         void SetMaxSize( const TInt& aSize );
       
    72         
       
    73         TInt MaxSize() const;
       
    74 
       
    75     protected: 
       
    76      
       
    77         CRoapResponse();
       
    78             
       
    79         void ConstructL();
       
    80         
       
    81     private:    // friends
       
    82 
       
    83         friend class CRoapHttpHandler;
       
    84 
       
    85     private:    // data
       
    86 
       
    87         HBufC8* iPdu;
       
    88         TFileName iDcfFileName; // contains the full path and file name of the temp DCF file
       
    89         HBufC* iContentName; // content name to be used as a filename when saving temp DCF
       
    90         TDataType iDataType;
       
    91         TMultipartState iMultipartState;
       
    92         TInt iMaxSize;
       
    93     };        
       
    94 }
       
    95 
       
    96 #endif