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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef RADIOSTATIONITEM_H |
|
19 #define RADIOSTATIONITEM_H |
|
20 |
|
21 // System includes |
|
22 #include <HbAbstractViewItem> |
|
23 |
|
24 // Forward declarations |
|
25 class RadioFadingLabel; |
|
26 class HbPushButton; |
|
27 class RadioStation; |
|
28 class HbAnchorLayout; |
|
29 class RadioStationCarousel; |
|
30 |
|
31 // Class declaration |
|
32 class RadioStationItem : public HbAbstractViewItem |
|
33 { |
|
34 Q_OBJECT |
|
35 friend class RadioStationCarousel; |
|
36 |
|
37 public: |
|
38 |
|
39 RadioStationItem( RadioStationCarousel& carousel ); |
|
40 |
|
41 // From base class HbAbstractViewItem |
|
42 |
|
43 HbAbstractViewItem* createItem(); |
|
44 void updateChildItems(); |
|
45 |
|
46 // New functions |
|
47 |
|
48 uint frequency() const; |
|
49 void update( const RadioStation* station = 0 ); |
|
50 void setFrequency( uint frequency ); |
|
51 void cleanRdsData(); |
|
52 void handleLongPress( const QPointF& coords ); |
|
53 |
|
54 private slots: |
|
55 |
|
56 void toggleFavorite(); |
|
57 |
|
58 private: |
|
59 |
|
60 void updateFavoriteIcon( bool isFavorite ); |
|
61 |
|
62 RadioStationCarousel* carousel(); |
|
63 |
|
64 QString parseFrequency( const uint frequency ); |
|
65 QString nameOrFrequency( const RadioStation& station, uint frequency = 0 ); |
|
66 |
|
67 private: // data |
|
68 |
|
69 RadioStationCarousel& mCarousel; |
|
70 HbAnchorLayout* mLayout; |
|
71 RadioFadingLabel* mNameLabel; |
|
72 HbPushButton* mIconButton; |
|
73 RadioFadingLabel* mGenreLabel; |
|
74 RadioFadingLabel* mRadiotextLabel; |
|
75 RadioFadingLabel* mUrlLabel; |
|
76 uint mFrequency; |
|
77 }; |
|
78 |
|
79 |
|
80 #endif // RADIOSTATIONITEM_H |
|