1
/***************************************************************************
3
* knetworkmanager-devicestore_dbus.h - A NetworkManager frontend for KDE
5
* Copyright (C) 2005, 2006 Novell, Inc.
7
* Author: Helmut Schaa <hschaa@suse.de>, <Helmut.Schaa@gmx.de>
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
**************************************************************************/
25
#ifndef KNETWORKMANAGER_CONNECTION_SETTING_WIRELESS_SECURITY_WIDGET_H
26
#define KNETWORKMANAGER_CONNECTION_SETTING_WIRELESS_SECURITY_WIDGET_H
28
/* qt autogenerated headers */
29
#include "connection_setting_wireless_security.h"
30
#include "connection_setting_wireless_security_eap.h"
31
#include "connection_setting_wireless_security_phase2.h"
32
#include "connection_setting_wireless_security_wep.h"
33
#include "connection_setting_wireless_security_wpaversion.h"
34
#include "connection_setting_wireless_security_wpacipher.h"
35
#include "connection_setting_wireless_security_wpapsk.h"
36
#include "connection_setting_wireless_security_wepencryption.h"
38
/* knetworkmanager headers */
39
#include "knetworkmanager-connection_setting.h"
40
#include "knetworkmanager-connection_setting_8021x.h"
41
#include "knetworkmanager-connection_setting_widget_interface.h"
43
namespace ConnectionSettings
45
/* class declarations */
46
class WirelessSecurity;
49
class WirelessSecurityPhase2Impl;
51
class WirelessSecurityWEPImpl : public ConnectionSettingWirelessSecurityWEP
59
, WEPKEY_TYPE_PASSPHRASE
62
WirelessSecurityWEPImpl(WirelessSecurity* security, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
63
QCString getHashedWEPKey(QString key, WEPKEY_TYPE type) const;
64
QCString getWEP128PassphraseHash(QCString input) const;
65
QCString String2Hex(QByteArray bytes, int final_len) const;
68
void slotAuthAlgChanged(int);
69
void slotKeyTypeChanged(int);
70
void slotWepKey0Changed(const QString&);
71
void slotWepKey1Changed(const QString&);
72
void slotWepKey2Changed(const QString&);
73
void slotWepKey3Changed(const QString&);
74
void slotWepIdx0Checked(bool);
75
void slotWepIdx1Checked(bool);
76
void slotWepIdx2Checked(bool);
77
void slotWepIdx3Checked(bool);
79
WirelessSecurity* _security_setting;
80
WEPKEY_TYPE _wepKeyType;
83
class WirelessSecurityWEPEncryptionImpl : public ConnectionSettingWirelessSecurityWEPEncryption
87
WirelessSecurityWEPEncryptionImpl(WirelessSecurity* security_setting, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
89
WirelessSecurity* _security_setting;
92
class WirelessSecurityWPAVersionImpl : public ConnectionSettingWirelessSecurityWPAVersion
96
WirelessSecurityWPAVersionImpl(WirelessSecurity* security_setting, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
104
WirelessSecurity* _security_setting;
108
class WirelessSecurityWPACipherImpl : public ConnectionSettingWirelessSecurityWPACipher
120
WirelessSecurityWPACipherImpl(WirelessSecurity* security_setting, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
123
void slotCipherChangedAuto(bool);
124
void slotGroupCipherChangedTKIP(bool);
125
void slotGroupCipherChangedCCMP(bool);
126
void slotGroupCipherChangedWEP40(bool);
127
void slotGroupCipherChangedWEP104(bool);
128
void slotPairwiseCipherChangedTKIP(bool);
129
void slotPairwiseCipherChangedCCMP(bool);
132
WirelessSecurity* _security_setting;
135
class WirelessSecurityWPAPSKImpl : public ConnectionSettingWirelessSecurityWPAPSK
139
WirelessSecurityWPAPSKImpl(WirelessSecurity* security_setting, Wireless* wireless_setting, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
140
QCString String2Hex(QByteArray bytes, int final_len) const;
143
void slotPSKChanged(const QString&);
146
WirelessSecurity* _security_setting;
147
Wireless* _wireless_setting;
150
class WirelessSecurityEAPImpl : public ConnectionSettingWirelessSecurityEAP
154
WirelessSecurityEAPImpl(IEEE8021x* security_setting, WirelessSecurityPhase2Impl* phase2_widget, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
157
void slotMethodChanged(int index);
158
void slotIdentityChanged(const QString&);
159
void slotAnonIdentityChanged(const QString&);
160
void slotPasswordChanged(const QString&);
163
IEEE8021x* _security_setting;
164
QBiDirectionalMap<int, IEEE8021x::EAP_PHASE1> _eapIndexMap;
165
WirelessSecurityPhase2Impl* _phase2_widget;
168
class WirelessSecurityPhase2Impl : public ConnectionSettingWirelessSecurityPhase2
172
WirelessSecurityPhase2Impl(IEEE8021x* security_setting, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
174
void setAllowedPhase2Methods(const QValueList<IEEE8021x::EAP_PHASE2>&);
175
void slotPhase2MethodChanged(int index);
177
void updateMethodComboBox();
179
IEEE8021x* _security_setting;
180
QBiDirectionalMap<int, IEEE8021x::EAP_PHASE2> _eapIndexMap;
181
QValueList<IEEE8021x::EAP_PHASE2> _allowed_methods;
184
class WirelessSecurityWidgetImpl : public WidgetInterface
198
WirelessSecurityWidgetImpl(Connection*, bool new_conn, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
202
void slotComboSecurityActivated(int);
203
void slotUseEncryptionToggled(bool);
204
void slotExtraSettingsToggled(bool);
210
void comboSecurityInit();
211
void configureWidgets(SecurityMethods);
212
void configureForWEP();
213
void configureForWPAPSK();
214
void configureForWPAEAP();
215
void configureForIEEE8021X();
217
SecurityMethods _currentMethod;
218
QValueList<QWidget*> _widgets[SECURITY_COUNT];
219
QValueList<QWidget*> _extra_widgets[SECURITY_COUNT];
220
WirelessSecurity* _security_setting;
221
Wireless* _wireless_setting;
222
IEEE8021x* _ieee8021x_setting;
223
ConnectionSettingWirelessSecurityWidget* _mainWid;
225
QMap<int, SecurityMethods> _securityComboMap;
229
#endif /* KNETWORKMANAGER_CONNECTION_SETTING_WIRELESS_SECURITY_WIDGET_H*/