|
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 * Control Panel QT plugin for TLS-based EAP methods configuration |
|
16 * |
|
17 */ |
|
18 |
|
19 /* |
|
20 * %version: 7 % |
|
21 */ |
|
22 |
|
23 // System includes |
|
24 #include <eapqtpluginhandle.h> |
|
25 |
|
26 // User includes |
|
27 #include "cpeaptlsmethodsplugin.h" |
|
28 #include "cpeaptlsmethodsui.h" |
|
29 #include "eapuidefs.h" |
|
30 |
|
31 /*! |
|
32 * \class CpEapTlsMethodsPlugin |
|
33 * \brief Control Panel QT plugin for TLS-based EAP methods configuration. |
|
34 */ |
|
35 |
|
36 // External function prototypes |
|
37 |
|
38 // Local constants |
|
39 |
|
40 Q_EXPORT_PLUGIN2(CpEapTlsMethodsPlugin, CpEapTlsMethodsPlugin); |
|
41 |
|
42 // ======== LOCAL FUNCTIONS ======== |
|
43 |
|
44 // ======== MEMBER FUNCTIONS ======== |
|
45 |
|
46 /*! |
|
47 * Constructor. |
|
48 */ |
|
49 CpEapTlsMethodsPlugin::CpEapTlsMethodsPlugin() : |
|
50 mBearer(EapQtConfigInterface::EapBearerTypeWlan), |
|
51 mIapId(EapQtConfigInterface::IapIdUndefined) |
|
52 { |
|
53 // Nothing to be done |
|
54 |
|
55 qDebug("CpEapTlsMethodsPlugin created"); |
|
56 } |
|
57 |
|
58 /*! |
|
59 * Destructor. |
|
60 */ |
|
61 CpEapTlsMethodsPlugin::~CpEapTlsMethodsPlugin() |
|
62 { |
|
63 // Nothing to be done |
|
64 // UI instances are owned and deallocated by CP framework |
|
65 |
|
66 qDebug("CpEapTlsMethodsPlugin destroyed"); |
|
67 } |
|
68 |
|
69 /*! |
|
70 * See CpEapPluginInterface::setSettingsReference() |
|
71 * |
|
72 * @param bearer Bearer of the accessed settings |
|
73 * @param iapId ID of the accessed IAP |
|
74 */ |
|
75 void CpEapTlsMethodsPlugin::setSettingsReference(const EapQtConfigInterface::EapBearerType bearer, |
|
76 const int iapId) |
|
77 { |
|
78 mBearer = bearer; |
|
79 mIapId = iapId; |
|
80 } |
|
81 |
|
82 /*! |
|
83 * See CpEapPluginInterface::pluginInfo() |
|
84 * |
|
85 * @return Plugin info |
|
86 */ |
|
87 QList<EapQtPluginInfo> CpEapTlsMethodsPlugin::pluginInfo() |
|
88 { |
|
89 qDebug("CpEapTlsMethodsPlugin: provide plugin info"); |
|
90 QList<EapQtPluginInfo> ret; |
|
91 |
|
92 ret.append(EapQtPluginInfo( |
|
93 EapQtPluginHandle::PluginEapTtls, |
|
94 EapQtUiConstants::StringEapTtls, |
|
95 EapQtUiConstants::OrderEapTtls) ); |
|
96 |
|
97 ret.append(EapQtPluginInfo( |
|
98 EapQtPluginHandle::PluginPeap, |
|
99 EapQtUiConstants::StringPeap, |
|
100 EapQtUiConstants::OrderPeap) ); |
|
101 |
|
102 ret.append(EapQtPluginInfo( |
|
103 EapQtPluginHandle::PluginEapTls, |
|
104 EapQtUiConstants::StringEapTls, |
|
105 EapQtUiConstants::OrderEapTls) ); |
|
106 |
|
107 return ret; |
|
108 } |
|
109 |
|
110 /*! |
|
111 * See CpEapPluginInterface::uiInstance() |
|
112 * |
|
113 * Creates UI instance |
|
114 * |
|
115 * @param outerHandle Plugin handle to outer EAP type. |
|
116 * @param plugin Plugin info |
|
117 * |
|
118 * @return TLS methods UI instance |
|
119 */ |
|
120 CpBaseSettingView* CpEapTlsMethodsPlugin::uiInstance( |
|
121 const EapQtPluginHandle& outerHandle, |
|
122 const EapQtPluginInfo &plugin) |
|
123 { |
|
124 |
|
125 Q_ASSERT(mIapId != EapQtConfigInterface::IapIdUndefined); |
|
126 |
|
127 qDebug("CpEapTlsMethodsPlugin: create UI instance"); |
|
128 return new CpEapTlsMethodsUi(mBearer, mIapId, plugin, outerHandle); |
|
129 } |