webservices/wsframework/inc/sentransport.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 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:        Defines the ECOM interface for Transport plug-in implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef SEN_TRANSPORT_H
       
    26 #define SEN_TRANSPORT_H
       
    27 
       
    28 // INCLUDES
       
    29 #include <ecom/ecom.h>
       
    30 
       
    31 #include "sentransportbase.h"
       
    32 #include "sentransportcontext.h"
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 * Custom ECOM interface definition. This interface is used by
       
    38 * clients to find specific transport plugins which implement 
       
    39 * pure virtual functions defined in MSenTranport interface.
       
    40 */
       
    41 class CSenTransport : public CSenTransportBase
       
    42     {
       
    43     enum TPanic
       
    44         {
       
    45         ETransportCtxNotInitialized = 1
       
    46         };
       
    47 
       
    48     public: // Constructors and destructor
       
    49 
       
    50         /**
       
    51         * Wraps ECom object instantiation, which returns the
       
    52         * default interface implementation.
       
    53         * Note: This is not a "normal" NewL method, since normally NewL
       
    54         * methods are only defined for concrete classes.
       
    55         * Note that the implementations of this interface
       
    56         * also provide NewL methods.
       
    57         * @param apCtx is the context, which ownership IS transferred
       
    58         * to this new transport plug-in instance
       
    59         * @return a pointer to new transport plug-in, 
       
    60         */
       
    61         static CSenTransport* NewL(CSenTransportContext* apCtx);
       
    62 
       
    63         //static CSenTransport* NewL(MSenCoreServiceManager& aManager);
       
    64 
       
    65         /**
       
    66         * Wraps ECom object instantitation, which returns the
       
    67         * interface implementation matching to given aCue.
       
    68         * IMPLEMENTATION_INFO::default_data.
       
    69         * For details, see EcomSIFDefinition.inl comments.
       
    70         * Note: This is not a "normal" NewL method, since normally NewL
       
    71         * methods are only defined for concrete classes.
       
    72         * Note that the implementations of this interface 
       
    73         * also provide NewL methods. 
       
    74         *
       
    75         * @param: aCue is the "name" of the requested implementation.
       
    76         *              Implementations advertise their cue as specified
       
    77         *              in their resource file field
       
    78         * @param apCtx is the context, which ownership IS transferred
       
    79         * to this new transport plug-in instance
       
    80         * @return a pointer to new transport plug-in, which is left
       
    81         *  on cleanup stack.
       
    82         */
       
    83         static CSenTransport* NewL(const TDesC8& aCue,
       
    84                                    CSenTransportContext* apCtx);
       
    85         //static CSenTransport* NewL(const TDesC8& aCue,
       
    86         //                           MSenCoreServiceManager& aManager);
       
    87 
       
    88         /**
       
    89         * Destructor.
       
    90         */
       
    91         virtual ~CSenTransport();
       
    92 
       
    93         // New functions
       
    94         
       
    95         // the actual security mechanism interface methods
       
    96 
       
    97     protected:
       
    98 
       
    99         /**
       
   100         * C++ default constructor.
       
   101         */
       
   102         CSenTransport(CSenTransportContext* apCtx, TBool aSessionOwned = ETrue);
       
   103 
       
   104         MSenTransportContext& Context();
       
   105 
       
   106     protected: // Data
       
   107         CSenTransportContext* ipCtx;     // owned
       
   108 
       
   109     private: // Data
       
   110         /** 
       
   111         * Instance identifier key. When instance of an implementation is created 
       
   112         * by ECOM framework, the framework will assign UID for it. 
       
   113         * The UID is used in destructor to notify framework that this instance is
       
   114       * being destroyed and resources can be released.
       
   115       */
       
   116         TUid iDtor_ID_Key;
       
   117     };
       
   118 
       
   119 // This includes the implementation of the instantiation functions and destructor
       
   120 #include "sentransport.inl"
       
   121 
       
   122 #endif // SEN_TRANSPORT_H
       
   123 
       
   124 // End of File