accesssec_plat/eap_vpn_api/inc/eap_vpn_if.h
changeset 0 c8830336c852
child 2 1c7bc153c08e
equal deleted inserted replaced
-1:000000000000 0:c8830336c852
       
     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 the License "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: EAP and WLAN authentication protocols.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __EAPPLUGININTERFACE_H__
       
    20 #define __EAPPLUGININTERFACE_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <ecom/ecom.h>
       
    24 #include  "eap_vpn_if_uids.h"
       
    25 
       
    26 class MAbsEapVpnInterface;
       
    27 
       
    28 class TAbsEapVpnInterfaceParams
       
    29 {
       
    30     public:
       
    31     MAbsEapVpnInterface*    iCaller;
       
    32     TBool                           iClient;
       
    33 };
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 
       
    37 /**
       
    38  * Class:       CEapVpnInterface
       
    39  *
       
    40  * Description: Custom ECOM interface definition. This interface is used by
       
    41  *              clients to load eap_vpn_if instance and use the defined generic functions
       
    42  */
       
    43 class CEapVpnInterface :
       
    44     public CActive
       
    45 {
       
    46 public: // Constructors and destructor
       
    47 	/**
       
    48 	 * Function:   NewL
       
    49 	 *
       
    50 	 * Description: Wraps ECom object instantitation. Will return the
       
    51 	 *              default interface implementation.
       
    52 	 *
       
    53 	 * Note:        This is not a "normal" NewL method, since normally NewL
       
    54 	 *              methods are only defined for concrete classes.
       
    55 	 *              Note that also implementations of this interface
       
    56 	 *              provide NewL methods. They are the familiar NewL's,
       
    57 	 *              which create instance of classes.
       
    58      */
       
    59 	static CEapVpnInterface* NewL(MAbsEapVpnInterface* aCaller, TBool aClient);
       
    60 
       
    61     /**
       
    62      * Function:   NewL
       
    63      *
       
    64      * Description: Wraps ECom object instantitation. Will search for
       
    65      *              interface implementation, which matches to given
       
    66      *              aOperationName.
       
    67      *
       
    68      * @param       aType name of requested implementation. (This is not the eap type!)
       
    69      *              Implementations advertise their "name" as specified
       
    70      *              in their resource file field
       
    71      *                 IMPLEMENTATION_INFO::default_data.
       
    72      *
       
    73      * Note:        This is not a "normal" NewL method, since normally NewL
       
    74      *              methods are only defined for concrete classes.
       
    75      *              Note that also implementations of this interface provide
       
    76      *              NewL methods. They are the familiar NewL's, which create
       
    77      *              instance of classes.
       
    78      */
       
    79     static CEapVpnInterface* NewL(const TDesC8& aType, MAbsEapVpnInterface* aCaller, TBool aClient);
       
    80 
       
    81 	/**
       
    82 	 * Function:    ~CEapVpnInterfaceImplementation
       
    83 	 *
       
    84 	 * Description: Destroy the object
       
    85      */
       
    86 	inline virtual ~CEapVpnInterface();
       
    87     
       
    88 protected:
       
    89     
       
    90     CEapVpnInterface();
       
    91 
       
    92 public:
       
    93 
       
    94     /**
       
    95      * Function:    StartL
       
    96      *
       
    97      * Description: Initializes the eap plugin
       
    98 	 *
       
    99      * @param       aType name of requested eap type implementation.
       
   100      *
       
   101      */
       
   102     virtual TInt StartL(const TUint8 aEapType) = 0;
       
   103 
       
   104     /**
       
   105      * Function:    EapConfigure
       
   106      *
       
   107      * Description: Configures the eap plugin
       
   108 	 *
       
   109      * @param       aManualUsername The username, if not zero
       
   110      * @param       aManualRealm The realm, if not zero
       
   111      * @param       aManualRealmPrefix The realm prefix, if not zero
       
   112      * @param       aHideInitialIdentity Scramble username, if true
       
   113      *
       
   114      */
       
   115     virtual TInt EapConfigure(TDesC8& aManualUsername, TDesC8& aManualRealm, TDesC8& aRealmPrefix, TBool aHideInitialIdentity) = 0;
       
   116     
       
   117 	/**
       
   118 	 * Function:    QueryIdentity
       
   119 	 *
       
   120 	 * Description: Ask the identity
       
   121      */
       
   122 	virtual TInt QueryIdentity() = 0;
       
   123 
       
   124     /**
       
   125 	 * Function:    EapInbound
       
   126 	 *
       
   127 	 * Description: Handle incoming Eap message
       
   128 	 *
       
   129      * @param       aMessage incoming eap message.
       
   130      *              
       
   131      */
       
   132     virtual TInt EapInbound(const TDesC8& aMessage) = 0;
       
   133 
       
   134     virtual void RunL()=0;
       
   135     virtual void DoCancel() = 0;
       
   136 
       
   137 private:
       
   138    /** iDtor_ID_Key Instance identifier key. When instance of an
       
   139 	 *               implementation is created by ECOM framework, the
       
   140 	 *               framework will assign UID for it. The UID is used in
       
   141 	 *               destructor to notify framework that this instance is
       
   142 	 *               being destroyed and resources can be released.
       
   143      */
       
   144 	TUid                            iDtor_ID_Key;
       
   145 	};
       
   146 
       
   147 // This includes the implementation of the instantiation functions and
       
   148 // destructor
       
   149 #include "eap_vpn_if.inl"
       
   150 
       
   151 #endif