|
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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_VCCGSMSIGNALLEVELHANDLER_H |
|
21 #define C_VCCGSMSIGNALLEVELHANDLER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <etel.h> |
|
25 |
|
26 #include "vccsignallevelhandler.h" |
|
27 #include "vccsignallevelobserver.h" |
|
28 #include "vccgsmnotifications.h" |
|
29 #include "vccunittesting.h" |
|
30 |
|
31 /** |
|
32 * VCC GSM signal level handler. |
|
33 * |
|
34 * @code |
|
35 * void CExampleClass::ConstructL() |
|
36 * { |
|
37 * //Scan time for low and high 5 sec, low strength -85, high -70 dBm |
|
38 * TSignalLevelParams params = { 5e6, 5e6, 85, 70 }; |
|
39 * |
|
40 * // |
|
41 * iGsmHandler = CVccGsmSignalLevelHandler::NewL( *this, params ); |
|
42 * } |
|
43 * |
|
44 * void CExampleClass::StartMonitoringL() |
|
45 * { |
|
46 * // Start monitoring gsm signal levels. |
|
47 * iGsmHandler->StartL(); |
|
48 * } |
|
49 * |
|
50 * void CExampleClass::StopMonitoringL() |
|
51 * { |
|
52 * // Stop monitoring. |
|
53 * iGsmHandler->StopL(); |
|
54 * } |
|
55 * |
|
56 * // Called when signal level changes. |
|
57 * void CExampleClass::SignalLevelL( |
|
58 * const CVccSignalLevelHandler* aHandlerInstance, |
|
59 * TInt32 aSignalStrength, |
|
60 * TSignalStrengthClass aClass ) |
|
61 * { |
|
62 * if ( iGsmHandler == aHandlerInstance ) |
|
63 * { |
|
64 * // GSM signal changed, do whatever is needed |
|
65 * MakeHandoverDecision( aSignalStrength, aClass ); |
|
66 * } |
|
67 * } |
|
68 * |
|
69 * |
|
70 * @endcode |
|
71 * |
|
72 * @lib vcchotrigger.dll |
|
73 * @since S60 v3.2 |
|
74 */ |
|
75 class CVccGsmSignalLevelHandler : public CVccSignalLevelHandler, |
|
76 public MVccGsmNotifications |
|
77 { |
|
78 public: |
|
79 |
|
80 /** |
|
81 * Two-phased constructor. |
|
82 * @param aObserver Observer of this signal handler |
|
83 * @param aParams Parameters for signal monitoring |
|
84 */ |
|
85 static CVccGsmSignalLevelHandler * NewL( MVccSignalLevelObserver & aObserver, |
|
86 const TSignalLevelParams& aParams ); |
|
87 |
|
88 /** |
|
89 * Two-phased constructor. |
|
90 * @param aObserver Observer of this signal handler |
|
91 * @param aParams Parameters for signal monitoring |
|
92 */ |
|
93 static CVccGsmSignalLevelHandler * NewLC( |
|
94 MVccSignalLevelObserver & aObserver, |
|
95 const TSignalLevelParams& aParams ); |
|
96 |
|
97 /** |
|
98 * Destructor. |
|
99 */ |
|
100 virtual ~CVccGsmSignalLevelHandler(); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * C++ constructor |
|
106 * @param aObserver Reference to signal level observer |
|
107 * @param aParams Reference to signal level parameters |
|
108 */ |
|
109 CVccGsmSignalLevelHandler( MVccSignalLevelObserver & aObserver, |
|
110 const TSignalLevelParams& aParams ); |
|
111 |
|
112 /** |
|
113 * Symbian second-phase constructor |
|
114 */ |
|
115 void ConstructL(); |
|
116 |
|
117 private: |
|
118 |
|
119 // from base class CVccSignalLevelHandler |
|
120 |
|
121 /** |
|
122 * @see CVccSignalLevelHandler::GetStrength() |
|
123 */ |
|
124 void GetStrength(); |
|
125 |
|
126 /** |
|
127 * @see CVccSignalLevelHandler::EnableNotificationsL() |
|
128 */ |
|
129 void EnableNotificationsL(); |
|
130 |
|
131 /** |
|
132 * @see CVccSignalLevelHandler::DisableNotifications() |
|
133 */ |
|
134 void DisableNotifications(); |
|
135 |
|
136 /** |
|
137 * @see CVccSignalLevelHandler::CancelGetStrength() |
|
138 */ |
|
139 void CancelGetStrength(); |
|
140 |
|
141 /** |
|
142 * @see CVccSignalLevelHandler::NotifyChanges() |
|
143 */ |
|
144 void NotifyChanges( TInt32 aSignalStrength, |
|
145 MVccSignalLevelObserver::TSignalStrengthClass aClass ); |
|
146 |
|
147 // from base class MVccGsmNotifications |
|
148 |
|
149 /** |
|
150 * @see MVccGsmNotifications::GsmStrengthChanged() |
|
151 */ |
|
152 void GsmStrengthChanged( TInt32 aStrength ); |
|
153 |
|
154 |
|
155 private: // data |
|
156 |
|
157 /** |
|
158 * Etel server |
|
159 * Own. |
|
160 */ |
|
161 RTelServer iEtelServer; |
|
162 |
|
163 /** |
|
164 * Phone based functionality |
|
165 * Own. |
|
166 */ |
|
167 RMobilePhone iPhone; |
|
168 |
|
169 /** |
|
170 * Gsm signal level notifier |
|
171 * Own. |
|
172 */ |
|
173 CVccGsmNotifications* iGsmNotifications; |
|
174 |
|
175 /** Value of the GSM indication bar */ |
|
176 TInt8 iBar; |
|
177 |
|
178 VCC_UNITTEST( UT_CVccGsmSignalLevelHandler ) |
|
179 }; |
|
180 |
|
181 #endif // C_VCCGSMSIGNALLEVELHANDLER_H |