1 /* |
|
2 * Copyright (c) 2007 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: Radio RDS Utility body's stub implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "RadioRdsUtilityBody.h" |
|
20 #include "RadioServerData.h" |
|
21 #include "RadioSession.h" |
|
22 #include "RadioStubManager.h" |
|
23 |
|
24 #define STUB CRadioStubManager::GetRadioStubManager()->iRds |
|
25 |
|
26 // ======== MEMBER FUNCTIONS ======== |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CRadioRdsUtility::CBody::NewL |
|
30 // Two-phased constructor. |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 CRadioRdsUtility::CBody* CRadioRdsUtility::CBody::NewL( |
|
34 RRadioSession& aRadioSession, |
|
35 MRadioRdsObserver& aObserver ) |
|
36 { |
|
37 if ( STUB.iLeaveNewL.iError ) |
|
38 { |
|
39 User::Leave( STUB.iLeaveNewL.iError ); |
|
40 } |
|
41 CRadioRdsUtility::CBody* s = new(ELeave) CRadioRdsUtility::CBody( aRadioSession, aObserver ); |
|
42 CleanupStack::PushL(s); |
|
43 s->ConstructL(); |
|
44 CleanupStack::Pop(); |
|
45 return s; |
|
46 } |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // CRadioRdsUtility::CBody::ConstructL |
|
50 // Two-phased constructor. |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 void CRadioRdsUtility::CBody::ConstructL() |
|
54 { |
|
55 if ( STUB.iLeaveErrorForConstructL.iError ) |
|
56 { |
|
57 User::Leave( STUB.iLeaveErrorForConstructL.iError ); |
|
58 } |
|
59 STUB.iRadioRdsUtilityClient = &iRadioRdsUtilityClient; |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CRadioRdsUtility::CBody::CBody |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 CRadioRdsUtility::CBody::CBody( |
|
67 RRadioSession& aRadioSession, |
|
68 MRadioRdsObserver& aObserver ) |
|
69 : iRadioSession(aRadioSession), |
|
70 iRadioRdsUtilityClient(aObserver) |
|
71 { |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // Destructor. |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 CRadioRdsUtility::CBody::~CBody() |
|
79 { |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CRadioRdsUtility::CBody::Close |
|
84 // Cancel all requested RDS notifications if any were requested. |
|
85 // (other items were commented in a header). |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 void CRadioRdsUtility::CBody::Close() |
|
89 { |
|
90 } |
|
91 |
|
92 // ----------------------------------------------------------------------------- |
|
93 // CRadioRdsUtility::CBody::GetCapabilities |
|
94 // (other items were commented in a header). |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 TInt CRadioRdsUtility::CBody::GetCapabilities( |
|
98 TRdsCapabilities& aCaps ) const |
|
99 { |
|
100 if ( !STUB.iGetCapabilitiesError.Error() ) |
|
101 { |
|
102 aCaps.iRdsFunctions = STUB.iCaps.iRdsFunctions; |
|
103 aCaps.iAdditionalFunctions1 = STUB.iCaps.iAdditionalFunctions1; |
|
104 aCaps.iAdditionalFunctions2 = STUB.iCaps.iAdditionalFunctions2; |
|
105 } |
|
106 return STUB.iGetCapabilitiesError.Error(); |
|
107 } |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // CRadioRdsUtility::CBody::GetRdsSignalStatus |
|
111 // (other items were commented in a header). |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 TInt CRadioRdsUtility::CBody::GetRdsSignalStatus( |
|
115 TBool& aRdsSignal ) const |
|
116 { |
|
117 aRdsSignal = STUB.iRdsSignal; |
|
118 return STUB.iGetRdsSignalStatusError.Error(); |
|
119 } |
|
120 |
|
121 // ----------------------------------------------------------------------------- |
|
122 // CRadioRdsUtility::CBody::NotifyRdsDataChange |
|
123 // (other items were commented in a header). |
|
124 // ----------------------------------------------------------------------------- |
|
125 // |
|
126 TInt CRadioRdsUtility::CBody::NotifyRdsDataChange( |
|
127 TRdsData aRdsData ) |
|
128 { |
|
129 iRdsDataReq.iRdsFunctions = aRdsData.iRdsFunctions; |
|
130 iRdsDataReq.iAdditionalFunctions1 = aRdsData.iAdditionalFunctions1; |
|
131 iRdsDataReq.iAdditionalFunctions2 = aRdsData.iAdditionalFunctions2; |
|
132 return STUB.iNotifyRdsDataChangeError.Error(); |
|
133 } |
|
134 |
|
135 // ----------------------------------------------------------------------------- |
|
136 // CRadioRdsUtility::CBody::CancelNotifyRdsDataChange |
|
137 // (other items were commented in a header). |
|
138 // ----------------------------------------------------------------------------- |
|
139 // |
|
140 void CRadioRdsUtility::CBody::CancelNotifyRdsDataChange() |
|
141 { |
|
142 } |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // CRadioRdsUtility::CBody::SetAutomaticSwitching |
|
146 // (other items were commented in a header). |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 TInt CRadioRdsUtility::CBody::SetAutomaticSwitching( |
|
150 TBool aAuto ) |
|
151 { |
|
152 STUB.iAutomaticSwitching = aAuto; |
|
153 return STUB.iSetAutomaticSwitchingError.Error(); |
|
154 |
|
155 } |
|
156 |
|
157 // ----------------------------------------------------------------------------- |
|
158 // CRadioRdsUtility::CBody::GetAutomaticSwitching |
|
159 // (other items were commented in a header). |
|
160 // ----------------------------------------------------------------------------- |
|
161 // |
|
162 TInt CRadioRdsUtility::CBody::GetAutomaticSwitching( |
|
163 TBool& aAuto ) |
|
164 { |
|
165 aAuto = STUB.iAutomaticSwitching; |
|
166 return STUB.iGetAutomaticSwitchingError.Error(); |
|
167 } |
|
168 |
|
169 // ----------------------------------------------------------------------------- |
|
170 // CRadioRdsUtility::CBody::CancelAFSearch |
|
171 // (other items were commented in a header). |
|
172 // ----------------------------------------------------------------------------- |
|
173 // |
|
174 void CRadioRdsUtility::CBody::CancelAFSearch() |
|
175 { |
|
176 } |
|
177 |
|
178 // ----------------------------------------------------------------------------- |
|
179 // CRadioRdsUtility::CBody::SetAutomaticTrafficAnnouncement |
|
180 // (other items were commented in a header). |
|
181 // ----------------------------------------------------------------------------- |
|
182 // |
|
183 TInt CRadioRdsUtility::CBody::SetAutomaticTrafficAnnouncement( |
|
184 TBool aAuto ) |
|
185 { |
|
186 STUB.iTaStatus = aAuto; |
|
187 return STUB.iSetAutomaticTrafficAnnouncementError.Error(); |
|
188 } |
|
189 |
|
190 // ----------------------------------------------------------------------------- |
|
191 // CRadioRdsUtility::CBody::GetAutomaticTrafficAnnouncement |
|
192 // (other items were commented in a header). |
|
193 // ----------------------------------------------------------------------------- |
|
194 // |
|
195 TInt CRadioRdsUtility::CBody::GetAutomaticTrafficAnnouncement( |
|
196 TBool& aAuto ) |
|
197 { |
|
198 aAuto = STUB.iTaStatus; |
|
199 return STUB.iGetAutomaticTrafficAnnouncementError.Error(); |
|
200 } |
|
201 |
|
202 // ----------------------------------------------------------------------------- |
|
203 // CRadioRdsUtility::CBody::StationSeekByPTY |
|
204 // (other items were commented in a header). |
|
205 // ----------------------------------------------------------------------------- |
|
206 // |
|
207 void CRadioRdsUtility::CBody::StationSeekByPTY( |
|
208 TRdsProgrammeType /*aPty*/, |
|
209 TBool /*aUpwards*/ ) |
|
210 { |
|
211 iRadioRdsUtilityClient.MrroStationSeekByPTYComplete( |
|
212 STUB.iStationSeekByPTYError.Error(), STUB.iFrequency ); |
|
213 } |
|
214 |
|
215 // ----------------------------------------------------------------------------- |
|
216 // CRadioRdsUtility::CBody::StationSeekByTA |
|
217 // (other items were commented in a header). |
|
218 // ----------------------------------------------------------------------------- |
|
219 // |
|
220 void CRadioRdsUtility::CBody::StationSeekByTA( |
|
221 TBool /*aSeekUp*/ ) |
|
222 { |
|
223 iRadioRdsUtilityClient.MrroStationSeekByTAComplete( STUB.iStationSeekByTAError.Error(), STUB.iFrequency ); |
|
224 } |
|
225 |
|
226 // ----------------------------------------------------------------------------- |
|
227 // CRadioRdsUtility::CBody::StationSeekByTP |
|
228 // (other items were commented in a header). |
|
229 // ----------------------------------------------------------------------------- |
|
230 // |
|
231 void CRadioRdsUtility::CBody::StationSeekByTP( |
|
232 TBool /*aSeekUp*/ ) |
|
233 { |
|
234 iRadioRdsUtilityClient.MrroStationSeekByTPComplete( STUB.iStationSeekByTPError.Error(), STUB.iFrequency ); |
|
235 } |
|
236 |
|
237 // ----------------------------------------------------------------------------- |
|
238 // CRadioRdsUtility::CBody::CancelRdsStationSeek |
|
239 // (other items were commented in a header). |
|
240 // ----------------------------------------------------------------------------- |
|
241 // |
|
242 void CRadioRdsUtility::CBody::CancelRdsStationSeek() |
|
243 { |
|
244 } |
|
245 |
|
246 // ----------------------------------------------------------------------------- |
|
247 // CRadioRdsUtility::CBody::GetFreqByPTY |
|
248 // (other items were commented in a header). |
|
249 // ----------------------------------------------------------------------------- |
|
250 // |
|
251 void CRadioRdsUtility::CBody::GetFreqByPTY( |
|
252 TRdsProgrammeType /*aPty*/ ) |
|
253 { |
|
254 iRadioRdsUtilityClient.MrroGetFreqByPTYComplete( STUB.iGetFreqByPTYError.Error(), STUB.iFreqList ); |
|
255 } |
|
256 |
|
257 // ----------------------------------------------------------------------------- |
|
258 // CRadioRdsUtility::CBody::CancelGetFreqByPTY |
|
259 // (other items were commented in a header). |
|
260 // ----------------------------------------------------------------------------- |
|
261 // |
|
262 void CRadioRdsUtility::CBody::CancelGetFreqByPTY() |
|
263 { |
|
264 } |
|
265 |
|
266 // ----------------------------------------------------------------------------- |
|
267 // CRadioRdsUtility::CBody::GetFreqByTA |
|
268 // (other items were commented in a header). |
|
269 // ----------------------------------------------------------------------------- |
|
270 // |
|
271 void CRadioRdsUtility::CBody::GetFreqByTA() |
|
272 { |
|
273 iRadioRdsUtilityClient.MrroGetFreqByTAComplete( STUB.iGetFreqByTAError.Error(), STUB.iFreqList ); |
|
274 } |
|
275 |
|
276 // ----------------------------------------------------------------------------- |
|
277 // CRadioRdsUtility::CBody::CancelGetFreqByTA |
|
278 // (other items were commented in a header). |
|
279 // ----------------------------------------------------------------------------- |
|
280 // |
|
281 void CRadioRdsUtility::CBody::CancelGetFreqByTA() |
|
282 { |
|
283 } |
|
284 |
|
285 // ----------------------------------------------------------------------------- |
|
286 // CRadioRdsUtility::CBody::GetPSByPTY |
|
287 // (other items were commented in a header). |
|
288 // ----------------------------------------------------------------------------- |
|
289 // |
|
290 void CRadioRdsUtility::CBody::GetPSByPTY( |
|
291 TRdsProgrammeType /*aPty*/ ) |
|
292 { |
|
293 iRadioRdsUtilityClient.MrroGetPSByPTYComplete( STUB.iGetPSByPTYError.Error(), STUB.iPsList ); |
|
294 } |
|
295 |
|
296 // ----------------------------------------------------------------------------- |
|
297 // CRadioRdsUtility::CBody::CancelGetPSByPTY |
|
298 // (other items were commented in a header). |
|
299 // ----------------------------------------------------------------------------- |
|
300 // |
|
301 void CRadioRdsUtility::CBody::CancelGetPSByPTY() |
|
302 { |
|
303 } |
|
304 |
|
305 // ----------------------------------------------------------------------------- |
|
306 // CRadioRdsUtility::CBody::GetPSByTA |
|
307 // (other items were commented in a header). |
|
308 // ----------------------------------------------------------------------------- |
|
309 // |
|
310 void CRadioRdsUtility::CBody::GetPSByTA() |
|
311 { |
|
312 iRadioRdsUtilityClient.MrroGetPSByPTYComplete( STUB.iGetPSByTAError.Error(), STUB.iPsList ); |
|
313 } |
|
314 |
|
315 // ----------------------------------------------------------------------------- |
|
316 // CRadioRdsUtility::CBody::CancelGetPSByTA |
|
317 // (other items were commented in a header). |
|
318 // ----------------------------------------------------------------------------- |
|
319 // |
|
320 void CRadioRdsUtility::CBody::CancelGetPSByTA() |
|
321 { |
|
322 } |
|
323 |
|
324 // ----------------------------------------------------------------------------- |
|
325 // CRadioRdsUtility::CBody::GetProgrammeIdentification |
|
326 // (other items were commented in a header). |
|
327 // ----------------------------------------------------------------------------- |
|
328 // |
|
329 TInt CRadioRdsUtility::CBody::GetProgrammeIdentification( |
|
330 TInt& /*aPi*/ ) |
|
331 { |
|
332 return STUB.iGetProgrammeIdentificationError.Error(); |
|
333 } |
|
334 |
|
335 // ----------------------------------------------------------------------------- |
|
336 // CRadioRdsUtility::CBody::GetProgrammeType |
|
337 // (other items were commented in a header). |
|
338 // ----------------------------------------------------------------------------- |
|
339 // |
|
340 TInt CRadioRdsUtility::CBody::GetProgrammeType( |
|
341 TRdsProgrammeType& /*aPty*/ ) |
|
342 { |
|
343 return STUB.iGetProgrammeTypeError.Error(); |
|
344 } |
|
345 |
|
346 // ----------------------------------------------------------------------------- |
|
347 // CRadioRdsUtility::CBody::GetProgrammeService |
|
348 // (other items were commented in a header). |
|
349 // ----------------------------------------------------------------------------- |
|
350 // |
|
351 TInt CRadioRdsUtility::CBody::GetProgrammeService( |
|
352 TRdsPSName& aPs ) |
|
353 { |
|
354 if ( STUB.iPs.Length() ) |
|
355 { |
|
356 aPs.Copy( STUB.iPs ); |
|
357 } |
|
358 |
|
359 return STUB.iGetProgrammeServiceError.Error(); |
|
360 } |
|
361 |
|
362 // ----------------------------------------------------------------------------- |
|
363 // CRadioRdsUtility::CBody::GetRadioText |
|
364 // (other items were commented in a header). |
|
365 // ----------------------------------------------------------------------------- |
|
366 // |
|
367 TInt CRadioRdsUtility::CBody::GetRadioText( |
|
368 TRdsRadioText& aRt ) |
|
369 { |
|
370 if ( STUB.iRtPlusData.Length() ) |
|
371 { |
|
372 aRt.Copy( STUB.iRtPlusData ); |
|
373 } |
|
374 |
|
375 return STUB.iGetRadioTextError.Error(); |
|
376 } |
|
377 |
|
378 // ----------------------------------------------------------------------------- |
|
379 // CRadioRdsUtility::CBody::GetRadioTextPlus |
|
380 // (other items were commented in a header). |
|
381 // ----------------------------------------------------------------------------- |
|
382 // |
|
383 TInt CRadioRdsUtility::CBody::GetRadioTextPlus( |
|
384 TRdsRTplusClass /*aRtPlusClass*/, |
|
385 TRdsRadioText& aRtPlusData ) |
|
386 { |
|
387 |
|
388 if ( STUB.iRtPlusData.Length() ) |
|
389 { |
|
390 aRtPlusData.Copy( STUB.iRtPlusData ); |
|
391 } |
|
392 |
|
393 return STUB.iGetRadioTextPlusError.Error(); |
|
394 } |
|
395 |
|
396 // ----------------------------------------------------------------------------- |
|
397 // CRadioRdsUtility::CBody::GetClockTime |
|
398 // (other items were commented in a header). |
|
399 // ----------------------------------------------------------------------------- |
|
400 // |
|
401 TInt CRadioRdsUtility::CBody::GetClockTime( |
|
402 TDateTime& aCt ) |
|
403 { |
|
404 aCt = STUB.iCt; |
|
405 return STUB.iGetClockTimeError.Error(); |
|
406 } |
|
407 |
|
408 // ----------------------------------------------------------------------------- |
|
409 // CRadioRdsUtility::CBody::GetTrafficAnnouncementStatus |
|
410 // (other items were commented in a header). |
|
411 // ----------------------------------------------------------------------------- |
|
412 // |
|
413 TInt CRadioRdsUtility::CBody::GetTrafficAnnouncementStatus( |
|
414 TBool& aTaStatus ) |
|
415 { |
|
416 STUB.iTaStatus = aTaStatus; |
|
417 return STUB.iGetTrafficAnnouncementStatusError.Error(); |
|
418 } |
|
419 |
|
420 // ----------------------------------------------------------------------------- |
|
421 // CRadioRdsUtility::CBody::GetTrafficProgrammeStatus |
|
422 // (other items were commented in a header). |
|
423 // ----------------------------------------------------------------------------- |
|
424 // |
|
425 TInt CRadioRdsUtility::CBody::GetTrafficProgrammeStatus( |
|
426 TBool& aTpStatus ) |
|
427 { |
|
428 aTpStatus = STUB.iTpStatus; |
|
429 return STUB.iGetTrafficProgrammeStatusError.Error(); |
|
430 } |
|
431 |
|
432 |
|
433 //End of File |
|