1 /* |
|
2 * Copyright (c) 2006 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: Network Settings model. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GSNETWORKPLUGINMODEL_H |
|
20 #define GSNETWORKPLUGINMODEL_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32property.h> |
|
24 #include <centralrepository.h> |
|
25 #include <PsetCSP.h> |
|
26 #include <MPsetNetworkModeObs.h> |
|
27 #include <PsetNetwork.h> |
|
28 |
|
29 #include "GSNetworkPluginContainer.h" |
|
30 #include "GsNetworkPlugin.hrh" |
|
31 |
|
32 // CONSTANTS |
|
33 |
|
34 const TUint32 KGSNetworkModeCapsNotUpdated = KMaxTUint32; |
|
35 |
|
36 // Used only for debugging. Init value for network mode debug strings. |
|
37 const TInt KGSNetworkModeDebugStrLen = 50; |
|
38 |
|
39 |
|
40 // Panic codes for used in this compilation unit |
|
41 enum TGSTelPluginModelPanicCodes |
|
42 { |
|
43 EGSTelPluinModelPanicNullPtr = 1 |
|
44 }; |
|
45 // MACROS |
|
46 |
|
47 // DATA TYPES |
|
48 |
|
49 // FUNCTION PROTOTYPES |
|
50 |
|
51 // FORWARD DECLARATIONS |
|
52 class MPsetNetworkModeObserver; |
|
53 class CPsetContainer; |
|
54 class CGSNetworkPluginContainer; |
|
55 class CGSNetworkPlugin; |
|
56 |
|
57 // CLASS DEFINITION |
|
58 /** |
|
59 * CGSNetworkPluginModel is the model class of GS network plugin. |
|
60 * It provides functions to get and set setting values. |
|
61 * @lib GSNetworkPlugin.lib |
|
62 * @since Series 60_3.1 |
|
63 |
|
64 */ |
|
65 class CGSNetworkPluginModel : public CBase, |
|
66 private MPsetNetworkModeObserver |
|
67 { |
|
68 public: // Constructor and destructor |
|
69 |
|
70 /** |
|
71 * Overloaded constructor meant to be used from container |
|
72 */ |
|
73 static CGSNetworkPluginModel* NewL( |
|
74 CGSNetworkPluginContainer* aContainer, |
|
75 CGSNetworkPlugin* aPlugin ); |
|
76 |
|
77 /** |
|
78 * Destructor |
|
79 */ |
|
80 ~CGSNetworkPluginModel(); |
|
81 |
|
82 public: // new ones |
|
83 /** |
|
84 * Gets CSP status |
|
85 * |
|
86 * @return ETrue: CSP is set |
|
87 * EFalse: CSP is not set |
|
88 */ |
|
89 TBool GetCSPStatus(); |
|
90 |
|
91 /** |
|
92 * Sets CSP Active |
|
93 * @param aValue TBool |
|
94 * @return ETrue: CSP is set |
|
95 * EFalse: CSP is not set |
|
96 */ |
|
97 void SetCSPActiveL( TBool aValue ); |
|
98 |
|
99 /** |
|
100 * Get the network mode status from Shared data. This value is used |
|
101 * to display/hide the "network mode UI" list item under network |
|
102 * folder. Currently, this value is ONLY read and not written. |
|
103 * @return ETrue if the value is 1 in SD. |
|
104 */ |
|
105 TBool IsNetworkModeVisible(); |
|
106 |
|
107 /** |
|
108 * Returns if CSP setting is supported |
|
109 * @param aSettingNumber TInt |
|
110 * @return ETrue: CSP is supported |
|
111 * EFalse: CSP is not supported |
|
112 */ |
|
113 TBool IsSettingSupported( TInt aSettingNumber ); |
|
114 |
|
115 /* |
|
116 * Returns MCN value from shared data. |
|
117 * @param aId value of shared data key |
|
118 * @return ETrue: no errors |
|
119 * EFalse: an error has occurred |
|
120 */ |
|
121 TBool GetMCNSettingValue( TInt& aId ); |
|
122 |
|
123 /* |
|
124 * Sets MCN value to shared data. |
|
125 * @param aId value of shared data key |
|
126 * @return ETrue: no errors |
|
127 * EFalse: an error has occurred |
|
128 */ |
|
129 TBool SetMCNSettingValue( TInt& aId ); |
|
130 |
|
131 /* |
|
132 * Gets the supported network mode list from shared data. |
|
133 * @return the bit-masked value from shared data |
|
134 */ |
|
135 TInt GetSupportedNetworksL(); |
|
136 |
|
137 /** |
|
138 * Check if graphical network list is supported. |
|
139 * This is handled using GS local variation |
|
140 * @return ETrue if supported. |
|
141 */ |
|
142 TBool GraphicalNetworkListSupportedL(); |
|
143 |
|
144 /** |
|
145 * Return local variation value for automatic network search |
|
146 * support. Local key = EGSConfigNoAutoToAutoNetworkSearch |
|
147 * See GeneralSettingsVariant.hrh for details |
|
148 * @return local variation value |
|
149 */ |
|
150 TBool AutomaticNetworkSearchSupportedL(); |
|
151 |
|
152 |
|
153 /** |
|
154 * Creates phone settings engine. |
|
155 * @param aContainer Container object as reference |
|
156 */ |
|
157 void CreatePhoneSettingsEngineL(); |
|
158 |
|
159 /** |
|
160 * StartAsynGetCurrentNetworkModeSelectionL |
|
161 */ |
|
162 void StartAsynGetCurrentNetworkModeSelectionL(); |
|
163 |
|
164 /** |
|
165 * GetNetworkSelectionMode |
|
166 */ |
|
167 MPsetNetworkSelect::TSelectMode GetNetworkSelectionMode(); |
|
168 |
|
169 /** |
|
170 * See iNetworkMode. |
|
171 * @return TUint32 Current network mode value, RMmCustomAPI::KCapsNetworkModeUmts etc... |
|
172 */ |
|
173 TUint32 GetNetworkMode(); |
|
174 |
|
175 /** |
|
176 * SetNetworkModeL |
|
177 */ |
|
178 void SetNetworkModeL( TUint32 aNetworkMode ); |
|
179 |
|
180 /** |
|
181 * Prints model state to debug output in case of debug build. |
|
182 */ |
|
183 void PrintState(); |
|
184 |
|
185 /** |
|
186 * Used only in debug mode: verifies network state with the UI selection. |
|
187 * For debugging purposes only. |
|
188 */ |
|
189 void CheckState( TGSNetworkModeItems aMode ); |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 TBool IsCallActive(); |
|
195 |
|
196 private: // Private constructors |
|
197 |
|
198 /** |
|
199 * Default C++ contructor |
|
200 */ |
|
201 CGSNetworkPluginModel( CGSNetworkPluginContainer* aContainer, |
|
202 CGSNetworkPlugin* aPlugin ); |
|
203 |
|
204 /** |
|
205 * Symbian OS default constructor |
|
206 * @return void |
|
207 */ |
|
208 void ConstructL(); |
|
209 |
|
210 void ConstructBaseItemsL(); |
|
211 |
|
212 /** |
|
213 * Initialize CenRep keys used in this class |
|
214 */ |
|
215 void InitializeCentralRepositoryL(); |
|
216 |
|
217 /** |
|
218 * Un-initialize CenRep keys used in this class |
|
219 */ |
|
220 void UninitializeCentralRepository(); |
|
221 |
|
222 private: // from base class MPsetNetworkModeObserver |
|
223 |
|
224 /** |
|
225 * @@see MPsetNetworkModeObserver::HandleNetworkSystemModeEventsL. |
|
226 * @since 2.6 |
|
227 */ |
|
228 void HandleNetworkSystemModeEventsL( |
|
229 const MPsetNetworkModeObserver::TServiceRequest aRequest, |
|
230 const TUint32 aNetworkModeCaps ); |
|
231 |
|
232 |
|
233 /** |
|
234 * @@see MPsetNetworkModeObserver::HandleNetworkErrorL. |
|
235 * @since 2.6 |
|
236 */ |
|
237 void HandleNetworkErrorL( |
|
238 const MPsetNetworkModeObserver::TServiceRequest aRequest, |
|
239 const TInt aError ); |
|
240 |
|
241 private: |
|
242 // Central repository objects |
|
243 CRepository* iNetworkRepository; |
|
244 CRepository* iGSVariationRepository; |
|
245 CPsetCustomerServiceProfile* iCSP; //check if CSP is active |
|
246 TInt iLocalVariationValues; //local variated constants |
|
247 |
|
248 // PhoneSettings engine object for network mode |
|
249 CPsetNetwork* iPhoneSettingsEngine; |
|
250 CPsetContainer* iSettingsContainer; |
|
251 |
|
252 // Current network mode value from RMmCustomAPI::TNetworkModeCaps. |
|
253 // enum RMmCustomAPI::TNetworkModeCaps |
|
254 // { |
|
255 // KkNetworkModeGsm = 0x01, |
|
256 // KCapsNetworkModeUmts = 0x02, |
|
257 // KCapsNetworkModeDual = 0x04 |
|
258 // }; |
|
259 // and in addition: KGSNetworkModeCapsNotUpdated |
|
260 // |
|
261 // Stores value aNetworkModeCaps from: |
|
262 // MPsetNetworkModeObserver::HandleNetworkSystemModeEventsL(..., TUint32 aNetworkModeCaps ) |
|
263 // |
|
264 TUint32 iNetworkMode; |
|
265 |
|
266 // Temporarily value of the requested network mode. Stores requested |
|
267 // mode which is updated to iNetworkMode in case request succeeds and |
|
268 // HandleNetworkSystemModeEventsL is called. |
|
269 TUint32 iRequestedNetworkMode; |
|
270 |
|
271 // Pointer for communicating with container. Not owned. |
|
272 CGSNetworkPluginContainer* iContainer; |
|
273 |
|
274 // Reference to network plugin. Not owned. |
|
275 CGSNetworkPlugin* iPlugin; |
|
276 }; |
|
277 |
|
278 #endif //GSNETWORKPLUGINMODEL_H |
|
279 |
|
280 // End of File |
|