|
1 /* |
|
2 * Copyright (c) 2009 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 * |
|
16 */ |
|
17 |
|
18 #include <QtGlobal> |
|
19 #include "psetnetworkwrapper.h" |
|
20 #include "psetnetworkwrapper_p.h" |
|
21 #include "logging.h" |
|
22 |
|
23 /*! |
|
24 \class PSetNetworkWrapper |
|
25 \brief TODO: description |
|
26 */ |
|
27 |
|
28 /*! |
|
29 \enum PSetNetworkWrapper::ErrorCode |
|
30 |
|
31 This enumeration defines error codes used by PSetNetworkWrapper. |
|
32 */ |
|
33 /*! |
|
34 \var PSetNetworkWrapper::ErrNoError |
|
35 Indicates that no error has happened. |
|
36 */ |
|
37 |
|
38 // TODO: better commenting for NetworkAccessMode enumeration |
|
39 /*! |
|
40 \enum NetworkAccessMode |
|
41 This enumeration defines possible network access modes. |
|
42 */ |
|
43 /*! |
|
44 \var PSetNetworkWrapper::AccessModeDual |
|
45 Dual mode. |
|
46 */ |
|
47 /*! |
|
48 \var PSetNetworkWrapper::AccessModeUmts |
|
49 3g/UMTS network mode. |
|
50 */ |
|
51 /*! |
|
52 \var PSetNetworkWrapper::AccessModeGsm |
|
53 2g/GSM network mode. |
|
54 */ |
|
55 |
|
56 /*! |
|
57 \struct PSetNetworkWrapper::NetworkId |
|
58 NetworkId contains network and country identifiers. |
|
59 */ |
|
60 // TODO: is that valid way to document struct members |
|
61 /*! |
|
62 \var PSetNetworkWrapper::NetworkId::m_countryCode |
|
63 Country code. Maximum length is 4. |
|
64 */ |
|
65 /*! |
|
66 \var PSetNetworkWrapper::NetworkId::m_networkCode |
|
67 Network code. Maximum length is 8. |
|
68 */ |
|
69 |
|
70 /*! |
|
71 \enum PSetNetworkWrapper::NetworkSelectionMode |
|
72 Network selection mode. |
|
73 */ |
|
74 /*! |
|
75 \var PSetNetworkWrapper::SelectionModeManual |
|
76 Specific network is selected manually. |
|
77 */ |
|
78 /*! |
|
79 \var PSetNetworkWrapper::SelectionModeAutomatic |
|
80 Network is selected automatically without user interaction. |
|
81 */ |
|
82 |
|
83 /*! |
|
84 \enum PSetNetworkWrapper::NetworkStatus |
|
85 Status of a network. |
|
86 */ |
|
87 // TODO: enumerator comments |
|
88 /*! |
|
89 \var PSetNetworkWrapper::StatusUnknown |
|
90 */ |
|
91 /*! |
|
92 \var PSetNetworkWrapper::StatusAvailable |
|
93 */ |
|
94 /*! |
|
95 \var PSetNetworkWrapper::StatusCurrent |
|
96 */ |
|
97 /*! |
|
98 \var PSetNetworkWrapper::StatusForbidden |
|
99 */ |
|
100 |
|
101 /*! |
|
102 \enum PSetNetworkWrapper::NetworkAccessType |
|
103 Network access type. |
|
104 */ |
|
105 // TODO: enumerator comments |
|
106 /*! |
|
107 \var PSetNetworkWrapper::AccessTypeGsm |
|
108 */ |
|
109 /*! |
|
110 \var PSetNetworkWrapper::AccessTypeWcdma |
|
111 */ |
|
112 |
|
113 /*! |
|
114 \struct PSetNetworkWrapper::NetworkInfo |
|
115 Encapsulates information about network. |
|
116 */ |
|
117 // TODO: struct member commenting |
|
118 |
|
119 /*! void PSetNetworkWrapper::networkAccessModeGot( |
|
120 PSetNetworkWrapper::NetworkAccessMode mode) |
|
121 |
|
122 This signal is emitted when the current network access mode query has been |
|
123 completed. |
|
124 */ |
|
125 |
|
126 /*! |
|
127 PSetNetworkWrapper::PSetNetworkWrapper |
|
128 */ |
|
129 PSetNetworkWrapper::PSetNetworkWrapper( |
|
130 CPsetContainer &psetContainer, QObject *parent) |
|
131 : |
|
132 QObject(parent), |
|
133 m_privateImpl(new PSetNetworkWrapperPrivate(*this, psetContainer)) |
|
134 { |
|
135 DPRINT << ": IN"; |
|
136 |
|
137 DPRINT << ": OUT"; |
|
138 } |
|
139 |
|
140 /*! |
|
141 PSetNetworkWrapper::~PSetNetworkWrapper |
|
142 */ |
|
143 PSetNetworkWrapper::~PSetNetworkWrapper() |
|
144 { |
|
145 DPRINT << ": IN"; |
|
146 |
|
147 delete m_privateImpl; |
|
148 |
|
149 DPRINT << ": OUT"; |
|
150 } |
|
151 |
|
152 /*! |
|
153 Puts network retrieve results into array. |
|
154 */ |
|
155 void PSetNetworkWrapper::getAvailableNetworks() |
|
156 { |
|
157 DPRINT; |
|
158 |
|
159 m_privateImpl->getAvailableNetworks(); |
|
160 } |
|
161 |
|
162 /*! |
|
163 Returns current network selection mode. |
|
164 |
|
165 \param aMode Network selection mode. |
|
166 \return Error code. |
|
167 */ |
|
168 PSetNetworkWrapper::ErrorCode PSetNetworkWrapper::getNetworkSelectionMode( |
|
169 PSetNetworkWrapper::NetworkSelectionMode& mode) const |
|
170 { |
|
171 DPRINT; |
|
172 |
|
173 return m_privateImpl->getNetworkSelectionMode(mode); |
|
174 } |
|
175 |
|
176 /*! |
|
177 Selects network, also for selecting automatic/manual mode. |
|
178 \param aInfo Network information. |
|
179 */ |
|
180 void PSetNetworkWrapper::selectNetwork( |
|
181 const PSetNetworkWrapper::NetworkInfo& info) |
|
182 { |
|
183 DPRINT; |
|
184 |
|
185 m_privateImpl->selectNetwork(info); |
|
186 } |
|
187 |
|
188 /*! |
|
189 Cancels ongoing request if any. |
|
190 */ |
|
191 void PSetNetworkWrapper::cancelRequest() |
|
192 { |
|
193 DPRINT; |
|
194 |
|
195 m_privateImpl->cancelRequest(); |
|
196 } |
|
197 |
|
198 /*! |
|
199 Starts to query network access mode. Result is informed with a |
|
200 networkAccessModeGot() signal. |
|
201 */ |
|
202 void PSetNetworkWrapper::getNetworkAccessMode() const |
|
203 { |
|
204 DPRINT; |
|
205 |
|
206 m_privateImpl->getNetworkAccessMode(); |
|
207 } |
|
208 |
|
209 /*! |
|
210 Sets network access mode. |
|
211 \param mode Network access mode. |
|
212 \return ErrorCode. |
|
213 */ |
|
214 void PSetNetworkWrapper::setNetworkAccessMode( |
|
215 PSetNetworkWrapper::NetworkAccessMode mode) |
|
216 { |
|
217 DPRINT; |
|
218 |
|
219 m_privateImpl->setNetworkAccessMode(mode); |
|
220 } |
|
221 |
|
222 /*! |
|
223 Is manual network selection supported. |
|
224 */ |
|
225 bool PSetNetworkWrapper::isManualNetworkSelectionSupported() const |
|
226 { |
|
227 DPRINT; |
|
228 |
|
229 return m_privateImpl->isManualNetworkSelectionSupported(); |
|
230 } |
|
231 |
|
232 // End of File. |