webservices/wsframework/inc/msensessioncontext.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 M_SEN_SESSION_CONTEXT_H
       
    26 #define M_SEN_SESSION_CONTEXT_H
       
    27 
       
    28 // INCLUDES
       
    29 #include <e32std.h>
       
    30 #include "msencontext.h"
       
    31 /**
       
    32 * This is the session context interface, which is visible to CSenSessionHandler ECOM plug-in implementations.
       
    33 */
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CSenWSDescription;
       
    37 class MSenRemoteServiceSession;
       
    38 
       
    39 
       
    40 // CLASS DECLARATION
       
    41 class MSenSessionContext : public MSenContext
       
    42     {
       
    43     public:
       
    44         /*
       
    45         * Adds session description (as CSenWSDescription*) into context,
       
    46         * typically identified by following key: KSenCtxKeyServiceSession
       
    47         * 
       
    48         * @param aValue is the value being added. Ownership is NOT transferred
       
    49         * to this context.
       
    50         * 
       
    51         * @return KErrNone on success, 
       
    52         *         KErrAlreadyExists, if the key is reserved,
       
    53         *         or some other system-wide error code.
       
    54         */
       
    55         // virtual TInt AddSession(CSenWSDescription* aValue) = 0; // protected context
       
    56 
       
    57         /*
       
    58         * Updates new CSenWSDescription* type value into context, typically
       
    59         * identified by following key: KSenCtxKeyServiceSession
       
    60         * If some value for the same key already exists, it is replaced with new.
       
    61         * @param aValue is the updated value, which may replace
       
    62         *         any existing value, which used same key.
       
    63         *         Ownership is NOT transferred to this context.
       
    64         * @return KErrNone on success, 
       
    65         *         or some other system-wide error code.
       
    66         */
       
    67         //virtual TInt UpdateSession(CSenWSDescription* aValue) = 0;  // protected context
       
    68 
       
    69         /*
       
    70         * Method returns current service session as CSenWSDescriptionL* type value.
       
    71         * 
       
    72         * @return value behind given key, or NULL, if not
       
    73         * found.
       
    74         * Ownership is NOT transferred, as it was NOT held by this context.   
       
    75         * Method leaves with KErrSenTypeMismatch error code,
       
    76         * if value at this index is not CSenSoapEnvelope* type.   
       
    77         */
       
    78         virtual const CSenWSDescription* GetSession() = 0;
       
    79 
       
    80         // virtual TInt AddInitializer(CSenWSDescription* aValue) = 0; // protected context
       
    81         // virtual TInt UpdateInitializer(CSenWSDescription* aValue) = 0;  // protected context
       
    82 
       
    83         /*
       
    84         * Method returns session initializer as CSenWSDescriptionL* type value.
       
    85         * 
       
    86         * @returns value behind given key, or NULL, if not
       
    87         * found.
       
    88         * Ownership is NOT transferred, as it is never held by
       
    89         * this context.   
       
    90         * Method leaves with KErrSenTypeMismatch error code,
       
    91         * if value at this index is not CSenSoapEnvelope* type.   
       
    92         */
       
    93         virtual const CSenWSDescription* GetInitializer() = 0;
       
    94 
       
    95         /*
       
    96         * Adds new CSenWSDescription* type value into context, identified by given key.
       
    97         * 
       
    98         * @param aKey identifies new value
       
    99         * @param aValue is the value being added. Ownership is transferred
       
   100         * to this context.
       
   101         * 
       
   102         * @return KErrNone on success, 
       
   103         *         KErrAlreadyExists, if the key is reserved,
       
   104         *         or some other system-wide error code.
       
   105         */
       
   106         virtual TInt Add(const TDesC8& aKey, CSenWSDescription* aValue) = 0;
       
   107 
       
   108         /*
       
   109         * Updates session description (as CSenWSDescription*) into context,
       
   110         * typically identified by following key: KSenCtxKeyServiceSession
       
   111         * If some value for this key already exists, it is destroyed and replaced
       
   112         * by the new value.
       
   113         * 
       
   114         * @param aKey identifies new value
       
   115         * @param aValue is the updated value, which may replace
       
   116         *         any existing value, which used same key.
       
   117         *         Ownership is transferred to this context.
       
   118         * @return KErrNone on success, 
       
   119         *         or some other system-wide error code.
       
   120         */
       
   121         virtual TInt Update(const TDesC8& aKey, CSenWSDescription* aValue) = 0;
       
   122 
       
   123         /*
       
   124         * Method returns CSenWSDescriptionL* type value.
       
   125         * 
       
   126         * @return value behind given key, or NULL, if not
       
   127         * found.
       
   128         * Ownership is not transferred, but remains to be held by this context.   
       
   129         * Method leaves with KErrSenTypeMismatch error code,
       
   130         * if value at this index is not CSenSoapEnvelope* type.   
       
   131         */
       
   132         virtual const CSenWSDescription* GetSenWSDescriptionL(const TDesC8& aKey) = 0;
       
   133 
       
   134         /*
       
   135         * Adds new MSenRemoteServiceSession& type value into context, identified by given key.
       
   136         * 
       
   137         * @param aKey identifies new value
       
   138         * @param aValue is the value being added. Ownership is NOT transferred
       
   139         * to this context.
       
   140         * 
       
   141         * @return KErrNone on success, 
       
   142         *         KErrAlreadyExists, if the key is reserved,
       
   143         *         or some other system-wide error code.
       
   144         */
       
   145         virtual TInt Add(const TDesC8& aKey, MSenRemoteServiceSession& aValue) = 0; // protected context
       
   146 
       
   147         /*
       
   148         * Updates new MSenRemoteServiceSession& type value into context, identified by given key.
       
   149         * If some value for the same key already exists, it is replaced with the new value.
       
   150         * 
       
   151         * @param aKey identifies new value
       
   152         * @param aValue is the updated value, which may replace
       
   153         *         any existing value, which used same key.
       
   154         *         Ownership is NOT transferred to this context.
       
   155         * 
       
   156         * @return KErrNone on success, 
       
   157         *         or some other system-wide error code.
       
   158         */
       
   159         virtual TInt Update(const TDesC8& aKey, MSenRemoteServiceSession& aValue) = 0;
       
   160 
       
   161         /*
       
   162         * Method returns MSenRemoteServiceSession* type value.
       
   163         * 
       
   164         * @param aKey identifies remote service session
       
   165         * 
       
   166         * @returns value behind given key, or NULL, if not
       
   167         * found.
       
   168         * Ownership is NOT transferred, as it was never held 
       
   169         * by this context.   
       
   170         * Method leaves with KErrSenTypeMismatch error code,
       
   171         * if value at this index is not MSenRemoteServiceSession* type.   
       
   172         */
       
   173         virtual const MSenRemoteServiceSession* GetSenRemoteServiceSessionL(const TDesC8& aKey) = 0;
       
   174 
       
   175     };
       
   176 
       
   177 #endif // M_SEN_SESSION_CONTEXT_H
       
   178 
       
   179 // End of File