|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * EAP method configuration QT interface private implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 /* |
|
20 * %version: 29 % |
|
21 */ |
|
22 |
|
23 #ifndef EAPQTCONFIGINTERFACEPRIVATE_H |
|
24 #define EAPQTCONFIGINTERFACEPRIVATE_H |
|
25 |
|
26 #include <qglobal.h> |
|
27 #include <EapSettings.h> |
|
28 #include <EapTypeDefinitions.h> |
|
29 #include <eapqtconfig.h> |
|
30 #include <eapqtpluginhandle.h> |
|
31 #include <eapqtconfiginterface.h> |
|
32 |
|
33 /*! |
|
34 * @addtogroup group_eap_config_if_impl |
|
35 * @{ |
|
36 */ |
|
37 class HbTranslator; |
|
38 class CEapType; |
|
39 class CEapGeneralSettings; |
|
40 class CpEapPluginInterface; |
|
41 class EapQtConfigInterface; |
|
42 |
|
43 class EapQtConfigInterfacePrivate |
|
44 { |
|
45 public: |
|
46 |
|
47 // maximum lenghts (number of characters) for UTF-16 strings copied to EAP settings |
|
48 static const unsigned int StringMaxLength = KGeneralStringMaxLength; |
|
49 static const unsigned int CertLabelMaxLength = KMaxCertLabelLength; |
|
50 static const unsigned int CertThumbprintMaxLength = KThumbprintMaxLength; |
|
51 static const unsigned int CertSubjectKeyIdLength = KSHA1HashLengthBytes; |
|
52 |
|
53 public: |
|
54 |
|
55 // the constructor can only be used for validators |
|
56 // any other call trows an exception |
|
57 EapQtConfigInterfacePrivate(); |
|
58 |
|
59 // this is the constructor for using the interface for accessing settings etc. |
|
60 // if iapId is negative, it must be later set to correct value with setConfigurationReference |
|
61 // to be able to use the methods: |
|
62 // - selectedOuterTypes |
|
63 // - readConfiguration |
|
64 // - saveConfiguration |
|
65 // - deleteConfiguration |
|
66 // - uiInstance |
|
67 // other methods are usable with negative iapId |
|
68 EapQtConfigInterfacePrivate(const EapQtConfigInterface::EapBearerType bearerType, |
|
69 const int iapId); |
|
70 |
|
71 ~EapQtConfigInterfacePrivate(); |
|
72 |
|
73 QList<EapQtPluginInfo> supportedOuterTypes(); |
|
74 QList<EapQtPluginInfo> supportedInnerTypes(const EapQtPluginHandle &outerType); |
|
75 |
|
76 bool isSupportedOuterType(const EapQtPluginHandle& handle); |
|
77 bool isSupportedInnerType(const EapQtPluginHandle& outerHandle, |
|
78 const EapQtPluginHandle& innerHandle); |
|
79 |
|
80 QList<EapQtCertificateInfo> certificateAuthorityCertificates(); |
|
81 QList<EapQtCertificateInfo> userCertificates(); |
|
82 |
|
83 EapQtValidator *validatorEap(EapQtExpandedEapType type, EapQtConfig::SettingsId id); |
|
84 |
|
85 CpBaseSettingView *uiInstance(const EapQtPluginHandle& outerHandle, |
|
86 const EapQtPluginHandle& pluginHandle); |
|
87 |
|
88 // if iapId was negative in the constructor, this method must be called before |
|
89 // calling the following methods |
|
90 bool setConfigurationReference(const int iapId); |
|
91 |
|
92 QList<EapQtPluginHandle> selectedOuterTypes(); |
|
93 bool setSelectedOuterTypes(const QList<EapQtPluginHandle>& outerHandles); |
|
94 |
|
95 bool readConfiguration(const EapQtPluginHandle& outerHandle, |
|
96 const EapQtPluginHandle& pluginHandle, EapQtConfig &config); |
|
97 bool saveConfiguration(const EapQtPluginHandle& pluginHandle, EapQtConfig &config); |
|
98 |
|
99 bool deleteConfiguration(); |
|
100 |
|
101 private: |
|
102 |
|
103 void loadPlugins(); |
|
104 |
|
105 bool fetchCertificates(QList<EapQtCertificateInfo>* const caInfos, |
|
106 QList<EapQtCertificateInfo>* const clientInfos); |
|
107 |
|
108 void copyCertificateInfo(const RPointerArray<EapCertificateEntry>* const certEntries, QList< |
|
109 EapQtCertificateInfo>* const certInfos); |
|
110 |
|
111 void appendCertificateInfo(bool isCaCertificate, const EapQtCertificateInfo& certInfo, |
|
112 RPointerArray<EapCertificateEntry>* const certList); |
|
113 |
|
114 void appendEapTypes(const RArray<TEapExpandedType>* const eapTypes, |
|
115 QList<QByteArray>* const eapList); |
|
116 |
|
117 void getEapTypeIf(const EapQtPluginHandle& pluginHandle); |
|
118 |
|
119 void copyFromEapSettings(EAPSettings& eapSettings, EapQtConfig& config); |
|
120 |
|
121 void copyToEapSettings(EapQtConfig& config, EAPSettings& eapSettings); |
|
122 |
|
123 TBool convertToTbool(bool value); |
|
124 bool convertToBool(TBool value); |
|
125 |
|
126 bool isUiSupported(const QByteArray &eapType, int &pluginIndex) const; |
|
127 |
|
128 void checkInstanceThrowing() const; |
|
129 |
|
130 bool setEapDbIndex(const int iapId); |
|
131 bool setEapWlanDbIndex(const int iapId); |
|
132 |
|
133 void shutdown(); |
|
134 |
|
135 EapQtConfigInterface::EapBearerType getEapBearer(); |
|
136 |
|
137 private: |
|
138 |
|
139 Q_DISABLE_COPY(EapQtConfigInterfacePrivate) |
|
140 |
|
141 const bool mValidatorInstance; |
|
142 |
|
143 // list of available EAP UIs |
|
144 QList<CpEapPluginInterface*> mPlugins; |
|
145 |
|
146 // list of EAPs supported by UI |
|
147 QList<EapQtPluginInfo> mPluginInfos; |
|
148 |
|
149 // list of supported outer EAP methods, |
|
150 // combination of UI and EAP server support |
|
151 QList<EapQtPluginInfo> mSupportedOuterTypes; |
|
152 |
|
153 // list of supported inner EAP methods queried last time, |
|
154 // combination of UI and EAP server support |
|
155 QList<EapQtPluginInfo> mSupportedInnerTypes; |
|
156 EapQtPluginHandle mLastOuterHandle; |
|
157 |
|
158 QScopedPointer<HbTranslator> mTranslator; |
|
159 |
|
160 private: |
|
161 |
|
162 QScopedPointer<CEapGeneralSettings> mEapGsIf; |
|
163 QScopedPointer<CEapType> mEapTypeIf; |
|
164 |
|
165 int mIapId; |
|
166 TIndexType mEapBearer; |
|
167 TInt mEapDbIndex; |
|
168 bool mEapDbIndexValid; |
|
169 TEapExpandedType mCurrentServerEapType; |
|
170 |
|
171 // EAP server lists of its supported outer EAP methods |
|
172 RArray<TEapExpandedType> mOuterEapsOn; |
|
173 RArray<TEapExpandedType> mOuterEapsOff; |
|
174 |
|
175 }; |
|
176 |
|
177 /*! @} */ |
|
178 |
|
179 #endif |
|
180 |