equal
deleted
inserted
replaced
19 #define RADIOSTATIONCAROUSEL_H |
19 #define RADIOSTATIONCAROUSEL_H |
20 |
20 |
21 // System includes |
21 // System includes |
22 #include <HbScrollArea> |
22 #include <HbScrollArea> |
23 #include <HbIcon> |
23 #include <HbIcon> |
24 #include <QPointer> |
24 #include <QWeakPointer> |
25 |
25 |
26 // User includes |
26 // User includes |
|
27 #include "radiocarouselitemobserver.h" |
27 #include "radiowidgetsexport.h" |
28 #include "radiowidgetsexport.h" |
28 #include "radio_global.h" |
29 #include "radio_global.h" |
29 |
30 |
30 // Forward declarations |
31 // Forward declarations |
31 class RadioUiEngine; |
32 class RadioUiEngine; |
34 class RadioStation; |
35 class RadioStation; |
35 class RadioStationModel; |
36 class RadioStationModel; |
36 class RadioStationCarousel; |
37 class RadioStationCarousel; |
37 class RadioCarouselAnimator; |
38 class RadioCarouselAnimator; |
38 class HbLabel; |
39 class HbLabel; |
|
40 class HbMenu; |
39 |
41 |
40 namespace CarouselInfoText |
42 namespace CarouselInfoText |
41 { |
43 { |
42 enum Type |
44 enum Type |
43 { |
45 { |
51 }; |
53 }; |
52 } |
54 } |
53 |
55 |
54 // Class declaration |
56 // Class declaration |
55 class WIDGETS_DLL_EXPORT RadioStationCarousel : public HbScrollArea |
57 class WIDGETS_DLL_EXPORT RadioStationCarousel : public HbScrollArea |
|
58 , public RadioCarouselItemObserver |
56 { |
59 { |
57 Q_OBJECT |
60 Q_OBJECT |
58 Q_PROPERTY(HbIcon favoriteIcon READ favoriteIcon WRITE setFavoriteIcon) |
61 Q_PROPERTY(HbIcon favoriteIcon READ favoriteIcon WRITE setFavoriteIcon) |
59 Q_PROPERTY(HbIcon nonFavoriteIcon READ nonFavoriteIcon WRITE setNonFavoriteIcon) |
62 Q_PROPERTY(HbIcon nonFavoriteIcon READ nonFavoriteIcon WRITE setNonFavoriteIcon) |
60 Q_PROPERTY( int autoScrollTime READ autoScrollTime WRITE setAutoScrollTime ) |
63 Q_PROPERTY( int autoScrollTime READ autoScrollTime WRITE setAutoScrollTime ) |
126 void adjustAfterScroll(); |
129 void adjustAfterScroll(); |
127 void update( const RadioStation& station ); |
130 void update( const RadioStation& station ); |
128 void updateRadioText( const RadioStation& station ); |
131 void updateRadioText( const RadioStation& station ); |
129 void updateStations(); |
132 void updateStations(); |
130 void timerFired(); |
133 void timerFired(); |
131 void toggleFavorite(); |
|
132 // void openContextMenu( HbAbstractViewItem* item, const QPointF& coords ); |
|
133 |
134 |
134 #ifdef USE_DEBUGGING_CONTROLS |
135 #ifdef USE_DEBUGGING_CONTROLS |
135 void setRdsAvailable( bool available ); |
136 void setRdsAvailable( bool available ); |
136 #endif // USE_DEBUGGING_CONTROLS |
137 #endif // USE_DEBUGGING_CONTROLS |
137 |
138 |
142 void mousePressEvent( QGraphicsSceneMouseEvent* event ); |
143 void mousePressEvent( QGraphicsSceneMouseEvent* event ); |
143 void resizeEvent( QGraphicsSceneResizeEvent* event ); |
144 void resizeEvent( QGraphicsSceneResizeEvent* event ); |
144 void showEvent( QShowEvent* event ); |
145 void showEvent( QShowEvent* event ); |
145 void gestureEvent( QGestureEvent* event ); |
146 void gestureEvent( QGestureEvent* event ); |
146 |
147 |
|
148 // from base class RadioCarouselItemObserver |
|
149 |
|
150 void handleIconClicked( const RadioStation& station ); |
|
151 void handleRadiotextClicked( const RadioStation& station ); |
|
152 void handleUrlClicked( const RadioStation& station ); |
|
153 QString localizeGenre( int genre ); |
|
154 bool isInManualSeek() const; |
|
155 RadioStation findStation( uint frequency ); |
|
156 |
147 // New functions |
157 // New functions |
148 |
158 |
149 bool isInitialized() const; |
159 bool isInitialized() const; |
150 |
160 |
151 void setCenterIndex( int index, ScrollMode mode = Default ); |
161 void setCenterIndex( int index, ScrollMode mode = Default ); |
180 QTimer* mGenericTimer; |
190 QTimer* mGenericTimer; |
181 TimerMode mTimerMode; |
191 TimerMode mTimerMode; |
182 |
192 |
183 QString mRadioTextHolder; |
193 QString mRadioTextHolder; |
184 |
194 |
185 QPointer<RadioCarouselAnimator> mAnimator; |
195 QWeakPointer<RadioCarouselAnimator> mAnimator; |
186 |
196 |
187 HbLabel* mInfoText; |
197 HbLabel* mInfoText; |
|
198 |
|
199 HbMenu* mRadiotextPopup; |
188 |
200 |
189 HbWidget* mContainer; |
201 HbWidget* mContainer; |
190 |
202 |
191 enum CarouselItem { LeftItem, CenterItem, RightItem }; |
203 enum CarouselItem { LeftItem, CenterItem, RightItem }; |
192 RadioCarouselItem* mItems[3]; |
204 RadioCarouselItem* mItems[3]; |
207 Scroll::Direction mScrollDirection; |
219 Scroll::Direction mScrollDirection; |
208 |
220 |
209 bool mManualSeekMode; |
221 bool mManualSeekMode; |
210 |
222 |
211 bool mAlternateSkipping; |
223 bool mAlternateSkipping; |
212 |
224 |
213 #ifdef USE_DEBUGGING_CONTROLS |
225 #ifdef USE_DEBUGGING_CONTROLS |
214 RadioFadingLabel* mRdsLabel; |
226 RadioFadingLabel* mRdsLabel; |
215 #endif |
227 #endif |
216 |
228 |
217 }; |
229 }; |