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 WLAN AP advanced settings view header file. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CPWLANAPADVANCEDVIEW_H |
|
20 #define CPWLANAPADVANCEDVIEW_H |
|
21 |
|
22 // System includes |
|
23 #include <QAbstractSocket> |
|
24 #include <HbMessageBox> |
|
25 #include <cpbasesettingview.h> |
|
26 #include <cmmanagerdefines_shim.h> |
|
27 |
|
28 // User includes |
|
29 |
|
30 // Forward declarations |
|
31 class HbDataForm; |
|
32 class HbDataFormModel; |
|
33 class HbDataFormModelItem; |
|
34 class HbValidator; |
|
35 class CmConnectionMethodShim; |
|
36 |
|
37 // External data types |
|
38 |
|
39 // Constants |
|
40 |
|
41 // Class declaration |
|
42 class CpWlanApAdvancedView : public CpBaseSettingView |
|
43 { |
|
44 Q_OBJECT |
|
45 |
|
46 public: |
|
47 CpWlanApAdvancedView( |
|
48 CmConnectionMethodShim *cmConnectionMethod, |
|
49 QGraphicsItem *parent = 0); |
|
50 ~CpWlanApAdvancedView(); |
|
51 |
|
52 signals: |
|
53 |
|
54 public slots: |
|
55 |
|
56 protected: |
|
57 |
|
58 protected slots: |
|
59 |
|
60 private: |
|
61 Q_DISABLE_COPY(CpWlanApAdvancedView) |
|
62 |
|
63 //! IPv6 DNS type |
|
64 enum Ipv6DnsType { |
|
65 Ipv6DnsTypeAutomatic = 0, |
|
66 Ipv6DnsTypeWellKnown, |
|
67 Ipv6DnsTypeUserDefined |
|
68 }; |
|
69 |
|
70 void createAdvancedSettings(); |
|
71 void createIpv4Group(); |
|
72 void updateIpv4Group(); |
|
73 void createIpv6Group(); |
|
74 void updateIpv6Group(); |
|
75 void createProxyGroup(); |
|
76 void updateProxyGroup(); |
|
77 QString getIpAddress(CMManagerShim::ConnectionMethodAttribute attribute); |
|
78 Ipv6DnsType getIpv6DnsType(); |
|
79 void enableIpv4AddressFields(int state); |
|
80 void enableIpv4DnsFields(int state); |
|
81 void enableIpv6DnsFields(int selectionIndex); |
|
82 bool validateAndSaveIpAddress( |
|
83 HbDataFormModelItem *item, |
|
84 CMManagerShim::ConnectionMethodAttribute attribute, |
|
85 QAbstractSocket::NetworkLayerProtocol protocol); |
|
86 void showMessageBox( |
|
87 HbMessageBox::MessageBoxType type, |
|
88 const QString &text); |
|
89 bool tryUpdate(); |
|
90 void handleUpdateError(); |
|
91 |
|
92 private slots: |
|
93 void setEditorPreferences(const QModelIndex index); |
|
94 void changeIpv4AddressMode(int state); |
|
95 void changeIpv4Address(); |
|
96 void changeIpv4SubnetMask(); |
|
97 void changeIpv4Gateway(); |
|
98 void changeIpv4DnsMode(int state); |
|
99 void changeIpv4PrimaryDnsAddress(); |
|
100 void changeIpv4SecondaryDnsAddress(); |
|
101 void changeIpv6DnsMode(int selectionIndex); |
|
102 void changeIpv6PrimaryDnsAddress(); |
|
103 void changeIpv6SecondaryDnsAddress(); |
|
104 void changeProxyServer(); |
|
105 void changeProxyPort(); |
|
106 |
|
107 private: // data |
|
108 //! Dataform |
|
109 HbDataForm *mForm; |
|
110 //! Dataform model |
|
111 HbDataFormModel *mModel; |
|
112 //! Connection Settings Shim connection method pointer |
|
113 CmConnectionMethodShim *mCmConnectionMethod; |
|
114 //! "IPv4 settings" group |
|
115 HbDataFormModelItem *mIpv4Group; |
|
116 //! "Automatic" setting item for phone IP address |
|
117 HbDataFormModelItem *mIpv4Automatic; |
|
118 //! "Phone IP address" setting item |
|
119 HbDataFormModelItem *mIpv4Address; |
|
120 //! "Subnet mask" setting item |
|
121 HbDataFormModelItem *mIpv4SubnetMask; |
|
122 //! "Default gateway" setting item |
|
123 HbDataFormModelItem *mIpv4Gateway; |
|
124 //! "Automatic" setting item for IPv4 DNS addresses |
|
125 HbDataFormModelItem *mIpv4DnsAutomatic; |
|
126 //! "Primary name server" setting item |
|
127 HbDataFormModelItem *mIpv4DnsAddress1; |
|
128 //! "Secondary name server" setting item |
|
129 HbDataFormModelItem *mIpv4DnsAddress2; |
|
130 //! "IPv6 settings" group |
|
131 HbDataFormModelItem *mIpv6Group; |
|
132 //! "Automatic" setting item for IPv6 DNS addresses |
|
133 HbDataFormModelItem *mIpv6DnsAutomatic; |
|
134 //! "Primary name server" setting item |
|
135 HbDataFormModelItem *mIpv6DnsAddress1; |
|
136 //! "Secondary name server" setting item |
|
137 HbDataFormModelItem *mIpv6DnsAddress2; |
|
138 //! "Proxy settings" group |
|
139 HbDataFormModelItem *mProxyGroup; |
|
140 //! "Proxy server address" setting item |
|
141 HbDataFormModelItem *mProxyServer; |
|
142 //! "Proxy port number" setting item |
|
143 HbDataFormModelItem *mProxyPort; |
|
144 //! Message box for info notes |
|
145 QSharedPointer<HbMessageBox> mMessageBox; |
|
146 //! Flag for IPv6 support |
|
147 bool mIpv6Supported; |
|
148 |
|
149 // Friend classes |
|
150 friend class TestCpWlanApPlugin; |
|
151 }; |
|
152 |
|
153 #endif // CPWLANAPADVANCEDVIEW_H |
|