1 /* |
|
2 * Copyright (c) 2002-2005 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: CPsetNetwork selects network and gets network information. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef PSETNETWORK_H |
|
21 #define PSETNETWORK_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "mpsetnetworkselect.h" |
|
25 #include "mpsetnetworkinfoobs.h" |
|
26 #include "mpsetnetworkmodeobs.h" |
|
27 #include "mpsetnetworkmode.h" |
|
28 #include <etelmm.h> |
|
29 #include <rmmcustomapi.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CPsetSAObserver; |
|
33 class CRetrieveMobilePhoneDetectedNetworks; |
|
34 class RMmCustomAPI; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 /** |
|
38 * CPsetNetwork class is used to handle network change requests. |
|
39 * @lib phonesettings.lib |
|
40 * @since 1.0 |
|
41 */ |
|
42 class CPsetNetwork : public CActive, |
|
43 public MPsetNetworkSelect, |
|
44 public MPsetNetworkMode |
|
45 { |
|
46 public: // constructor & destructor |
|
47 |
|
48 /** |
|
49 * Symbian OS 2-phase constructor. |
|
50 * |
|
51 * @param aPhone TSY's phone object. |
|
52 * @param aObserver Reference to network observer. |
|
53 * @return Returns the CPsetNetwork-object |
|
54 */ |
|
55 /***************************************************** |
|
56 * Series 60 Customer / ETel |
|
57 * Series 60 ETel API |
|
58 *****************************************************/ |
|
59 IMPORT_C static CPsetNetwork* NewL( RMobilePhone& aPhone, |
|
60 MPsetNetworkInfoObserver& aObserver ); |
|
61 |
|
62 /** |
|
63 * Symbian OS 2-phase constructor. |
|
64 * |
|
65 * @param aPhone TSY's phone object. |
|
66 * @param aObserver Reference to network observer. |
|
67 * @return Returns the CPsetNetwork-object |
|
68 */ |
|
69 /***************************************************** |
|
70 * Series 60 Customer / ETel |
|
71 * Series 60 ETel API |
|
72 *****************************************************/ |
|
73 IMPORT_C static CPsetNetwork* NewL( RMobilePhone& aPhone, |
|
74 MPsetNetworkModeObserver& aObserver ); |
|
75 |
|
76 |
|
77 /* Destructor */ |
|
78 IMPORT_C ~CPsetNetwork(); |
|
79 |
|
80 public: // from base class MNetworkSelect |
|
81 |
|
82 /** |
|
83 * @see MNetworkSelect::GetAvailableNetworksL |
|
84 */ |
|
85 IMPORT_C void GetAvailableNetworksL(); |
|
86 |
|
87 /** |
|
88 * @see MNetworkSelect::GetCurrentNetworkInfo |
|
89 */ |
|
90 IMPORT_C TInt GetCurrentNetworkInfo( |
|
91 TCurrentNetworkInfo& aInfo ); |
|
92 |
|
93 /** |
|
94 * @see MNetworkSelect::GetNetworkSelectMode |
|
95 */ |
|
96 IMPORT_C TInt GetNetworkSelectMode( TSelectMode& aMode ); |
|
97 |
|
98 /** |
|
99 * @see MNetworkSelect::SelectNetworkL |
|
100 */ |
|
101 IMPORT_C void SelectNetworkL( const TNetworkInfo& aInfo ); |
|
102 |
|
103 /** |
|
104 * @see MNetworkSelect::CancelProcess |
|
105 */ |
|
106 IMPORT_C void CancelProcess(); |
|
107 |
|
108 public: // From base class MPsetNetworkMode |
|
109 |
|
110 /** |
|
111 * @see MPsetNetworkMode::SetNetworkModeSelectionL |
|
112 * @since 2.6 |
|
113 */ |
|
114 IMPORT_C void SetNetworkModeSelectionL( TUint32& aNetworkMode ); |
|
115 |
|
116 /** |
|
117 * @see MPsetNetworkMode::GetCurrentNetworkModeSelectionL |
|
118 * @since 2.6 |
|
119 */ |
|
120 IMPORT_C void GetCurrentNetworkModeSelectionL(); |
|
121 |
|
122 public: //new |
|
123 |
|
124 /** |
|
125 * Checks if there is a call going on. |
|
126 * |
|
127 * @return Returns a non-zero if there is a call active, or error. |
|
128 */ |
|
129 IMPORT_C TInt IsCallActive(); |
|
130 |
|
131 /** |
|
132 * Checks if there is a gprs connection active. |
|
133 * @return KErrNone, or error code. |
|
134 */ |
|
135 IMPORT_C TInt IsGPRSConnected(); |
|
136 |
|
137 /* |
|
138 * Calls ETEL to start reseting the network. |
|
139 * @return Error code, or KErrNone. |
|
140 */ |
|
141 IMPORT_C TInt ResetNetworkSearch(); |
|
142 |
|
143 /* |
|
144 * Sets observer (Observer starts to listen again if reset). |
|
145 * @param aObserver Value to set into observer. |
|
146 */ |
|
147 IMPORT_C void SetNetSAObserver( MPsetNetworkInfoObserver& aObserver ); |
|
148 |
|
149 /* |
|
150 * Sets Network mode observer |
|
151 * @param aObserver Value to set into Network mode observer. |
|
152 */ |
|
153 IMPORT_C void SetNetworkModeObserver( MPsetNetworkModeObserver& |
|
154 aObserver ); |
|
155 |
|
156 private: // from base class CActive |
|
157 |
|
158 void RunL(); |
|
159 |
|
160 void DoCancel(); |
|
161 |
|
162 private: // constructors |
|
163 |
|
164 void ConstructL( MPsetNetworkInfoObserver& aObserver ); |
|
165 |
|
166 // this is required for the net container to create a pointer |
|
167 void ConstructL( MPsetNetworkModeObserver& aObserver ); |
|
168 |
|
169 /***************************************************** |
|
170 * Series 60 Customer / ETel |
|
171 * Series 60 ETel API |
|
172 *****************************************************/ |
|
173 CPsetNetwork( RMobilePhone& aPhone ); |
|
174 |
|
175 private: //new |
|
176 |
|
177 void GetRegistrationStatusL(); |
|
178 |
|
179 void HideRequestNoteL(); |
|
180 |
|
181 void CleanupLeavePushL(); |
|
182 |
|
183 void HandleLeave(); |
|
184 |
|
185 static void DoHandleLeave( TAny* aAny ); |
|
186 |
|
187 void ClearParams(); |
|
188 |
|
189 private: |
|
190 //Latest network settings information |
|
191 TNetworkInfo iTempNetInfo; |
|
192 //Provides client access to mobile phone functionality provided by TSY. |
|
193 /***************************************************** |
|
194 * Series 60 Customer / ETel |
|
195 * Series 60 ETel API |
|
196 *****************************************************/ |
|
197 RMobilePhone& iPhone; |
|
198 //Currently active request. |
|
199 MPsetNetworkInfoObserver::TServiceRequest iServiceRequest; |
|
200 //Observer |
|
201 CPsetSAObserver* iSAObserver; |
|
202 //Network information observer |
|
203 MPsetNetworkInfoObserver* iObserver; |
|
204 //Fetched network information (names, IDs) |
|
205 /***************************************************** |
|
206 * Series 60 Customer / ETel |
|
207 * Series 60 ETel API |
|
208 *****************************************************/ |
|
209 CRetrieveMobilePhoneDetectedNetworks* iNetworkRetrieve; |
|
210 //Current registartion status |
|
211 /***************************************************** |
|
212 * Series 60 Customer / ETel |
|
213 * Series 60 ETel API |
|
214 *****************************************************/ |
|
215 RMobilePhone::TMobilePhoneRegistrationStatus iRegStatus; |
|
216 |
|
217 /***************************************************** |
|
218 * Series 60 Customer / ETel |
|
219 * Series 60 ETel API |
|
220 *****************************************************/ |
|
221 //Selected network information |
|
222 RMobilePhone::TMobilePhoneNetworkManualSelection iNwInfo; |
|
223 |
|
224 // |
|
225 // Network Mode related variables |
|
226 // |
|
227 //Network mode observer |
|
228 MPsetNetworkModeObserver* iNetworkModeObserver; |
|
229 |
|
230 /***************************************************** |
|
231 * Series 60 Customer / ETel |
|
232 * Series 60 ETel API |
|
233 *****************************************************/ |
|
234 // Custom phone. |
|
235 RMmCustomAPI iCustomPhone; |
|
236 |
|
237 //Currently active request. |
|
238 MPsetNetworkModeObserver::TServiceRequest iModeRequest; |
|
239 |
|
240 //Current Network Mode |
|
241 TUint32 iNetworkModeCaps; |
|
242 |
|
243 //Currently active observer, for assert handling |
|
244 TInt iActiveObserver; |
|
245 }; |
|
246 #endif // PSETNETWORK_H |
|
247 // end of file |
|