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