diff -r 093cf0757204 -r 938269283a16 securitysettings/qtconfigutils/eapqtconfiginterface/inc/eapqtconfiginterface_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/securitysettings/qtconfigutils/eapqtconfiginterface/inc/eapqtconfiginterface_p.h Fri Jun 11 13:40:22 2010 +0300 @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of the License "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * EAP method configuration QT interface private implementation + * + */ + +/* + * %version: 29 % + */ + +#ifndef EAPQTCONFIGINTERFACEPRIVATE_H +#define EAPQTCONFIGINTERFACEPRIVATE_H + +#include +#include +#include +#include +#include +#include + +/*! + * @addtogroup group_eap_config_if_impl + * @{ + */ +class HbTranslator; +class CEapType; +class CEapGeneralSettings; +class CpEapPluginInterface; +class EapQtConfigInterface; + +class EapQtConfigInterfacePrivate +{ +public: + + // maximum lenghts (number of characters) for UTF-16 strings copied to EAP settings + static const unsigned int StringMaxLength = KGeneralStringMaxLength; + static const unsigned int CertLabelMaxLength = KMaxCertLabelLength; + static const unsigned int CertThumbprintMaxLength = KThumbprintMaxLength; + static const unsigned int CertSubjectKeyIdLength = KSHA1HashLengthBytes; + +public: + + // the constructor can only be used for validators + // any other call trows an exception + EapQtConfigInterfacePrivate(); + + // this is the constructor for using the interface for accessing settings etc. + // if iapId is negative, it must be later set to correct value with setConfigurationReference + // to be able to use the methods: + // - selectedOuterTypes + // - readConfiguration + // - saveConfiguration + // - deleteConfiguration + // - uiInstance + // other methods are usable with negative iapId + EapQtConfigInterfacePrivate(const EapQtConfigInterface::EapBearerType bearerType, + const int iapId); + + ~EapQtConfigInterfacePrivate(); + + QList supportedOuterTypes(); + QList supportedInnerTypes(const EapQtPluginHandle &outerType); + + bool isSupportedOuterType(const EapQtPluginHandle& handle); + bool isSupportedInnerType(const EapQtPluginHandle& outerHandle, + const EapQtPluginHandle& innerHandle); + + QList certificateAuthorityCertificates(); + QList userCertificates(); + + EapQtValidator *validatorEap(EapQtExpandedEapType type, EapQtConfig::SettingsId id); + + CpBaseSettingView *uiInstance(const EapQtPluginHandle& outerHandle, + const EapQtPluginHandle& pluginHandle); + + // if iapId was negative in the constructor, this method must be called before + // calling the following methods + bool setConfigurationReference(const int iapId); + + QList selectedOuterTypes(); + bool setSelectedOuterTypes(const QList& outerHandles); + + bool readConfiguration(const EapQtPluginHandle& outerHandle, + const EapQtPluginHandle& pluginHandle, EapQtConfig &config); + bool saveConfiguration(const EapQtPluginHandle& pluginHandle, EapQtConfig &config); + + bool deleteConfiguration(); + +private: + + void loadPlugins(); + + bool fetchCertificates(QList* const caInfos, + QList* const clientInfos); + + void copyCertificateInfo(const RPointerArray* const certEntries, QList< + EapQtCertificateInfo>* const certInfos); + + void appendCertificateInfo(bool isCaCertificate, const EapQtCertificateInfo& certInfo, + RPointerArray* const certList); + + void appendEapTypes(const RArray* const eapTypes, + QList* const eapList); + + void getEapTypeIf(const EapQtPluginHandle& pluginHandle); + + void copyFromEapSettings(EAPSettings& eapSettings, EapQtConfig& config); + + void copyToEapSettings(EapQtConfig& config, EAPSettings& eapSettings); + + TBool convertToTbool(bool value); + bool convertToBool(TBool value); + + bool isUiSupported(const QByteArray &eapType, int &pluginIndex) const; + + void checkInstanceThrowing() const; + + bool setEapDbIndex(const int iapId); + bool setEapWlanDbIndex(const int iapId); + + void shutdown(); + + EapQtConfigInterface::EapBearerType getEapBearer(); + +private: + + Q_DISABLE_COPY(EapQtConfigInterfacePrivate) + + const bool mValidatorInstance; + + // list of available EAP UIs + QList mPlugins; + + // list of EAPs supported by UI + QList mPluginInfos; + + // list of supported outer EAP methods, + // combination of UI and EAP server support + QList mSupportedOuterTypes; + + // list of supported inner EAP methods queried last time, + // combination of UI and EAP server support + QList mSupportedInnerTypes; + EapQtPluginHandle mLastOuterHandle; + + QScopedPointer mTranslator; + +private: + + QScopedPointer mEapGsIf; + QScopedPointer mEapTypeIf; + + int mIapId; + TIndexType mEapBearer; + TInt mEapDbIndex; + bool mEapDbIndexValid; + TEapExpandedType mCurrentServerEapType; + + // EAP server lists of its supported outer EAP methods + RArray mOuterEapsOn; + RArray mOuterEapsOff; + +}; + +/*! @} */ + +#endif +