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 UI for username-password based EAP method configuration |
|
16 * |
|
17 */ |
|
18 |
|
19 /* |
|
20 * %version: 21 % |
|
21 */ |
|
22 |
|
23 #ifndef CPEAPUSERPASSWORDUI_H |
|
24 #define CPEAPUSERPASSWORDUI_H |
|
25 |
|
26 // System includes |
|
27 #include <cpbasesettingview.h> |
|
28 #include <eapqtplugininfo.h> |
|
29 #include <eapqtpluginhandle.h> |
|
30 #include <eapqtconfiginterface.h> |
|
31 |
|
32 // User includes |
|
33 |
|
34 // Forward declarations |
|
35 class HbDataForm; |
|
36 class HbDataFormModel; |
|
37 class HbDataFormModelItem; |
|
38 class CpSettingFormItemData; |
|
39 class HbLineEdit; |
|
40 class EapQtValidator; |
|
41 |
|
42 // External data types |
|
43 |
|
44 // Constants |
|
45 |
|
46 /*! |
|
47 * @addtogroup group_eap_ui_plugin_userpassword |
|
48 * @{ |
|
49 */ |
|
50 |
|
51 class CpEapUserPasswordUi : public CpBaseSettingView |
|
52 { |
|
53 Q_OBJECT |
|
54 |
|
55 public: |
|
56 CpEapUserPasswordUi( |
|
57 const EapQtConfigInterface::EapBearerType bearer, |
|
58 const int iapId, |
|
59 const EapQtPluginInfo &plugin, |
|
60 const EapQtPluginHandle& outerHandle); |
|
61 ~CpEapUserPasswordUi(); |
|
62 |
|
63 protected: |
|
64 bool eventFilter(QObject *obj, QEvent *event); |
|
65 void close(); |
|
66 |
|
67 private: |
|
68 void createUi(); |
|
69 void createUsername(); |
|
70 void createPassword(); |
|
71 |
|
72 bool checkStateToBool(const int state); |
|
73 int boolToCheckState(const bool state); |
|
74 |
|
75 bool storeSettings(); |
|
76 bool validate(); |
|
77 bool validateUsername(); |
|
78 bool validatePasswordGroup(); |
|
79 |
|
80 private slots: |
|
81 void setValidator(const QModelIndex); |
|
82 void passwordPromptChanged(int state); |
|
83 void passwordChanged(); |
|
84 |
|
85 private: |
|
86 //! Pointer to EapQtConfigInterface |
|
87 QScopedPointer <EapQtConfigInterface> mConfigIf; |
|
88 //! Plugin info |
|
89 EapQtPluginInfo mPluginInfo; |
|
90 //! Outer handle |
|
91 EapQtPluginHandle mOuterHandle; |
|
92 //! Current EAP configuration |
|
93 EapQtConfig mEapConfig; |
|
94 |
|
95 //! Dataform |
|
96 HbDataForm *mForm; |
|
97 //! Datform model |
|
98 HbDataFormModel *mModel; |
|
99 //! Control Panel item data helper for username-password plugins |
|
100 CpItemDataHelper *mItemDataHelper; |
|
101 //! Username-password settings group |
|
102 HbDataFormModelItem *mGroupItem; |
|
103 //! Username lineEdit |
|
104 CpSettingFormItemData *mUsername; |
|
105 //! Prompt password checkBox |
|
106 CpSettingFormItemData *mPasswordPrompt; |
|
107 //! Password lineEdit |
|
108 CpSettingFormItemData *mPassword; |
|
109 |
|
110 //! Realm validator |
|
111 QScopedPointer<EapQtValidator> mValidatorUsername; |
|
112 //! Password validator |
|
113 QScopedPointer<EapQtValidator> mValidatorPassword; |
|
114 |
|
115 //! Password is stored |
|
116 bool mPasswordStored; |
|
117 //! Password is saved |
|
118 bool mPasswordChanged; |
|
119 //! Password lineEdit |
|
120 HbLineEdit *mPasswordEdit; |
|
121 |
|
122 }; |
|
123 |
|
124 /*! @} */ |
|
125 |
|
126 #endif |
|