webservices/wsframework/inc/sensecuritymechanism.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:        Defines the ECom interface for Sen Security Mechanism plug-ins
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef SEN_SECURITY_MECHANISM_H
       
    26 #define SEN_SECURITY_MECHANISM_H
       
    27 
       
    28 // INCLUDES
       
    29 #include <ecom/ecom.h>
       
    30 
       
    31 #include "msensaslmessage.h"
       
    32 #include "msencoreservicemanager.h"
       
    33 #include "saslmechanism.h"
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 * Custom ECOM interface definition. This interface is used by
       
    39 * clients to find specific security mechanism plugin instance
       
    40 * implementations which implement pure virtual functions.
       
    41 */
       
    42 class CSenSecurityMechanism : public CSaslMechanism
       
    43     {
       
    44     public: // Constructors and destructor
       
    45         /**
       
    46         * Wraps ECom object instantitation, which returns the
       
    47         * default interface implementation.
       
    48         * Note: This is not a "normal" NewL method, since normally NewL
       
    49         * methods are only defined for concrete classes.
       
    50         * Note that the implementations of this interface
       
    51         * ALSO provide NewL methods. They are the familiar
       
    52         * EPOC NewL's, which create instance of classes.
       
    53         */
       
    54         static CSenSecurityMechanism* NewL(MSenCoreServiceManager& aManager);
       
    55 
       
    56         /**
       
    57         * Wraps ECom object instantitation, which returns the
       
    58         * interface implementation matching to given aCue.
       
    59         * IMPLEMENTATION_INFO::default_data.
       
    60         * For details, see EcomSIFDefinition.inl comments.
       
    61         * Note: This is not a "normal" NewL method, since normally NewL
       
    62         * methods are only defined for concrete classes.
       
    63         * Note that the implementations of this interface ALSO
       
    64         * provide NewL methods. They are the familiar EPOC NewL's,
       
    65         * which create instance of classes.
       
    66         * @param  aCue is the "name" of the requested implementation.
       
    67         *         Implementations advertise their cue as specified
       
    68         *         in their resource file field
       
    69         */
       
    70         static CSenSecurityMechanism* NewL(const TDesC8& aCue,
       
    71                                            MSenCoreServiceManager& aManager);
       
    72 
       
    73         /**
       
    74         * Destructor.
       
    75         */
       
    76         virtual ~CSenSecurityMechanism();
       
    77 
       
    78         // New functions
       
    79         
       
    80         // the actual security mechanism interface methods
       
    81         
       
    82         /**
       
    83         * @return the name of the mechanism, like "PLAIN".
       
    84         */
       
    85         virtual const TDesC8& Name() = 0;
       
    86 
       
    87         /**
       
    88         * @return a SASL request that is a response to the passed response.
       
    89         * Caller takes ownership of the returned object. Never returns NULL.
       
    90         */
       
    91         virtual TInt HandleResponseL(MSenSaslMessage& aResponse,
       
    92                                      MSenSaslMessage& aNewRequest) = 0;
       
    93 
       
    94     protected:
       
    95         CSenSecurityMechanism(MSenCoreServiceManager& aServiceManager);
       
    96 
       
    97     protected: // Data
       
    98         // to access base64, encoding/decoding
       
    99         MSenCoreServiceManager& iServiceManager;
       
   100 
       
   101     private:
       
   102         /**
       
   103         * Instance identifier key. When instance of an
       
   104         * implementation is created by ECOM framework, the
       
   105         * framework will assign UID for it. The UID is used in
       
   106         * destructor to notify framework that this instance is
       
   107         * being destroyed and resources can be released.
       
   108         */
       
   109         TUid iDtor_ID_Key;
       
   110     };
       
   111 
       
   112 // This includes the implementation of the instantiation functions and
       
   113 // destructor
       
   114 #include "sensecuritymechanism.inl"
       
   115 
       
   116 #endif // SEN_SECURITY_MECHANISM_H
       
   117 
       
   118 // End of File