|
1 /* |
|
2 * Copyright (c) 2002-2008 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: AVKON Notifier client for setting signal pane data. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "AknSignalNotify.h" |
|
20 #include <AknNotifyStd.h> |
|
21 #include <avkon.hrh> |
|
22 #include <AknNotifySignature.h> |
|
23 |
|
24 // --------------------------------------------------------------------------- |
|
25 // CAknSignalNotify::NewL |
|
26 // Two-phased constructor. |
|
27 // --------------------------------------------------------------------------- |
|
28 // |
|
29 EXPORT_C CAknSignalNotify* CAknSignalNotify::NewL() |
|
30 { |
|
31 CAknSignalNotify* self = NewLC(); |
|
32 CleanupStack::Pop( self ); |
|
33 return self; |
|
34 } |
|
35 |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // CAknSignalNotify::NewLC |
|
39 // Two-phased constructor. |
|
40 // --------------------------------------------------------------------------- |
|
41 // |
|
42 EXPORT_C CAknSignalNotify* CAknSignalNotify::NewLC() |
|
43 { |
|
44 CAknSignalNotify* self = new (ELeave) CAknSignalNotify; |
|
45 CleanupStack::PushL( self ); |
|
46 self->ConstructL(); |
|
47 return self; |
|
48 } |
|
49 |
|
50 |
|
51 // --------------------------------------------------------------------------- |
|
52 // CAknSignalNotify::~CAknSignalNotify |
|
53 // Destructor. |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 EXPORT_C CAknSignalNotify::~CAknSignalNotify() |
|
57 { |
|
58 } |
|
59 |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // CAknSignalNotify::CAknSignalNotify |
|
63 // Default C++ constructor. |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 CAknSignalNotify::CAknSignalNotify() : CAknNotifyBase( KAknSignalNotifierUid ) |
|
67 { |
|
68 } |
|
69 |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // CAknSignalNotify::ConstructL |
|
73 // Second-phase constructor. |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 void CAknSignalNotify::ConstructL() |
|
77 { |
|
78 CAknNotifyBase::ConstructL(); |
|
79 } |
|
80 |
|
81 |
|
82 // --------------------------------------------------------------------------- |
|
83 // CAknSignalNotify::SetSignalLevelL |
|
84 // Sets the signal level of the signal pane. |
|
85 // --------------------------------------------------------------------------- |
|
86 // |
|
87 EXPORT_C void CAknSignalNotify::SetSignalLevelL( TInt aLevel ) |
|
88 { |
|
89 TPckgBuf< SAknNotifierPackage<SAknSignalNotifyParams> > pckg; |
|
90 pckg().iParamData.iGprsState = EAknSignalGprsStateNotChanged; |
|
91 pckg().iParamData.iValue = aLevel; |
|
92 TBuf8<1> resp; |
|
93 StartOrUpdateL( pckg, resp ); |
|
94 } |
|
95 |
|
96 |
|
97 // --------------------------------------------------------------------------- |
|
98 // CAknSignalNotify::SetGprsStateL |
|
99 // Sets a GPRS icon to the signal pane. |
|
100 // --------------------------------------------------------------------------- |
|
101 // |
|
102 EXPORT_C void CAknSignalNotify::SetGprsStateL( TInt aGprsState ) |
|
103 { |
|
104 if ( aGprsState >= 0 && aGprsState <= KAknSignalNumberOfGprsStates ) |
|
105 { |
|
106 SetStateL( aGprsState ); |
|
107 } |
|
108 } |
|
109 |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // CAknSignalNotify::CAknNotifyBase_Reserved |
|
113 // Reserved for future use. |
|
114 // --------------------------------------------------------------------------- |
|
115 // |
|
116 EXPORT_C void CAknSignalNotify::CAknNotifyBase_Reserved() |
|
117 { |
|
118 } |
|
119 |
|
120 |
|
121 // --------------------------------------------------------------------------- |
|
122 // CAknSignalNotify::SetWcdmaStateL |
|
123 // Sets a WCDMA icon to the signal pane. |
|
124 // --------------------------------------------------------------------------- |
|
125 // |
|
126 EXPORT_C void CAknSignalNotify::SetWcdmaStateL( TInt aWcdmaState ) |
|
127 { |
|
128 if ( aWcdmaState >= EAknSignalWcdmaIndicatorOff && |
|
129 aWcdmaState <= EAknSignalWcdmaIndicatorSuspended ) |
|
130 { |
|
131 SetStateL( aWcdmaState ); |
|
132 } |
|
133 } |
|
134 |
|
135 |
|
136 // --------------------------------------------------------------------------- |
|
137 // CAknSignalNotify::SetHsdpaStateL |
|
138 // Sets an HSDPA icon to the signal pane. |
|
139 // --------------------------------------------------------------------------- |
|
140 // |
|
141 EXPORT_C void CAknSignalNotify::SetHsdpaStateL( TInt aHsdpaState ) |
|
142 { |
|
143 if ( aHsdpaState >= EAknSignalHsdpaIndicatorOff && |
|
144 aHsdpaState <= EAknSignalHsdpaIndicatorMultipdp ) |
|
145 { |
|
146 SetStateL( aHsdpaState ); |
|
147 } |
|
148 } |
|
149 |
|
150 |
|
151 // --------------------------------------------------------------------------- |
|
152 // CAknSignalNotify::SetCommonPacketDataStateL |
|
153 // Sets a Common Packet Data icon to the signal pane. |
|
154 // --------------------------------------------------------------------------- |
|
155 // |
|
156 EXPORT_C void CAknSignalNotify::SetCommonPacketDataStateL( |
|
157 TInt aCommonPacketDataState ) |
|
158 { |
|
159 if ( aCommonPacketDataState >= EAknSignalCommonPacketDataIndicatorOff && |
|
160 aCommonPacketDataState <= EAknSignalCommonPacketDataIndicatorMultipdp ) |
|
161 { |
|
162 SetStateL( aCommonPacketDataState ); |
|
163 } |
|
164 } |
|
165 |
|
166 |
|
167 // --------------------------------------------------------------------------- |
|
168 // CAknSignalNotify::SetCdmaStateL |
|
169 // Sets a CDMA icon to the signal pane. |
|
170 // --------------------------------------------------------------------------- |
|
171 // |
|
172 #ifdef __PROTOCOL_CDMA |
|
173 EXPORT_C void CAknSignalNotify::SetCdmaStateL( TInt aCdmaState ) |
|
174 { |
|
175 // Only supported in CDMA builds. |
|
176 if ( aCdmaState >= EAknSignalCdmaIndicatorOff && |
|
177 aCdmaState <= EAknSignalCdmaIndicatorReceiving ) |
|
178 { |
|
179 SetStateL( aCdmaState ); |
|
180 } |
|
181 } |
|
182 #else |
|
183 EXPORT_C void CAknSignalNotify::SetCdmaStateL( TInt /*aCdmaState*/ ) |
|
184 { |
|
185 } |
|
186 #endif // __PROTOCOL_CDMA |
|
187 |
|
188 |
|
189 // --------------------------------------------------------------------------- |
|
190 // CAknSignalNotify::SetCdmaStateL |
|
191 // Sets an EDGE icon to the signal pane. |
|
192 // --------------------------------------------------------------------------- |
|
193 // |
|
194 EXPORT_C void CAknSignalNotify::SetEdgeStateL( TInt aEdgeState ) |
|
195 { |
|
196 if ( aEdgeState >= EAknSignalEdgeIndicatorOff && |
|
197 aEdgeState <= EAknSignalEdgeIndicatorMultipdp ) |
|
198 { |
|
199 SetStateL( aEdgeState ); |
|
200 } |
|
201 } |
|
202 |
|
203 |
|
204 // --------------------------------------------------------------------------- |
|
205 // CAknSignalNotify::SetCdmaStateL |
|
206 // Sets the signal state icon to the signal pane. |
|
207 // --------------------------------------------------------------------------- |
|
208 // |
|
209 void CAknSignalNotify::SetStateL( TInt aState ) |
|
210 { |
|
211 TPckgBuf< SAknNotifierPackage<SAknSignalNotifyParams> > pckg; |
|
212 pckg().iParamData.iGprsState = aState; |
|
213 pckg().iParamData.iValue = EAknSignalStateNotChanged; |
|
214 TBuf8<1> resp; |
|
215 StartOrUpdateL( pckg, resp ); |
|
216 } |
|
217 |
|
218 // End of File |