|
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 the License "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 |
|
19 #ifndef NETWORKOBSERVER_H |
|
20 #define NETWORKOBSERVER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <etel3rdparty.h> |
|
25 #include <npscript.h> |
|
26 #include "SystemInfoObserver.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CSystemInfoPlugin; |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 // State enum and member variable |
|
34 |
|
35 // CLASS DECLARATIONS |
|
36 /** |
|
37 * CNetworkObserver. |
|
38 * Interface to information about the radio network connection. |
|
39 * @lib npSystemInfoPlugin.lib |
|
40 * @since S60 v3.2 |
|
41 */ |
|
42 NONSHARABLE_CLASS(CNetworkObserver) : public CBase, public MSystemInfoObserverClient |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 */ |
|
49 static CNetworkObserver* NewL( CSystemInfoPlugin* aPlugin ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CNetworkObserver(); |
|
55 |
|
56 public: |
|
57 enum TIdNetworkItem |
|
58 { |
|
59 EIdSignalStrength, |
|
60 EIdRegistrationStatus, |
|
61 EIdNetworkInfo |
|
62 }; |
|
63 |
|
64 /** |
|
65 * Request network values change notification. |
|
66 * @since 3.2 |
|
67 * @param name of the callback, transfer ownership |
|
68 * @return void |
|
69 */ |
|
70 void RequestNotificationL( TIdNetworkItem aId, HBufC8* aFunctionName ); |
|
71 |
|
72 public: |
|
73 |
|
74 /** |
|
75 * Called to get current network signal bars. |
|
76 * @since 3.2 |
|
77 * @param void |
|
78 * @return signal bars |
|
79 */ |
|
80 TInt SignalBars() const; |
|
81 |
|
82 /** |
|
83 * Called to get current network registration status. |
|
84 * @since 3.2 |
|
85 * @param void |
|
86 * @return network registration status |
|
87 */ |
|
88 TInt RegistrationStatus() const; |
|
89 |
|
90 /** |
|
91 * Called to get current network name |
|
92 * @since 3.2 |
|
93 * @param void |
|
94 * @return network name |
|
95 */ |
|
96 const TDesC& NetworkName() const; |
|
97 |
|
98 public: |
|
99 // from MSystemInfoObserverClient |
|
100 virtual void SubscribeL( TInt aId, TRequestStatus& aStatus ); |
|
101 virtual void UpdateL( TInt aId ); |
|
102 virtual void Cancel( TInt aId ); |
|
103 virtual void Close( TInt aId ); |
|
104 |
|
105 private: |
|
106 /** |
|
107 * C++ default constructor. |
|
108 */ |
|
109 CNetworkObserver( CSystemInfoPlugin* aPlugin ); |
|
110 |
|
111 /** |
|
112 * By default Symbian 2nd phase constructor is private. |
|
113 * @param none |
|
114 * @return void |
|
115 */ |
|
116 void ConstructL(); |
|
117 |
|
118 protected: |
|
119 CSystemInfoPlugin* iSystemInfoPlugin; // not owned |
|
120 CTelephony* iTelephony; // owned |
|
121 CTelephony* iTelephony2; // owned |
|
122 CTelephony* iTelephony3; // owned |
|
123 |
|
124 // signal |
|
125 CTelephony::TSignalStrengthV1Pckg iSignalPckg; |
|
126 CTelephony::TSignalStrengthV1 iSignal; |
|
127 CSystemInfoObserver* iSignalObserver; // owned |
|
128 TInt iSignalStarted; |
|
129 |
|
130 // registration status |
|
131 CTelephony::TNetworkRegistrationV1Pckg iRegistrationStatusPckg; |
|
132 CTelephony::TNetworkRegistrationV1 iRegistrationStatus; |
|
133 CSystemInfoObserver* iRegistrationStatusObserver; // owned |
|
134 HBufC8* iRegistrationStatusChangedFunction; // owned |
|
135 TInt iRegistrationStatusStarted; |
|
136 |
|
137 // network info (includes name) |
|
138 CTelephony::TNetworkInfoV2Pckg iNetworkInfoPckg; |
|
139 CTelephony::TNetworkInfoV2 iNetworkInfo; |
|
140 CSystemInfoObserver* iNetworkInfoObserver; // owned |
|
141 TInt iNetworkInfoStarted; |
|
142 }; |
|
143 |
|
144 #endif // NETWORKOBSERVER_H |
|
145 |
|
146 // End of File |