eapol/eapol_framework/eapol_symbian/eap_if/include/EapGeneralSettingsImpl.h
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
child 55 9c2aa05919d9
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
     1 /*
       
     2 * Copyright (c) 2001-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 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:  This is implementation of CEapGeneralSettings interface.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 28 %
       
    20 */
       
    21 
       
    22 #ifndef _EAP_GENERAL_SETTINGS_IMPL_H_
       
    23 #define _EAP_GENERAL_SETTINGS_IMPL_H_
       
    24 
       
    25 // INCLUDES
       
    26 #include <EapType.h>
       
    27 #include <EapGeneralSettings.h>
       
    28 #include "eap_header.h"
       
    29 #include "eap_array.h"
       
    30 #include "abs_eap_general_settings_message.h"
       
    31 #include "eap_configuration_field.h"
       
    32 #include "EapExpandedType.h"
       
    33 #include "EapClientIf.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class eap_am_network_id_c;
       
    37 class eap_method_settings_c;
       
    38 class abs_eap_am_tools_c;
       
    39 class eap_general_settings_message_c;
       
    40 
       
    41 
       
    42 enum eap_general_settings_wait_state_e
       
    43 {
       
    44 	eap_general_settings_wait_state_none,
       
    45 	eap_general_settings_wait_state_complete_set_eap_methods,
       
    46 	eap_general_settings_wait_state_complete_get_eap_methods,
       
    47 	eap_general_settings_wait_state_complete_get_certificate_lists,
       
    48 	eap_general_settings_wait_state_complete_delete_all_eap_settings,
       
    49 	eap_general_settings_wait_state_complete_copy_all_eap_settings,
       
    50 };
       
    51 
       
    52 
       
    53 // CLASS DECLARATION
       
    54 /**
       
    55 * This is implementation of CEapGeneralSettings interface.
       
    56 */
       
    57 class CEapGeneralSettingsImpl
       
    58 : public CEapGeneralSettings
       
    59 , public abs_eap_general_settings_message_c
       
    60 , public EapClientIf
       
    61 {
       
    62 public:		
       
    63 
       
    64 	/**
       
    65 	* Construction function. Called by ECom after the EAP generic plugin has been loaded.
       
    66 	* @param aIapInfo Pointer to the class that contains information about bearer type and unique index.
       
    67 	* @return Pointer to the instance.
       
    68 	*/
       
    69 	static CEapGeneralSettingsImpl* NewL(SIapInfo* aIapInfo);
       
    70 
       
    71 	/**
       
    72 	* Destructor does nothing.
       
    73 	*/
       
    74 	virtual ~CEapGeneralSettingsImpl();
       
    75 	
       
    76 	/**
       
    77 	* Returns the version of the interface that the EAP type implements.
       
    78 	* The client-side of the interface must always check the version with this function 
       
    79 	* and not call the functions that are not implemented. New functions must be
       
    80 	* added to the end of the interface so that the order of the old functions
       
    81 	* does not change.
       
    82 	* @return Integer indicating the version.
       
    83 	*/
       
    84 	TUint GetInterfaceVersion();
       
    85 
       
    86 	TInt SetEapMethods(
       
    87 		const RArray<TEapExpandedType> & aActiveEapMethods,
       
    88 		const RArray<TEapExpandedType> & aDisabledEapMethods);
       
    89 
       
    90 	TInt GetEapMethods(
       
    91 		RArray<TEapExpandedType> & aActiveEapMethods,
       
    92 		RArray<TEapExpandedType> & aDisabledEapMethods);
       
    93 
       
    94 	TInt GetCertificateLists(
       
    95 		RPointerArray<EapCertificateEntry> & aUserCerts,
       
    96 		RPointerArray<EapCertificateEntry> & aCACerts);
       
    97 
       
    98 	TInt DeleteAllEapSettings();
       
    99 
       
   100 	TInt CopyAllEapSettings(
       
   101 		const TIndexType aDestinationIndexType,
       
   102 		const TInt aDestinationIndex);
       
   103 
       
   104 	eap_status_e complete_get_eap_methods(
       
   105 		const eap_method_settings_c * const internal_settings);
       
   106 
       
   107 	eap_status_e complete_set_eap_methods(
       
   108 		const eap_status_e completion_status);
       
   109 
       
   110 	eap_status_e complete_get_certificate_lists(
       
   111 		const eap_method_settings_c * const internal_settings);
       
   112 
       
   113 	eap_status_e complete_delete_all_eap_settings(
       
   114 		const eap_status_e completion_status);
       
   115 
       
   116 	eap_status_e complete_copy_all_eap_settings(
       
   117 		const eap_status_e completion_status);
       
   118 
       
   119 protected:
       
   120 
       
   121 	/**
       
   122 	* Constructor initialises member variables.
       
   123 	*/
       
   124 	CEapGeneralSettingsImpl(const TIndexType aIndexType, const TInt aIndex);
       
   125 
       
   126 	void ConstructL();
       
   127 
       
   128 private:
       
   129 
       
   130 	void Activate();
       
   131 	
       
   132 	void Complete();
       
   133 
       
   134 	void WaitCompletion();
       
   135 
       
   136 	void SetCompletionStatusIfStillOk(const eap_status_e status);
       
   137 
       
   138 	/// This is pointer to the tools class.
       
   139 	abs_eap_am_tools_c * const m_am_tools;
       
   140 
       
   141 	eap_general_settings_message_c * const m_server;
       
   142 
       
   143 	CActiveSchedulerWait iWait;
       
   144 
       
   145 	// Bearer type
       
   146 	TIndexType iIndexType;
       
   147 
       
   148 	// Unique index in the bearer space.
       
   149 	TInt iIndex;
       
   150 
       
   151 	RArray<TEapExpandedType> * iActiveEapMethods;
       
   152 	RArray<TEapExpandedType> * iDisabledEapMethods;
       
   153 
       
   154 	RPointerArray<EapCertificateEntry> * iUserCerts;
       
   155 	RPointerArray<EapCertificateEntry> * iCACerts;
       
   156 
       
   157 	eap_general_settings_wait_state_e iWaitState;
       
   158 
       
   159 	eap_status_e iCompletionStatus;
       
   160 
       
   161 	TRequestStatus iAsyncronousStatus;
       
   162 };
       
   163 
       
   164 #endif // _EAP_GENERAL_SETTINGS_IMPL_H_
       
   165 
       
   166 // End of file