diff -r bad0cc58d154 -r c74b3d9f6b9e eapol/eapol_framework/eapol_symbian/am/type/securid/symbian/plugin/src/EapSecurID.cpp --- a/eapol/eapol_framework/eapol_symbian/am/type/securid/symbian/plugin/src/EapSecurID.cpp Tue Aug 31 15:16:37 2010 +0300 +++ b/eapol/eapol_framework/eapol_symbian/am/type/securid/symbian/plugin/src/EapSecurID.cpp Wed Sep 01 12:23:57 2010 +0100 @@ -16,7 +16,7 @@ */ /* -* %version: 25 % +* %version: 15.1.2 % */ // This is enumeration of EAPOL source code. @@ -37,9 +37,10 @@ #include #include "EapGtcDbUtils.h" +#include +#include "EapGtcUi.h" + #include "eap_am_tools_symbian.h" -#include "EapConversion.h" -#include "EapTraceSymbian.h" // LOCAL CONSTANTS @@ -151,13 +152,36 @@ // ---------------------------------------------------------- -CEapTypeInfo* CEapSecurID::GetInfoL() +TInt CEapSecurID::InvokeUiL() +{ + TInt buttonId(0); + +#ifdef USE_EAP_EXPANDED_TYPES + + CEapGtcUiConnection uiConn(iIndexType, iIndex, iTunnelingType.get_vendor_type()); + +#else + + CEapGtcUiConnection uiConn(iIndexType, iIndex, iTunnelingType); + +#endif //#ifdef USE_EAP_EXPANDED_TYPES + + CEapGtcUi* ui = CEapGtcUi::NewL(&uiConn); + CleanupStack::PushL(ui); + buttonId = ui->InvokeUiL(); + CleanupStack::PopAndDestroy(ui); + return buttonId; +} + +// ---------------------------------------------------------- + +CEapTypeInfo* CEapSecurID::GetInfoLC() { CEapTypeInfo* info = new(ELeave) CEapTypeInfo( (TDesC&) KReleaseDate, (TDesC&) KEapTypeVersion, (TDesC&) KManufacturer); - + CleanupStack::PushL(info); return info; } @@ -170,20 +194,19 @@ // ---------------------------------------------------------- -void CEapSecurID::SetTunnelingType(const TEapExpandedType aTunnelingType) - { - EAP_TRACE_DATA_DEBUG_SYMBIAN( - (EAPL("CEapSecurID::SetTunnelingType - tunneling type"), - aTunnelingType.GetValue().Ptr(), aTunnelingType.GetValue().Length())); - - eap_type_value_e aInternalType; - - TInt err = CEapConversion::ConvertExpandedEAPTypeToInternalType( - &aTunnelingType, - &aInternalType); - - iTunnelingType = aInternalType; - } +void CEapSecurID::SetTunnelingType(const TInt aTunnelingType) +{ +#ifdef USE_EAP_EXPANDED_TYPES + + // Vendor id is eap_type_vendor_id_ietf always in this plugin. + iTunnelingType.set_eap_type_values(eap_type_vendor_id_ietf, aTunnelingType); + +#else + + iTunnelingType = static_cast(aTunnelingType); + +#endif //#ifdef USE_EAP_EXPANDED_TYPES +} // ---------------------------------------------------------- void CEapSecurID::SetIndexL( @@ -207,16 +230,13 @@ RDbNamedDatabase db; - RFs session; + RDbs session; + + EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); CleanupClosePushL(session); CleanupClosePushL(db); - TInt error = session.Connect(); - EAP_TRACE_DEBUG_SYMBIAN((_L("CEapSecurID::SetIndexL(): - session.Connect(), error=%d\n"), error)); - User::LeaveIfError(error); - - EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); - + EapGtcDbUtils::SetIndexL( db, iIndexType, @@ -229,27 +249,22 @@ iIndexType = aIndexType; iIndex = aIndex; - db.Close(); - session.Close(); - - CleanupStack::PopAndDestroy(&db); - CleanupStack::PopAndDestroy(&session); + CleanupStack::PopAndDestroy(2); // db + + } void CEapSecurID::SetConfigurationL(const EAPSettings& aSettings) { RDbNamedDatabase db; - RFs session; + RDbs session; + + // This also creates the IAP entry if it doesn't exist + EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); CleanupClosePushL(session); CleanupClosePushL(db); - TInt error = session.Connect(); - EAP_TRACE_DEBUG_SYMBIAN((_L("CEapSecurID::SetConfigurationL(): - session.Connect(), error=%d\n"), error)); - User::LeaveIfError(error); - - // This also creates the IAP entry if it doesn't exist - EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); EapGtcDbUtils::SetConfigurationL( db, @@ -257,28 +272,21 @@ iIndexType, iIndex, iTunnelingType); - - db.Close(); - session.Close(); - - CleanupStack::PopAndDestroy(&db); - CleanupStack::PopAndDestroy(&session); + + CleanupStack::PopAndDestroy(2); // db, session } void CEapSecurID::GetConfigurationL(EAPSettings& aSettings) { RDbNamedDatabase db; - RFs session; + RDbs session; + + // This also creates the IAP entry if it doesn't exist + EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); CleanupClosePushL(session); CleanupClosePushL(db); - TInt error = session.Connect(); - EAP_TRACE_DEBUG_SYMBIAN((_L("CEapSecurID::GetConfigurationL(): - session.Connect(), error=%d\n"), error)); - User::LeaveIfError(error); - - // This also creates the IAP entry if it doesn't exist - EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); EapGtcDbUtils::GetConfigurationL( db, @@ -286,12 +294,8 @@ iIndexType, iIndex, iTunnelingType); - - db.Close(); - session.Close(); - - CleanupStack::PopAndDestroy(&db); - CleanupStack::PopAndDestroy(&session); + + CleanupStack::PopAndDestroy(2); // db, session } void CEapSecurID::CopySettingsL( @@ -315,16 +319,13 @@ RDbNamedDatabase db; - RFs session; + RDbs session; + + EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); CleanupClosePushL(session); CleanupClosePushL(db); - TInt error = session.Connect(); - EAP_TRACE_DEBUG_SYMBIAN((_L("CEapSecurID::CopySettingsL(): - session.Connect(), error=%d\n"), error)); - User::LeaveIfError(error); - - EapGtcDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); - + EapGtcDbUtils::CopySettingsL( db, iIndexType, @@ -333,12 +334,9 @@ aDestinationIndexType, aDestinationIndex, iTunnelingType); - - db.Close(); - session.Close(); - - CleanupStack::PopAndDestroy(&db); - CleanupStack::PopAndDestroy(&session); + + CleanupStack::PopAndDestroy(2); // db + }