webservices/wsprovider/inc/senhostletresponse.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-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 "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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef SEN_HOSTLET_RESPONSE_H
       
    26 #define SEN_HOSTLET_RESPONSE_H
       
    27 
       
    28 #include <e32base.h>
       
    29 
       
    30 #include "MSenHostletResponse.h"
       
    31 #include "msenmessagecontext.h"
       
    32 
       
    33 // FORWARD DECLARES
       
    34 class CSenMessageContext;
       
    35 
       
    36 class CSenHostletResponse :public CBase, public MSenHostletResponse
       
    37     {
       
    38     
       
    39     public:
       
    40         IMPORT_C static CSenHostletResponse* NewL(const TInt aRequestId);
       
    41         IMPORT_C static CSenHostletResponse* NewLC(const TInt aRequestId);
       
    42         IMPORT_C virtual ~CSenHostletResponse();
       
    43         
       
    44     public:
       
    45         /** 
       
    46         * From MSenHostletResponse
       
    47         */
       
    48         IMPORT_C virtual void SetResponseUtf8L(const TDesC8& aResponseBodyUtf8,
       
    49                                                const TInt aResponseCode = KErrNone,
       
    50                                                MSenProperties* apResponseProperties = NULL,
       
    51                                                MSenMessage* apMessage = NULL);
       
    52         
       
    53     public:
       
    54         /**
       
    55         *  Extraction getter for response data set by the hostlet application
       
    56         *  @return reference to response body. Caller takes ownership of the returned object.
       
    57         */
       
    58         IMPORT_C HBufC8* ExtractResponseUtf8();
       
    59         
       
    60         /**
       
    61         *  Getter for response data set by the hostlet application
       
    62         *  @return reference to response body. Ownership is not transferred.
       
    63         */
       
    64         IMPORT_C virtual TPtrC8 ResponseUtf8();
       
    65 
       
    66         /** 
       
    67         * Getter for request id
       
    68         */
       
    69         IMPORT_C virtual TInt RequestId() const;
       
    70 
       
    71         /** 
       
    72         * Getter for response code set by the hostlet application
       
    73         */
       
    74         IMPORT_C virtual TInt ResponseCode() const;
       
    75         
       
    76         /**
       
    77         * Getter for response properties
       
    78         */
       
    79         IMPORT_C virtual MSenProperties* ResponseProperties();
       
    80 
       
    81         /**
       
    82         * Getter for response as a message object. Note that this message
       
    83         * can be safely class-cast further to a concrete subclass via the
       
    84         * MSenMessage::IsSafeToCast() helper function.
       
    85         * @return message or NULL if the response data is not available
       
    86         */
       
    87         IMPORT_C virtual MSenMessage* ResponseMessageL();	//codescannerwarnings
       
    88         
       
    89     protected:
       
    90         void BaseConstructL();
       
    91     
       
    92     private:
       
    93         CSenHostletResponse(const TInt aRequestId);
       
    94         
       
    95         MSenMessageContext& MessageContextL(MSenProperties* apProperties = NULL);
       
    96         
       
    97     private:
       
    98         TInt iRequestId;
       
    99         TInt iResponseCode;
       
   100         HBufC8* ipOwnedResponseUtf8;
       
   101         TAny* iReserved; // not used currently
       
   102         CSenMessageContext* ipMessageContext;
       
   103     };
       
   104 
       
   105 #endif