|
1 /* |
|
2 * Copyright (c) 2006-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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IRPRESETIMPL_H |
|
20 #define IRPRESETIMPL_H |
|
21 |
|
22 #include "irpreset.h" |
|
23 |
|
24 class CIRChannelServerUrlImpl; |
|
25 |
|
26 /** |
|
27 * This class provides the basic structure to hold the preset |
|
28 *information that is saved in the favourites database |
|
29 *It also provides the basic getter and setter functions to |
|
30 *manage the preset information. |
|
31 *for url selection for a particular bitrate some functionality |
|
32 *has been provided |
|
33 *copy constructor and assignment operator has been provided to |
|
34 *override the default ones |
|
35 * |
|
36 * @code |
|
37 *CIRPresetImpl* preset = CIRPresetImpl::NewL() |
|
38 *preset->SetXXX(); |
|
39 *preset->GetXXX() |
|
40 * *preset1 = *preset2 |
|
41 * @endcode |
|
42 * |
|
43 */ |
|
44 |
|
45 class CIRPresetImpl:public CIRPreset |
|
46 { |
|
47 |
|
48 public: |
|
49 |
|
50 /**CIRPresetImpl::NewL() |
|
51 *Static function |
|
52 *standard two phased constructor |
|
53 *@param void |
|
54 *@return *CIRPresetImpl |
|
55 **/ |
|
56 static CIRPresetImpl* NewL(TAny* aParams); |
|
57 |
|
58 |
|
59 /**CIRPresetImpl::NewLC() |
|
60 *Static function |
|
61 *standard two phased constructor |
|
62 *@param void |
|
63 *@return *CIRPresetImpl |
|
64 **/ |
|
65 static CIRPresetImpl* NewLC(TAny* aParams); |
|
66 |
|
67 |
|
68 /**CIRPresetImpl::~CIRIsdsPreset() |
|
69 *standard C++ destructor |
|
70 *@param NA |
|
71 *@return NA |
|
72 **/ |
|
73 ~CIRPresetImpl(); |
|
74 |
|
75 /** |
|
76 *CIRPresetImpl::SetId() |
|
77 *sets id |
|
78 *@param TDesC,supplied by xml parser |
|
79 */ |
|
80 void SetId(const TDesC &aId); |
|
81 |
|
82 /** |
|
83 *CIRPresetImpl::SetId() |
|
84 *sets id |
|
85 *@param TInt,provided to manipulate the id number |
|
86 */ |
|
87 void SetId(TInt aId); |
|
88 |
|
89 |
|
90 /** |
|
91 *CIRPresetImpl::SetLangInfo() |
|
92 *sets the preset language name and the code |
|
93 *@param TdesC,TdesC language id and name to be set |
|
94 */ |
|
95 void SetLangInfo(const TDesC &aLangId,const TDesC& aLangName); |
|
96 |
|
97 /** |
|
98 *CIRPresetImpl::SetCountryInfo() |
|
99 *sets the preset country name and the code |
|
100 *@param TdesC,TdesC country id and country name to be set |
|
101 */ |
|
102 void SetCountryInfo(const TDesC &aCountryId,const TDesC& aCountryName); |
|
103 |
|
104 /** |
|
105 *CIRPresetImpl::SetLangCode() |
|
106 *sets the language code |
|
107 *@param TdesC language code |
|
108 */ |
|
109 void SetLangCode(const TDesC &aLangId); |
|
110 |
|
111 /** |
|
112 *CIRPresetImpl::SetLang() |
|
113 *sets the language |
|
114 *@param TdesC language |
|
115 */ |
|
116 void SetLang(const TDesC& aLangName); |
|
117 |
|
118 /** |
|
119 *CIRPresetImpl::SetCountryCode() |
|
120 *sets the language code |
|
121 *@param TdesC language code |
|
122 */ |
|
123 void SetCountryCode(const TDesC &aCountryId); |
|
124 |
|
125 /** |
|
126 *CIRPresetImpl::SetCountryName() |
|
127 *sets the language name |
|
128 *@param TdesC language name |
|
129 */ |
|
130 void SetCountryName(const TDesC& aCountryName); |
|
131 |
|
132 /** |
|
133 *CIRPresetImpl::SetLastModifiedTime() |
|
134 *gets the channel url at a particular index |
|
135 *@param TDesC,time stamp |
|
136 */ |
|
137 void SetLastModifiedTime(const TDesC &aLastModified); |
|
138 |
|
139 /** |
|
140 *CIRPresetImpl::SetGenreInfo() |
|
141 *sets the genreid and name |
|
142 *@param aGenreId |
|
143 *@param aGenreName |
|
144 */ |
|
145 void SetGenreInfo(const TDesC& aGenreId,const TDesC& aGenreName); |
|
146 |
|
147 /** |
|
148 *CIRPresetImpl::SetImgUrl() |
|
149 *sets the image url |
|
150 *@param aImgUrl |
|
151 */ |
|
152 void SetImgUrl(const TDesC& aImgUrl); |
|
153 |
|
154 /** |
|
155 *CIRPresetImpl::SetLogoData() |
|
156 *sets the Logo Data |
|
157 *@param aData |
|
158 *@param aSize |
|
159 */ |
|
160 void SetLogoData( const TDesC8& aData ); |
|
161 |
|
162 /** |
|
163 *CIRPresetImpl::SetAdvertisementInUse() |
|
164 *sets the advertisementinuse url |
|
165 *@param aAdvertisementInUse |
|
166 */ |
|
167 void SetAdvertisementInUse(const TDesC& aAdvertisementInUse); |
|
168 |
|
169 /** |
|
170 *CIRPresetImpl::SetDescription() |
|
171 *sets the description for the channel |
|
172 *@param aDescription |
|
173 */ |
|
174 void SetDescription(const TDesC& aDescription); |
|
175 |
|
176 /** |
|
177 *CIRPresetImpl::SetAdvertisementUrl() |
|
178 *sets the advertisement url |
|
179 *@param aAdvertisementUrl |
|
180 */ |
|
181 void SetAdvertisementUrl(const TDesC& aAdvertisementUrl); |
|
182 |
|
183 /** |
|
184 *CIRPresetImpl::SetUrlCount() |
|
185 *sets the count of the number of urls |
|
186 */ |
|
187 void SetUrlCount(); |
|
188 |
|
189 /** |
|
190 *CIRPresetImpl::SetShortDesc() |
|
191 *sets the short description |
|
192 *@param aShortDesc |
|
193 */ |
|
194 void SetShortDesc(const TDesC& aShortDesc); |
|
195 |
|
196 /** |
|
197 *CIRPresetImpl::SetUrlCount() |
|
198 *sets the count of the number of urls |
|
199 *@param aCnt ,count |
|
200 */ |
|
201 void SetUrlCount(TInt aCnt); |
|
202 |
|
203 /** |
|
204 *CIRPresetImpl::SetUrlL() |
|
205 *sets the channel server url |
|
206 *@param aServerName ,server name |
|
207 *@param aUrl ,server url |
|
208 *@param aBitrate .server bitrate |
|
209 */ |
|
210 void SetUrlL(const TDesC &aServerName,const TDesC &aUrl, |
|
211 const TDesC &aBitrate); |
|
212 |
|
213 /** |
|
214 *CIRPresetImpl::SetUrlL() |
|
215 *sets the channel server url |
|
216 *@param aServerName ,server name |
|
217 *@param aUrl ,server url |
|
218 *@param aBitrate ,server bitrate |
|
219 */ |
|
220 void SetUrlL(const TDesC &aServerName,const TDesC &aUrl,TInt aBitrate); |
|
221 |
|
222 /** |
|
223 *CIRPresetImpl::SetChannelType() |
|
224 *sets the channel type |
|
225 *@param aChannelType userdefined,isds,adhoc |
|
226 */ |
|
227 void SetChannelType(TInt aChannelType); |
|
228 |
|
229 /** |
|
230 *CIRPresetImpl::SetMusicStoreStatus() |
|
231 *sets the musicStoreEnabled |
|
232 *@param aMusicStoreStatus |
|
233 */ |
|
234 void SetMusicStoreStatus(const TDesC& aMusicStoreStatus); |
|
235 |
|
236 //getter functions |
|
237 |
|
238 /** |
|
239 *CIRPresetImpl::GetId() |
|
240 *gets the channel id |
|
241 *@return TInt |
|
242 */ |
|
243 TInt GetId()const; |
|
244 /** |
|
245 *CIRPresetImpl::GetLangId() |
|
246 *gets the channel channelangid |
|
247 *@return TDesC |
|
248 */ |
|
249 const TDesC& GetLangId() const; |
|
250 |
|
251 /** |
|
252 *CIRPresetImpl::GetLangName() |
|
253 *gets the channel language name |
|
254 *@return TDesC |
|
255 */ |
|
256 const TDesC& GetLangName() const; |
|
257 |
|
258 /** |
|
259 *CIRPresetImpl::GetCountryId() |
|
260 *gets the channel countryid |
|
261 *@return TDesC |
|
262 */ |
|
263 const TDesC& GetCountryId() const; |
|
264 |
|
265 /** |
|
266 *CIRPresetImpl::GetCountryName() |
|
267 *gets the channel country name |
|
268 *@return TDesC |
|
269 */ |
|
270 const TDesC& GetCountryName() const; |
|
271 |
|
272 /** |
|
273 *CIRPresetImpl::GetLastModifiedTime() |
|
274 *gets the channel last modified time stamp |
|
275 *@return TDesC |
|
276 */ |
|
277 const TDesC& GetLastModifiedTime() const; |
|
278 |
|
279 /** |
|
280 *CIRPresetImpl::GetDescription() |
|
281 *gets the channel description |
|
282 *@return TDesC |
|
283 */ |
|
284 const TDesC& GetDescription() const; |
|
285 |
|
286 /** |
|
287 *CIRPresetImpl::GetShortDescription() |
|
288 *gets the channel short description |
|
289 *@return TDesC |
|
290 */ |
|
291 const TDesC& GetShortDescription() const; |
|
292 |
|
293 /** |
|
294 *CIRPresetImpl::GetChannelType() |
|
295 *gets the channel Type |
|
296 *@return TInt |
|
297 */ |
|
298 TInt GetChannelType()const; |
|
299 |
|
300 /** |
|
301 *CIRPresetImpl::GetGenreId() |
|
302 *gets the channel genreid |
|
303 *@return TDesC |
|
304 */ |
|
305 const TDesC& GetGenreId() const; |
|
306 |
|
307 /** |
|
308 *CIRPresetImpl::GetGenreName() |
|
309 *gets the channel genre name |
|
310 *@return TDesC |
|
311 */ |
|
312 const TDesC& GetGenreName() const; |
|
313 |
|
314 /** |
|
315 *CIRPresetImpl::GetAdvertisementUrl() |
|
316 *gets the channel advertisement url |
|
317 *@return TDesC |
|
318 */ |
|
319 const TDesC& GetAdvertisementUrl() const; |
|
320 |
|
321 /** |
|
322 *CIRPresetImpl::GetImgUrl() |
|
323 *gets the channel image url |
|
324 *@return TDesC |
|
325 */ |
|
326 const TDesC& GetImgUrl() const; |
|
327 |
|
328 /** |
|
329 *CIRPresetImpl::GetUrlCount() |
|
330 *gets the channel url count |
|
331 *@return TDesC |
|
332 */ |
|
333 TInt GetUrlCount()const; |
|
334 |
|
335 /* |
|
336 *CIRPresetImpl::GetLogoData() |
|
337 *gets the Logo Data |
|
338 *@return TDesC8& |
|
339 */ |
|
340 const TDesC8& GetLogoData() const; |
|
341 |
|
342 /** |
|
343 *CIRPresetImpl::GetUrl() |
|
344 *gets the channel url from zeroth position |
|
345 *@return CIRChannelServerUrlImpl& |
|
346 */ |
|
347 CIRChannelServerUrlImpl& GetUrl(TInt aInt)const; |
|
348 |
|
349 /* |
|
350 * get the channel url at specified position |
|
351 * |
|
352 */ |
|
353 const TDesC& GetChannelUrlAt(TInt aIndex) const; |
|
354 |
|
355 /** |
|
356 *CIRPresetImpl::GetMusicStoreStatus() |
|
357 *gets the musicStoreEnabled |
|
358 *@return TDesC& |
|
359 */ |
|
360 const TDesC& GetMusicStoreStatus()const; |
|
361 |
|
362 |
|
363 /** |
|
364 *CIRPresetImpl::operator=() |
|
365 *assignment operator |
|
366 *@param CIRIsdsPreset& aPreset |
|
367 *@return CIRIsdsPreset |
|
368 */ |
|
369 CIRPresetImpl& operator=(const CIRPresetImpl& aPreset); |
|
370 |
|
371 /** |
|
372 *void CIRPresetImpl::CIRIsdsPresetToCIRPresetImpl(const CIRIsdsPreset& aIsdsPreset) |
|
373 *used to convert the isdspresets to plugnized presets. |
|
374 *Does a deep copy for all the member variables |
|
375 *@param CIRIsdsPreset&,the preset to be copied from |
|
376 */ |
|
377 void CIRIsdsPresetToCIRPresetImpl(const CIRIsdsPreset& aIsdsPreset); |
|
378 |
|
379 /** |
|
380 *CIRPresetImpl::CopyPresetData() |
|
381 *copy data to CIRIsdsPreset |
|
382 *@param CIRIsdsPreset&,the preset to be copied into |
|
383 */ |
|
384 void CopyPresetData(CIRIsdsPreset& aIsdsPreset) const; |
|
385 |
|
386 /** |
|
387 *CIRPresetImpl::GetAvailableBitrates() |
|
388 *gets the bitrate array |
|
389 *@return RArray<TInt> |
|
390 */ |
|
391 RArray<TInt>& GetAvailableBitrates(); |
|
392 |
|
393 /** |
|
394 *CIRPresetImpl::UniqId() |
|
395 *gets the unique id |
|
396 *@return TUint32 |
|
397 */ |
|
398 TUint32 UniqId() ; |
|
399 |
|
400 /** |
|
401 *CIRPresetImpl::SetUniqId() |
|
402 *sets the unique id for the preset |
|
403 *@param aId |
|
404 */ |
|
405 void SetUniqId( TUint32 aUniqId); |
|
406 |
|
407 /* |
|
408 * Returns the played times of the channel |
|
409 */ |
|
410 TInt GetPlayedTimes() const; |
|
411 |
|
412 /* |
|
413 * Set the played times of the channel |
|
414 */ |
|
415 void SetPlayedTimes(TInt aPlayedTimes); |
|
416 |
|
417 protected: |
|
418 |
|
419 /**CIRPresetImpl::CIRIsdsPreset() |
|
420 *standard C++ constructor |
|
421 *@param void |
|
422 *@return NA |
|
423 **/ |
|
424 CIRPresetImpl(); |
|
425 |
|
426 /**CIRPresetImpl::ConstructL(TAny* aParams) |
|
427 *standard second phase constructor(Leaveable) |
|
428 *@param void |
|
429 *@return void |
|
430 **/ |
|
431 void ConstructL(TAny* aParams); |
|
432 |
|
433 |
|
434 //for serialization |
|
435 /** |
|
436 *CIRPresetImpl::ExternalizeL() |
|
437 *serializes the preset data into a stream |
|
438 *@param aWriteStream |
|
439 */ |
|
440 void ExternalizeL(RWriteStream& aWriteStream)const; |
|
441 |
|
442 /** |
|
443 *CIRPresetImpl::InternalizeL() |
|
444 *serializes the preset data from a stream to a structure |
|
445 *@param aReadStream |
|
446 */ |
|
447 void InternalizeL(RReadStream& aReadStream); |
|
448 |
|
449 private: |
|
450 |
|
451 /** |
|
452 * unique id generated for the preset saved at favourite |
|
453 */ |
|
454 TUint32 iUniqId; |
|
455 |
|
456 /** |
|
457 * no of channel urls |
|
458 */ |
|
459 TInt iChannelUrlCount; |
|
460 |
|
461 /** |
|
462 * 0 for user defined 1 for isds type. |
|
463 */ |
|
464 TInt iType; |
|
465 |
|
466 /** |
|
467 * index in the preset table |
|
468 */ |
|
469 //TInt iIndex;not required |
|
470 |
|
471 /** |
|
472 * isds generated preset id |
|
473 */ |
|
474 TInt iPresetId; |
|
475 |
|
476 /** |
|
477 * preset language code |
|
478 */ |
|
479 RBuf iLanguageCode; |
|
480 |
|
481 /** |
|
482 * preset language |
|
483 */ |
|
484 RBuf iLanguage; |
|
485 |
|
486 /** |
|
487 * preset country of origin code |
|
488 */ |
|
489 RBuf iCountryCode; |
|
490 |
|
491 /** |
|
492 * preset country of origin |
|
493 */ |
|
494 RBuf iCountry; |
|
495 |
|
496 /** |
|
497 * preset last modified |
|
498 */ |
|
499 RBuf iLastModified; |
|
500 |
|
501 /** |
|
502 * not in use |
|
503 */ |
|
504 RBuf iAdvertisementUrl; |
|
505 |
|
506 /** |
|
507 * not in use |
|
508 */ |
|
509 RBuf iAdvertisementInUse; |
|
510 |
|
511 /** |
|
512 * Logo URL |
|
513 */ |
|
514 RBuf iImgUrl; |
|
515 |
|
516 /** |
|
517 * Raw image data for the logo. |
|
518 * Owned. |
|
519 */ |
|
520 RBuf8 iLogoData; |
|
521 |
|
522 /** |
|
523 * channel description |
|
524 */ |
|
525 RBuf iDescription; |
|
526 |
|
527 /** |
|
528 * channel short desription |
|
529 */ |
|
530 RBuf iShortDesc; |
|
531 |
|
532 /** |
|
533 * channel genre name |
|
534 */ |
|
535 RBuf iGenereName; |
|
536 |
|
537 /** |
|
538 * channel genre id |
|
539 */ |
|
540 RBuf iGenereId; |
|
541 |
|
542 /** |
|
543 * musicStoreEnabled value |
|
544 */ |
|
545 RBuf iMusicStoreStatus; |
|
546 |
|
547 |
|
548 /** |
|
549 * url array |
|
550 */ |
|
551 CDesCArrayFlat* iUrlForBitrate; |
|
552 |
|
553 /** |
|
554 * url array |
|
555 */ |
|
556 CArrayPtrFlat<CIRChannelServerUrlImpl>* iUrlArray; |
|
557 |
|
558 /** |
|
559 * bitrate array |
|
560 */ |
|
561 RArray<TInt> iBitrateArray; |
|
562 |
|
563 //added by Peter on June 23rd, 2009 |
|
564 TInt iPlayedTimes; |
|
565 }; |
|
566 |
|
567 #endif //end of IRPRESETIMPL_H |