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