26
|
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 |
*
|
34
|
14 |
* Description: Eap Dialog Plugin implementation
|
26
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
34
|
18 |
/*
|
36
|
19 |
* %version: 9 %
|
34
|
20 |
*/
|
26
|
21 |
|
36
|
22 |
// System includes
|
26
|
23 |
#include <hbdevicedialoginterface.h>
|
|
24 |
#include <QVariantMap>
|
36
|
25 |
|
|
26 |
// User includes
|
26
|
27 |
#include "eapdialogplugin.h"
|
|
28 |
#include "eapusernamepwddialog.h"
|
34
|
29 |
#include "eapquerydialog.h"
|
|
30 |
#include "eappasswordquerydialog.h"
|
|
31 |
#include "eapfastinstallpacquerydialog.h"
|
|
32 |
#include "eapfastpacstorepwquerydialog.h"
|
|
33 |
#include "eapfastpacfilepwquerydialog.h"
|
|
34 |
#include "eapfastcreatemasterkeyquerydialog.h"
|
|
35 |
#include "eapfastprovwaitnotedialog.h"
|
|
36 |
#include "eapmschapv2pwdexpirednotedialog.h"
|
|
37 |
#include "eapmschapv2oldpwddialog.h"
|
|
38 |
#include "eapmschapv2newpwddialog.h"
|
|
39 |
#include "eapfastprovnotsuccessnotedialog.h"
|
26
|
40 |
#include "OstTraceDefinitions.h"
|
|
41 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
42 |
#endif
|
|
43 |
|
36
|
44 |
/*!
|
|
45 |
* \class EapDialogPlugin
|
|
46 |
* \brief Implements Eap Dialog Plugin.
|
|
47 |
*/
|
|
48 |
|
|
49 |
// External function prototypes
|
26
|
50 |
|
|
51 |
Q_EXPORT_PLUGIN2(eapdialogplugin, EapDialogPlugin)
|
|
52 |
|
36
|
53 |
// Local constants
|
26
|
54 |
|
36
|
55 |
//! This plugin implements several device dialog types
|
26
|
56 |
static const struct {
|
|
57 |
const char *mTypeString;
|
|
58 |
} dialogInfos[] = {
|
|
59 |
{"com.nokia.eap.usernamepassworddialog/1.0"},
|
|
60 |
{"com.nokia.eap.querydialog/1.0"},
|
|
61 |
{"com.nokia.eap.passwordquerydialog/1.0"},
|
|
62 |
{"com.nokia.eap.fastinstallpacquerydialog/1.0"},
|
|
63 |
{"com.nokia.eap.fastpacstorepwquerydialog/1.0"},
|
|
64 |
{"com.nokia.eap.fastcreatemasterkeyquerydialog/1.0"},
|
|
65 |
{"com.nokia.eap.fastpacfilepwquerydialog/1.0"},
|
|
66 |
{"com.nokia.eap.fastprovwaitnotedialog/1.0"},
|
|
67 |
{"com.nokia.eap.mschapv2passwordexpirednotedialog/1.0"},
|
|
68 |
{"com.nokia.eap.mschapv2oldpassworddialog/1.0"},
|
|
69 |
{"com.nokia.eap.mschapv2newpassworddialog/1.0"},
|
|
70 |
{"com.nokia.eap.fastshowprovnotsuccessnotedialog/1.0"}
|
|
71 |
};
|
|
72 |
|
36
|
73 |
// ======== LOCAL FUNCTIONS ========
|
|
74 |
|
|
75 |
// ======== MEMBER FUNCTIONS ========
|
|
76 |
|
|
77 |
/*!
|
|
78 |
* Constructor.
|
|
79 |
*/
|
26
|
80 |
EapDialogPlugin::EapDialogPlugin()
|
|
81 |
{
|
|
82 |
OstTraceFunctionEntry0( EAPDIALOGPLUGIN_EAPDIALOGPLUGIN_ENTRY );
|
|
83 |
qDebug("EapDialogPlugin::EapDialogPlugin");
|
|
84 |
|
|
85 |
OstTraceFunctionExit0( EAPDIALOGPLUGIN_EAPDIALOGPLUGIN_EXIT );
|
|
86 |
}
|
|
87 |
|
36
|
88 |
/*!
|
26
|
89 |
* Destructor
|
|
90 |
*/
|
|
91 |
EapDialogPlugin::~EapDialogPlugin()
|
|
92 |
{
|
|
93 |
OstTraceFunctionEntry0( DUP1_EAPDIALOGPLUGIN_DEAPDIALOGPLUGIN_ENTRY );
|
|
94 |
|
|
95 |
OstTraceFunctionExit0( EAPDIALOGPLUGIN_DEAPDIALOGPLUGIN_EXIT );
|
|
96 |
}
|
|
97 |
|
36
|
98 |
/*!
|
26
|
99 |
* Create device dialog widget
|
36
|
100 |
*
|
|
101 |
* @param [in] deviceDialogType Tells which Dialog to create
|
|
102 |
* @param [in] parameters Parameters for the Construction of the dialog.
|
|
103 |
* @return created dialog widget
|
26
|
104 |
*/
|
|
105 |
HbDeviceDialogInterface *EapDialogPlugin::createDeviceDialog(
|
|
106 |
const QString &deviceDialogType,
|
|
107 |
const QVariantMap ¶meters)
|
|
108 |
{
|
|
109 |
OstTraceFunctionEntry0( EAPDIALOGPLUGIN_CREATEDEVICEDIALOG_ENTRY );
|
|
110 |
qDebug("EapDialogPlugin::createDeviceDialog ENTER");
|
36
|
111 |
|
|
112 |
HbDeviceDialogInterface* dialog = NULL;
|
26
|
113 |
|
36
|
114 |
if ( deviceDialogType.compare(dialogInfos[0].mTypeString) == 0 )
|
26
|
115 |
{
|
|
116 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapUsernamePwdDialog");
|
36
|
117 |
dialog = new EapUsernamePwdDialog(parameters);
|
26
|
118 |
}
|
36
|
119 |
else if ( deviceDialogType.compare(dialogInfos[1].mTypeString) == 0 )
|
34
|
120 |
{
|
|
121 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapQueryDialog");
|
36
|
122 |
dialog = new EapQueryDialog(parameters);
|
34
|
123 |
}
|
36
|
124 |
else if ( deviceDialogType.compare(dialogInfos[2].mTypeString) == 0 )
|
34
|
125 |
{
|
|
126 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapPasswordQueryDialog");
|
36
|
127 |
dialog = new EapPasswordQueryDialog(parameters);
|
34
|
128 |
}
|
36
|
129 |
else if ( deviceDialogType.compare(dialogInfos[3].mTypeString) == 0 )
|
34
|
130 |
{
|
|
131 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapFastInstallPacQueryDialog");
|
36
|
132 |
dialog = new EapFastInstallPacQueryDialog(parameters);
|
34
|
133 |
}
|
36
|
134 |
else if ( deviceDialogType.compare(dialogInfos[4].mTypeString) == 0 )
|
34
|
135 |
{
|
|
136 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapFastPacStorePwQueryDialog");
|
36
|
137 |
dialog = new EapFastPacStorePwQueryDialog(parameters);
|
34
|
138 |
}
|
36
|
139 |
else if ( deviceDialogType.compare(dialogInfos[5].mTypeString) == 0 )
|
34
|
140 |
{
|
|
141 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapFastCreateMasterKeyQueryDialog");
|
36
|
142 |
dialog = new EapFastCreateMasterKeyQueryDialog(parameters);
|
34
|
143 |
}
|
36
|
144 |
else if ( deviceDialogType.compare(dialogInfos[6].mTypeString) == 0 )
|
26
|
145 |
{
|
34
|
146 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapFastPacFilePwQueryDialog");
|
36
|
147 |
dialog = new EapFastPacFilePwQueryDialog(parameters);
|
34
|
148 |
}
|
36
|
149 |
else if ( deviceDialogType.compare(dialogInfos[7].mTypeString) == 0 )
|
34
|
150 |
{
|
|
151 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapFastProvWaitNoteDialog");
|
36
|
152 |
dialog = new EapFastProvWaitNoteDialog(parameters);
|
34
|
153 |
}
|
36
|
154 |
else if ( deviceDialogType.compare(dialogInfos[8].mTypeString) == 0 )
|
34
|
155 |
{
|
|
156 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapMschapv2PwdExpNoteDialog");
|
36
|
157 |
dialog = new EapMschapv2PwdExpNoteDialog(parameters);
|
34
|
158 |
}
|
36
|
159 |
else if ( deviceDialogType.compare(dialogInfos[9].mTypeString) == 0 )
|
34
|
160 |
{
|
|
161 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapMschapv2OldPwdDialog");
|
36
|
162 |
dialog = new EapMschapv2OldPwdDialog(parameters);
|
34
|
163 |
}
|
36
|
164 |
else if ( deviceDialogType.compare(dialogInfos[10].mTypeString) == 0 )
|
34
|
165 |
{
|
|
166 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapMschapv2NewPwdDialog");
|
36
|
167 |
dialog = new EapMschapv2NewPwdDialog(parameters);
|
34
|
168 |
}
|
36
|
169 |
else if ( deviceDialogType.compare(dialogInfos[11].mTypeString) == 0 )
|
34
|
170 |
{
|
|
171 |
qDebug("EapDialogPlugin::createDeviceDialog: new EapFastProvNotSuccessNoteDialog");
|
36
|
172 |
dialog = new EapFastProvNotSuccessNoteDialog(parameters);
|
34
|
173 |
}
|
26
|
174 |
OstTraceFunctionExit0( EAPDIALOGPLUGIN_CREATEDEVICEDIALOG_EXIT );
|
|
175 |
qDebug("EapDialogPlugin::createDeviceDialog EXIT");
|
|
176 |
|
36
|
177 |
return dialog;
|
26
|
178 |
}
|
|
179 |
|
36
|
180 |
/*!
|
|
181 |
* Check if client is allowed to use device dialog widget. For the meantime
|
|
182 |
* this plugin doesn't perform operations that may compromise security.
|
|
183 |
* All clients are allowed to use.
|
|
184 |
*
|
|
185 |
* @param [in] deviceDialogType Tells which Dialog type
|
|
186 |
* @param [in] parameters Device dialog parameters
|
|
187 |
* @param [in] securityInfo Information for Security check
|
|
188 |
* @return returns always true
|
|
189 |
*/
|
26
|
190 |
bool EapDialogPlugin::accessAllowed(const QString &deviceDialogType,
|
|
191 |
const QVariantMap ¶meters, const QVariantMap &securityInfo) const
|
|
192 |
{
|
|
193 |
OstTraceFunctionEntry0( EAPDIALOGPLUGIN_ACCESSALLOWED_ENTRY );
|
|
194 |
|
|
195 |
Q_UNUSED(deviceDialogType)
|
|
196 |
Q_UNUSED(parameters)
|
|
197 |
Q_UNUSED(securityInfo)
|
|
198 |
|
|
199 |
return true;
|
|
200 |
}
|
|
201 |
|
36
|
202 |
/*!
|
26
|
203 |
* Return information of device dialog the plugin creates
|
36
|
204 |
*
|
|
205 |
* @param [in] deviceDialogType Tells which Dialog type
|
|
206 |
* @param [in] parameters Device dialog parameters
|
|
207 |
* @param [in,out] info Structure the plugin fills with an information
|
|
208 |
* @return returns always true
|
26
|
209 |
*/
|
|
210 |
bool EapDialogPlugin::deviceDialogInfo(const QString &deviceDialogType,
|
|
211 |
const QVariantMap ¶meters, DeviceDialogInfo *info) const
|
|
212 |
{
|
|
213 |
OstTraceFunctionEntry0( EAPDIALOGPLUGIN_DEVICEDIALOGINFO_ENTRY );
|
|
214 |
qDebug("EapDialogPlugin::deviceDialogInfo");
|
|
215 |
|
|
216 |
Q_UNUSED(parameters)
|
|
217 |
Q_UNUSED(deviceDialogType)
|
|
218 |
|
|
219 |
info->group = GenericDeviceDialogGroup;
|
|
220 |
info->flags = NoDeviceDialogFlags;
|
|
221 |
info->priority = DefaultPriority;
|
|
222 |
|
|
223 |
OstTraceFunctionExit0( EAPDIALOGPLUGIN_DEVICEDIALOGINFO_EXIT );
|
|
224 |
qDebug("EapDialogPlugin::deviceDialogInfo EXIT");
|
|
225 |
return true;
|
|
226 |
}
|
|
227 |
|
36
|
228 |
/*!
|
|
229 |
* Returns a list of device dialog types the plugin implements.
|
|
230 |
*
|
|
231 |
* @return returns device dialog types this plugin implements
|
26
|
232 |
*/
|
|
233 |
QStringList EapDialogPlugin::deviceDialogTypes() const
|
|
234 |
{
|
|
235 |
OstTraceFunctionEntry0( EAPDIALOGPLUGIN_DEVICEDIALOGTYPES_ENTRY );
|
|
236 |
qDebug("EapDialogPlugin::deviceDialogTypes");
|
|
237 |
|
|
238 |
QStringList types;
|
|
239 |
const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]);
|
|
240 |
for(int i = 0; i < numTypes; i++) {
|
|
241 |
types.append(dialogInfos[i].mTypeString);
|
|
242 |
}
|
|
243 |
|
|
244 |
OstTraceFunctionExit0( EAPDIALOGPLUGIN_DEVICEDIALOGTYPES_EXIT );
|
|
245 |
return types;
|
|
246 |
}
|
|
247 |
|
36
|
248 |
/*!
|
26
|
249 |
* Return plugin flags
|
36
|
250 |
*
|
|
251 |
* @return returns plugin flags
|
26
|
252 |
*/
|
|
253 |
EapDialogPlugin::PluginFlags EapDialogPlugin::pluginFlags() const
|
|
254 |
{
|
|
255 |
OstTraceFunctionEntry0( EAPDIALOGPLUGIN_PLUGINFLAGS_ENTRY );
|
|
256 |
OstTraceFunctionExit0( EAPDIALOGPLUGIN_PLUGINFLAGS_EXIT );
|
|
257 |
return NoPluginFlags;
|
|
258 |
}
|
|
259 |
|
36
|
260 |
/*!
|
26
|
261 |
* The last error is not stored, not supported
|
36
|
262 |
*
|
|
263 |
* @return returns always 0
|
26
|
264 |
*/
|
|
265 |
int EapDialogPlugin::error() const
|
|
266 |
{
|
|
267 |
OstTraceFunctionEntry0( EAPDIALOGPLUGIN_ERROR_ENTRY );
|
|
268 |
OstTraceFunctionExit0( EAPDIALOGPLUGIN_ERROR_EXIT );
|
|
269 |
return 0;
|
|
270 |
}
|
|
271 |
|