|
1 /* |
|
2 * Copyright (c) 2005-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: Header file for CFMRadioMobileNetworkInfoListener. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef FMRADIOMOBILENETWORKINFOLISTENER_H |
|
20 #define FMRADIOMOBILENETWORKINFOLISTENER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <etelmm.h> |
|
24 |
|
25 |
|
26 const TInt KFMRadioCREmulatorCountryCodeLength = 3; |
|
27 namespace CommsDat { class CCDIAPRecord; } |
|
28 |
|
29 class MFMRadioNetworkChangeObserver; |
|
30 /** |
|
31 * Listens changes in network ID and country code. |
|
32 * |
|
33 * @ingroup Utils |
|
34 */ |
|
35 NONSHARABLE_CLASS(CFMRadioMobileNetworkInfoListener) : public CActive |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Creates a new mobile network info listener. |
|
41 * @return The newly created mobile network info listener. |
|
42 */ |
|
43 static CFMRadioMobileNetworkInfoListener* NewL( |
|
44 MFMRadioNetworkChangeObserver & aObserver); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CFMRadioMobileNetworkInfoListener(); |
|
50 |
|
51 /** |
|
52 * Return current combined network ID and country code as TInt. |
|
53 * @return An integer composed of the current network ID and country code. |
|
54 */ |
|
55 TInt CompoundNetworkId() const; |
|
56 |
|
57 /** |
|
58 * Returns current country code. |
|
59 * @return The current country code. |
|
60 */ |
|
61 const TDesC& CountryCode() const; |
|
62 |
|
63 /** |
|
64 * SubscriberId |
|
65 * @return subscriber id |
|
66 */ |
|
67 const TDesC& SubscriberId() const; |
|
68 |
|
69 private: |
|
70 |
|
71 /** |
|
72 * Constructor. |
|
73 */ |
|
74 CFMRadioMobileNetworkInfoListener(MFMRadioNetworkChangeObserver & aObserver); |
|
75 |
|
76 /** |
|
77 * By default Symbian 2nd phase constructor is private. |
|
78 */ |
|
79 void ConstructL(); |
|
80 |
|
81 /** |
|
82 * Saves fetched network info to local variables. |
|
83 */ |
|
84 void SaveNetworkInfo(); |
|
85 |
|
86 #ifdef __WINS__ |
|
87 /** |
|
88 * Gets network info from Central Repository. |
|
89 */ |
|
90 void GetCenRepNetworkInfoL(); |
|
91 #endif |
|
92 |
|
93 // from base class CActive |
|
94 void RunL(); |
|
95 void DoCancel(); |
|
96 |
|
97 private: // Data |
|
98 |
|
99 /** interface to report a condition when network id has changed */ |
|
100 MFMRadioNetworkChangeObserver & iNetworkChangeObserver; |
|
101 #ifdef __WINS__ |
|
102 /** Central repository */ |
|
103 CRepository* iRepository; |
|
104 /** Network info from repository */ |
|
105 HBufC* iEmulatorNetworkInfo; |
|
106 #else |
|
107 /** Telephony server. */ |
|
108 RTelServer iTelServer; |
|
109 /** Mobile phone. */ |
|
110 RMobilePhone iPhone; |
|
111 /** Network info of mobile phone. */ |
|
112 RMobilePhone::TMobilePhoneNetworkInfoV1 iNetworkInfo; |
|
113 /** Location of mobile phone. */ |
|
114 RMobilePhone::TMobilePhoneLocationAreaV1 iLocation; |
|
115 /** Packaged network info object. */ |
|
116 RMobilePhone::TMobilePhoneNetworkInfoV1Pckg iNetworkInfoPckg; |
|
117 #endif |
|
118 /** Current network ID. */ |
|
119 RMobilePhone::TMobilePhoneNetworkIdentity iNetworkId; |
|
120 /** Current country code. */ |
|
121 RMobilePhone::TMobilePhoneNetworkCountryCode iCountryCode; |
|
122 /** Combined network ID and country code. */ |
|
123 TInt iCompoundNetworkId; |
|
124 /** Previous known non-null combined country code */ |
|
125 TInt iPreviousCompoundNetworkId; |
|
126 /** Subsriber (IMSI code) id that has been picked up at the startup */ |
|
127 HBufC* iSubscriberId; |
|
128 }; |
|
129 |
|
130 #endif // FMRADIOMOBILENETWORKINFOLISTENER_H |