webservices/wsframework/inc/senmessagecontext.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2006 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:        Note that this class is ment for WS internal components,
       
    15 *                and not ment to act as part of public API
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 #ifndef SEN_MESSAGE_CONTEXT_H
       
    27 #define SEN_MESSAGE_CONTEXT_H
       
    28 
       
    29 
       
    30 // INCLUDES
       
    31 #include <e32base.h>
       
    32 #include <e32std.h>
       
    33 #include "sencontext.h"
       
    34 #include "senpointermap.h"
       
    35 #include "msenmessagecontext.h"
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class CSenContextItem;
       
    39 class MSenProperties;
       
    40 class CSenXmlReader;
       
    41 class MSenRemoteServiceConsumer;
       
    42 class CSenChunk;
       
    43 
       
    44 
       
    45 // CLASS DECLARATION
       
    46 class CSenMessageContext : public  CSenContext, public MSenMessageContext
       
    47     {
       
    48     public:
       
    49         /**
       
    50         * Standard 2-phased constructor
       
    51         * @param aDirection indicate the initial direction of this message context.
       
    52         * For requests, it is "outbound", and for responses or one way notifications
       
    53         * from some (remote) service) it is "inbound".
       
    54         * @param apOwnedTp - pointer to (transport) properties, which ownership is taken.
       
    55         * These properties are typically a clone to the propeties currently owned
       
    56         * by transport plug-in (ECOM) instance. Cloning allows independency upon
       
    57         * changes that last during the life-time of a message transaction only.
       
    58         * Note that if apOwnedTp is NULL, this constructor will leave with KErrArgument.
       
    59         * @return pointer to new message context
       
    60         */ 
       
    61         IMPORT_C static  CSenMessageContext* NewL(SenContext::TContextDirection aDirection, 
       
    62                                                   MSenProperties* apOwnedTp);
       
    63         /**
       
    64         * Standard 2-phased constructor
       
    65         * @param aDirection indicate the initial direction of this message context.
       
    66         * For requests, it is "outbound", and for responses or one way notifications
       
    67         * from some (remote) service) it is "inbound".
       
    68         * @param apOwnedTp - pointer to transport properties, which ownership is taken.
       
    69         * These properties are typically a clone to the propeties currently owned
       
    70         * by transport plug-in (ECOM) instance. Cloning allows independency upon
       
    71         * changes that last during the life-time of a message transaction only.
       
    72         * Note that if apOwnedTp is NULL, this constructor will leave with KErrArgument.
       
    73         */ 
       
    74         IMPORT_C static  CSenMessageContext* NewLC(SenContext::TContextDirection aDirection,
       
    75                                                    MSenProperties* apOwnedTp);
       
    76 
       
    77         // Destructor:
       
    78         IMPORT_C virtual ~CSenMessageContext();
       
    79         
       
    80         // New methods:
       
    81         
       
    82         // From MSenMessageContext:
       
    83         virtual MSenMessage* MessageL();	//codescannerwarnigs
       
    84         virtual TInt SetMessage(MSenMessage* apMessage, TBool aOwned = ETrue);
       
    85         
       
    86         virtual CSenChunk* ChunkL();	//codescannerwarnings
       
    87         virtual TInt SetChunk(CSenChunk* apMsgAsChunk, TBool aOwned = ETrue);        
       
    88 
       
    89         virtual TInt SetProperties(MSenProperties* apProperties, TBool aOwned = ETrue);
       
    90         virtual MSenProperties* Properties();
       
    91         
       
    92         virtual TInt Add(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue);
       
    93         virtual TInt Update(const TDesC8& aKey, MSenMessage* apMessage, TBool aOwned = ETrue);
       
    94         MSenMessage* GetMessageL(const TDesC8& aKey);	//codescannerwarnings
       
    95        
       
    96         
       
    97         // --> deprecated, remove from MSenMessageContext: <--
       
    98         virtual CSenSoapMessage* GetCurrentSoapMessage();
       
    99         virtual TPtrC8 GetMessageL();
       
   100         
       
   101         virtual TInt Add(const TDesC8& aKey, CSenSoapEnvelope* aValue);
       
   102         virtual TInt Update(const TDesC8& aKey, CSenSoapEnvelope* aValue);
       
   103         virtual const CSenSoapEnvelope* GetSenSoapEnvelopeL(const TDesC8& aKey);
       
   104         
       
   105 
       
   106 
       
   107         // From MSenContext:
       
   108         virtual SenContext::TContextType Type() const;        
       
   109     	virtual SenContext::TContextDirection Direction() const;
       
   110         virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
       
   111         virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
       
   112         virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
       
   113         virtual TInt Add(const TDesC8& aKey, TInt aValue);
       
   114         virtual TInt Update(const TDesC8& aKey, TInt aValue);
       
   115         virtual const TInt* GetIntL(const TDesC8& aKey);
       
   116         virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
       
   117         virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
       
   118         virtual const CSenElement* GetSenElementL(const TDesC8& aKey);
       
   119         virtual TInt Add(const TDesC8& aKey, TAny* aValue);
       
   120         virtual TInt Update(const TDesC8& aKey, TAny* aValue);
       
   121         virtual TAny* GetAnyL(const TDesC8& aKey);  //codescannerwarnings
       
   122         virtual TInt Remove(const TDesC8& aKey);     	
       
   123         virtual TInt Count() const;
       
   124         virtual TPtrC8 KeyAtL(TInt aIndex);
       
   125         virtual void Reset();
       
   126         virtual const CSenXmlReader* GetParser();
       
   127 
       
   128         virtual TInt SetDirection( SenContext::TContextDirection aDirection );
       
   129         
       
   130     protected:
       
   131         IMPORT_C  CSenMessageContext(SenContext::TContextDirection aDirection,
       
   132                                      MSenProperties* apOwnedTp);
       
   133                                      
       
   134         IMPORT_C void BaseConstructL();
       
   135 
       
   136     private: 
       
   137         // Helper method(s):
       
   138         CSenContextItem* MessageToItem(MSenMessage* apMessage, TBool aOwned, TInt& aError);
       
   139         
       
   140         // Data: 
       
   141         MSenProperties* ipOwnedTp; // owned; delallocated via IsSafeToCast()
       
   142     };
       
   143 
       
   144 #endif // SEN_MESSAGE_CONTEXT_H
       
   145 
       
   146 // End of File