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 "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: 36 % |
|
21 */ |
|
22 |
|
23 #ifndef EAPQTCONFIGINTERFACEPRIVATE_H |
|
24 #define EAPQTCONFIGINTERFACEPRIVATE_H |
|
25 |
|
26 // System includes |
|
27 #include <qglobal.h> |
|
28 #include <EapSettings.h> |
|
29 #include <EapTypeDefinitions.h> |
|
30 #include <eapqtconfig.h> |
|
31 #include <eapqtpluginhandle.h> |
|
32 #include <eapqtconfiginterface.h> |
|
33 #include <eapqtpacstoreconfig.h> |
|
34 |
|
35 // User includes |
|
36 |
|
37 // Forward declarations |
|
38 class HbTranslator; |
|
39 class CEapType; |
|
40 class CEapGeneralSettings; |
|
41 class CpEapPluginInterface; |
|
42 class EapQtConfigInterface; |
|
43 |
|
44 // External data types |
|
45 |
|
46 // Constants |
|
47 |
|
48 // Class declaration |
|
49 class EapQtConfigInterfacePrivate |
|
50 { |
|
51 |
|
52 public: |
|
53 |
|
54 // Data types |
|
55 |
|
56 // maximum lenghts (number of characters) for UTF-16 strings copied to EAP settings |
|
57 static const unsigned int StringMaxLength = KGeneralStringMaxLength; |
|
58 static const unsigned int CertLabelMaxLength = KMaxCertLabelLength; |
|
59 static const unsigned int CertThumbprintMaxLength = KThumbprintMaxLength; |
|
60 static const unsigned int CertSubjectKeyIdLength = KSHA1HashLengthBytes; |
|
61 |
|
62 // see eapqtinterface.h for documentation |
|
63 |
|
64 EapQtConfigInterfacePrivate(); |
|
65 |
|
66 EapQtConfigInterfacePrivate(const EapQtConfigInterface::EapBearerType bearerType, |
|
67 const int iapId); |
|
68 |
|
69 ~EapQtConfigInterfacePrivate(); |
|
70 |
|
71 QList<EapQtPluginInfo> supportedOuterTypes(); |
|
72 QList<EapQtPluginInfo> supportedInnerTypes(const EapQtPluginHandle &outerType); |
|
73 |
|
74 bool isSupportedOuterType(const EapQtPluginHandle &handle); |
|
75 bool isSupportedInnerType(const EapQtPluginHandle &outerHandle, |
|
76 const EapQtPluginHandle &innerHandle); |
|
77 |
|
78 QList<EapQtCertificateInfo> certificateAuthorityCertificates(); |
|
79 QList<EapQtCertificateInfo> userCertificates(); |
|
80 bool updateCertificates(); |
|
81 |
|
82 bool setConfigurationReference(const int iapId); |
|
83 |
|
84 QList<EapQtPluginHandle> selectedOuterTypes(); |
|
85 bool setSelectedOuterTypes(const QList<EapQtPluginHandle> &outerHandles); |
|
86 |
|
87 bool readConfiguration(const EapQtPluginHandle &outerHandle, |
|
88 const EapQtPluginHandle &pluginHandle, EapQtConfig &config); |
|
89 bool saveConfiguration(const EapQtPluginHandle &pluginHandle, const EapQtConfig &config); |
|
90 |
|
91 bool deleteConfiguration(); |
|
92 |
|
93 EapQtValidator *validatorEap(const EapQtExpandedEapType &type, const EapQtConfig::SettingsId id); |
|
94 |
|
95 CpBaseSettingView *uiInstance(const EapQtPluginHandle &outerHandle, |
|
96 const EapQtPluginHandle &pluginHandle); |
|
97 |
|
98 bool readPacStoreConfiguration(EapQtPacStoreConfig &config); |
|
99 bool savePacStoreConfiguration(const EapQtPacStoreConfig &config); |
|
100 EapQtValidator *validatorPacStore(const EapQtPacStoreConfig::PacStoreSettings id); |
|
101 |
|
102 private: |
|
103 |
|
104 // see cpp for documentation |
|
105 |
|
106 void loadPlugins(); |
|
107 |
|
108 bool fetchCertificates(QList<EapQtCertificateInfo>* const caInfos, |
|
109 QList<EapQtCertificateInfo>* const clientInfos); |
|
110 |
|
111 void copyCertificateInfo(const RPointerArray<EapCertificateEntry>* const certEntries, QList< |
|
112 EapQtCertificateInfo>* const certInfos); |
|
113 |
|
114 void appendCertificateInfo(bool isCaCertificate, const EapQtCertificateInfo &certInfo, |
|
115 RPointerArray<EapCertificateEntry>* const certList); |
|
116 |
|
117 void appendEapTypes(const RArray<TEapExpandedType>* const eapTypes, |
|
118 QList<QByteArray>* const eapList); |
|
119 |
|
120 void getEapTypeIf(const EapQtPluginHandle &pluginHandle); |
|
121 |
|
122 void copyFromEapSettings(EAPSettings &eapSettings, EapQtConfig &config); |
|
123 |
|
124 void copyToEapSettings(const EapQtConfig &config, EAPSettings &eapSettings); |
|
125 |
|
126 TBool convertToTbool(bool value); |
|
127 bool convertToBool(TBool value); |
|
128 |
|
129 bool isUiSupported(const QByteArray &eapType, int &pluginIndex) const; |
|
130 |
|
131 void checkInstanceThrowing() const; |
|
132 |
|
133 bool setEapDbIndex(const int iapId); |
|
134 bool setEapWlanDbIndex(const int iapId); |
|
135 |
|
136 void shutdown(); |
|
137 |
|
138 EapQtConfigInterface::EapBearerType getEapBearer(); |
|
139 |
|
140 // comparison mehtod for qSort |
|
141 // must be static for using via function pointers |
|
142 static bool pluginLessThan(const EapQtPluginInfo &plugin1, const EapQtPluginInfo &plugin2); |
|
143 |
|
144 Q_DISABLE_COPY(EapQtConfigInterfacePrivate) |
|
145 |
|
146 private: // data |
|
147 |
|
148 /// QT members |
|
149 |
|
150 // is current instance for validators only |
|
151 const bool mValidatorInstance; |
|
152 |
|
153 // list of available EAP UIs |
|
154 QList<CpEapPluginInterface*> mPlugins; |
|
155 |
|
156 // list of EAPs supported by UI |
|
157 QList<EapQtPluginInfo> mPluginInfos; |
|
158 |
|
159 // list of supported outer EAP methods, |
|
160 // combination of UI and EAP server support |
|
161 QList<EapQtPluginInfo> mSupportedOuterTypes; |
|
162 |
|
163 // list of supported inner EAP methods queried last time, |
|
164 // combination of UI and EAP server support |
|
165 QList<EapQtPluginInfo> mSupportedInnerTypes; |
|
166 |
|
167 // currenly loaded outer EAP type |
|
168 EapQtPluginHandle mLastOuterHandle; |
|
169 |
|
170 // translator object for EAP UIs |
|
171 QScopedPointer<HbTranslator> mTranslator; |
|
172 |
|
173 // read CA and user certificates |
|
174 QList<EapQtCertificateInfo> mCaCertificates; |
|
175 QList<EapQtCertificateInfo> mUserCertificates; |
|
176 |
|
177 /// Symbian members |
|
178 |
|
179 // pointers to EAP server interfaces |
|
180 QScopedPointer<CEapGeneralSettings> mEapGsIf; |
|
181 QScopedPointer<CEapType> mEapTypeIf; |
|
182 |
|
183 // current IAP ID |
|
184 int mIapId; |
|
185 |
|
186 // current bearer |
|
187 TIndexType mEapBearer; |
|
188 |
|
189 // current EAP database reference to current IAP |
|
190 TInt mEapDbIndex; |
|
191 |
|
192 // if mEapDbIndex is valid (i.e. current IAP is not |
|
193 // EapQtConfigInterface::IapIdUndefined) |
|
194 bool mEapDbIndexValid; |
|
195 |
|
196 // current loaded EAP server type interface |
|
197 TEapExpandedType mCurrentServerEapType; |
|
198 |
|
199 // EAP server lists of its supported outer EAP methods |
|
200 RArray<TEapExpandedType> mOuterEapsOn; |
|
201 RArray<TEapExpandedType> mOuterEapsOff; |
|
202 |
|
203 }; |
|
204 |
|
205 #endif // EAPQTCONFIGINTERFACEPRIVATE_H |
|