webservices/wsframework/inc/sentransportcontext.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef SEN_TRANSPORT_CONTEXT_H
       
    26 #define SEN_TRANSPORT_CONTEXT_H
       
    27 
       
    28 
       
    29 // INCLUDES
       
    30 #include <e32std.h>
       
    31 
       
    32 #include "msentransportcontext.h"
       
    33 #include "senpointermap.h"
       
    34 #include "sencontext.h"
       
    35 
       
    36 // FORWARD DECLARE
       
    37 class MSenCoreServiceManager;
       
    38 class CSenWSDescription;
       
    39 class CSenServiceSession;
       
    40 class CSenContextItem;
       
    41 
       
    42 // TYPE DEFS
       
    43 typedef RSenPointerMap<TDesC8, CSenContextItem> RCtxItemMap;
       
    44 
       
    45 // CLASS DECLARATION
       
    46 /**
       
    47 * This is the abstract super class for all WSF context iten classes, 
       
    48 * providing generic interface for resolving context item type, and
       
    49 * equal properties.
       
    50 */
       
    51 class CSenTransportContext : public CSenContext, public MSenTransportContext
       
    52     {
       
    53     public:
       
    54         
       
    55         /**
       
    56         * Standard 2-phased constructor
       
    57         * @param aCore provides reference to to core, which is stored into
       
    58         * this transport context. There is only single core instance in WS-stack.
       
    59         * @param aSessionInitializer is the XML service description used to 
       
    60         * initialize the connection (HC or SC) to the core.
       
    61         * @return pointer to new transport context
       
    62         */ 
       
    63         IMPORT_C static CSenTransportContext* NewL(MSenCoreServiceManager& aCore,
       
    64                                                    CSenWSDescription& aSessionInitializer);
       
    65         /**
       
    66         * Standard 2-phased constructor
       
    67         * @param aCore provides reference to to core, which is stored into
       
    68         * this transport context. There is only single core instance in WS-stack.
       
    69         * @param aSessionInitializer is the XML service description used to 
       
    70         * initialize the connection (HC or SC) to the core.
       
    71         * @return pointer to new transport context, which is left on cleanup stack.
       
    72         */ 
       
    73         IMPORT_C static CSenTransportContext* NewLC(MSenCoreServiceManager& aCore,
       
    74                                                     CSenWSDescription& aSessionInitializer);
       
    75 
       
    76         /**
       
    77         * Standard 2-phased constructor
       
    78         * @param aCore provides reference to to core, which is stored into
       
    79         * this transport context. There is only single core instance in WS-stack.
       
    80         * @param aSessionInitializer is the XML service description used to 
       
    81         * initialize the connection (HC or SC) to the core.
       
    82         * @param aInvoker is the session which is about to create new transport plug-in 
       
    83         * instance, into which this transport context is utilized.
       
    84         * @return pointer to new transport context
       
    85         */ 
       
    86         IMPORT_C static CSenTransportContext* NewL(MSenCoreServiceManager& aCore,
       
    87                                                    CSenWSDescription& aSessionInitializer,
       
    88                                                    CSenServiceSession& aInvoker);
       
    89         /**
       
    90         * Standard 2-phased constructor
       
    91         * @param aCore provides reference to to core, which is stored into
       
    92         * this transport context. There is only single core instance in WS-stack.
       
    93         * @param aSessionInitializer is the XML service description used to 
       
    94         * initialize the connection (HC or SC) to the core.
       
    95         * @param aInvoker is the session which is about to create new transport plug-in 
       
    96         * instance, into which this transport context is utilized.
       
    97         * @return pointer to new transport context, which is left on cleanup stack.
       
    98         */ 
       
    99         IMPORT_C static CSenTransportContext* NewLC(MSenCoreServiceManager& aCore,
       
   100                                                     CSenWSDescription& aSessionInitializer,
       
   101                                                     CSenServiceSession& aInvoker);
       
   102 
       
   103         // Destructor:
       
   104         IMPORT_C virtual ~CSenTransportContext();
       
   105 
       
   106         // From MSenTransportContext:
       
   107         // virtual TInt AddCore(MSenCoreServiceManager& aValue);
       
   108         virtual MSenCoreServiceManager& GetCoreL();
       
   109         //virtual MSenCoreServiceManager* GetCore();
       
   110         //virtual TInt AddSession(CSenServiceSession* aValue); 
       
   111         //virtual TInt UpdateSession(CSenServiceSession* aValue);
       
   112         virtual const CSenServiceSession* GetSession();
       
   113         //CSenServiceSession& GetSessionL();
       
   114         // virtual TInt AddInitializer(CSenWSDescription* aValue);
       
   115         // virtual TInt UpdateInitializer(CSenWSDescription* aValue);
       
   116         virtual CSenWSDescription& GetInitializerL();
       
   117         
       
   118         //virtual const CSenWSDescription* GetInitializer();
       
   119         //virtual TInt AddServiceDescription(const TDesC8& aKey, CSenWSDescription* aValue);
       
   120         //virtual TInt UpdateServiceDescription(const TDesC8& aKey, CSenWSDescription* aValue);
       
   121         //virtual const CSenWSDescription* GetServiceDescriptionL(const TDesC8& aKey);
       
   122         //virtual TInt Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue); // protected context
       
   123         //virtual TInt Update(const TDesC8& aKey, MSenRemoteServiceSession& aValue);
       
   124         //virtual const MSenRemoteServiceSession* GetSenRemoteServiceSessionL(const TDesC8& aKey);
       
   125 
       
   126         // From MSenContext:
       
   127         virtual SenContext::TContextType Type() const;        
       
   128     	virtual SenContext::TContextDirection Direction() const;
       
   129         virtual TInt Add(const TDesC8& aKey, const TDesC8& aValue);
       
   130         virtual TInt Update(const TDesC8& aKey, const TDesC8& aValue);
       
   131         virtual const TDesC8* GetDesC8L(const TDesC8& aKey);
       
   132         virtual TInt Add(const TDesC8& aKey, TInt aValue);
       
   133         virtual TInt Update(const TDesC8& aKey, TInt aValue);
       
   134         virtual const TInt* GetIntL(const TDesC8& aKey);
       
   135         virtual TInt Add(const TDesC8& aKey, CSenElement* aValue);
       
   136         virtual TInt Update(const TDesC8& aKey, CSenElement* aValue);
       
   137         virtual const CSenElement* GetSenElementL(const TDesC8& aKey);
       
   138         virtual TInt Add(const TDesC8& aKey, TAny* aValue);
       
   139         virtual TInt Update(const TDesC8& aKey, TAny* aValue);
       
   140         virtual TAny* GetAnyL(const TDesC8& aKey);	//codescannerwarnings
       
   141         virtual const CSenXmlReader* GetParser();
       
   142 
       
   143         virtual TInt Remove(const TDesC8& aKey);     	
       
   144         virtual TInt Count() const;
       
   145         virtual TPtrC8 KeyAtL(TInt aIndex);
       
   146         virtual void Reset();
       
   147         
       
   148         virtual TInt SetDirection( SenContext::TContextDirection aDirection );
       
   149 
       
   150         
       
   151     protected:
       
   152         IMPORT_C CSenTransportContext();
       
   153         IMPORT_C void BaseConstructL(MSenCoreServiceManager& aCore,
       
   154                                      CSenWSDescription& aSessionInitializer,
       
   155                                      CSenServiceSession* apInvoker);
       
   156     };
       
   157 
       
   158 #endif // SEN_TRANSPORT_CONTEXT_H
       
   159 
       
   160 // End of File