22 #include <HbIcon> |
22 #include <HbIcon> |
23 #include <QScopedPointer> |
23 #include <QScopedPointer> |
24 |
24 |
25 // User includes |
25 // User includes |
26 #include "radioviewbase.h" |
26 #include "radioviewbase.h" |
27 #include "radiowidgetsexport.h" |
|
28 |
27 |
29 // Forward declarations |
28 // Forward declarations |
30 class RadioWindow; |
29 class RadioWindow; |
31 class RadioStationModel; |
30 class RadioStationModel; |
32 class HbListView; |
31 class HbListView; |
33 class HbPushButton; |
32 class HbPushButton; |
34 class RadioBannerLabel; |
|
35 class HbAbstractViewItem; |
33 class HbAbstractViewItem; |
36 class RadioUiLoader; |
34 class RadioUiLoader; |
37 class RadioStation; |
35 class RadioStation; |
38 class RadioStationFilterModel; |
36 class RadioStationFilterModel; |
39 class RadioFrequencyScanner; |
37 class RadioFrequencyScanner; |
|
38 class QSortFilterProxyModel; |
40 |
39 |
41 // Class declaration |
40 // Class declaration |
42 class WIDGETS_DLL_EXPORT RadioStationsView : public RadioViewBase |
41 class RadioStationsView : public RadioViewBase |
43 { |
42 { |
44 Q_OBJECT |
43 Q_OBJECT |
45 Q_PROPERTY(HbIcon nowPlayingIcon READ nowPlayingIcon WRITE setNowPlayingIcon) |
44 Q_PROPERTY(HbIcon nowPlayingIcon READ nowPlayingIcon WRITE setNowPlayingIcon) |
46 Q_PROPERTY(HbIcon favoriteIcon READ favoriteIcon WRITE setFavoriteIcon) |
45 Q_PROPERTY(HbIcon favoriteIcon READ favoriteIcon WRITE setFavoriteIcon) |
47 |
46 |
56 void setFavoriteIcon( const HbIcon& favoriteIcon ); |
55 void setFavoriteIcon( const HbIcon& favoriteIcon ); |
57 HbIcon favoriteIcon() const; |
56 HbIcon favoriteIcon() const; |
58 |
57 |
59 private slots: |
58 private slots: |
60 |
59 |
61 void listItemClicked( const QModelIndex& index ); |
60 void handleClick( const QModelIndex& index ); |
62 void listItemLongPressed( HbAbstractViewItem* item, const QPointF& coords ); |
61 void handleLongPress( HbAbstractViewItem* item, const QPointF& coords ); |
63 void updateAntennaStatus( bool connected ); |
62 void updateAntennaStatus( bool connected ); |
64 void updateCurrentStation(); |
63 void updateViewMode(); |
65 void deckButtonPressed(); |
|
66 void startScanning(); |
64 void startScanning(); |
67 void finishScanning(); |
65 void finishScanning(); |
68 void updateControlVisibilities(); |
66 void updateVisibilities(); |
69 void clearList(); |
67 void clearList(); |
|
68 void play(); // Called from context menu |
70 void rename(); // Called from context menu |
69 void rename(); // Called from context menu |
71 void toggleFavorite(); // Called from context menu |
70 void toggleFavorite(); // Called from context menu |
72 void deleteStation(); // Called from context menu |
71 void deleteStation(); // Called from context menu |
73 void renameDone( HbAction* action ); |
72 void renameDone( HbAction* action ); |
74 |
73 |
77 // from base class RadioViewBase |
76 // from base class RadioViewBase |
78 |
77 |
79 void init(); |
78 void init(); |
80 void userAccepted(); |
79 void userAccepted(); |
81 |
80 |
82 // from base class QGraphicsWidget |
|
83 |
|
84 void showEvent( QShowEvent* event ); |
|
85 |
|
86 // New functions |
81 // New functions |
87 |
82 |
88 void initListView(); |
83 void initListView(); |
89 |
84 |
90 private: //data |
85 private: //data |
91 |
86 |
92 RadioStationModel* mModel; |
87 RadioStationModel* mModel; |
93 |
88 |
94 RadioStationFilterModel* mFilterModel; |
89 QSortFilterProxyModel* mFilterModel; |
95 |
90 |
96 HbAction* mScanStationsAction; |
91 HbAction* mScanStationsAction; |
97 HbAction* mClearListAction; |
92 HbAction* mClearListAction; |
98 |
93 |
99 HbListView* mStationsList; |
94 HbListView* mStationsList; |
100 |
|
101 RadioBannerLabel* mHeadingBanner; |
|
102 |
95 |
103 HbAction* mFavoritesButton; |
96 HbAction* mFavoritesButton; |
104 HbAction* mLocalStationsButton; |
97 HbAction* mLocalStationsButton; |
105 |
98 |
106 HbIcon mFavoriteIcon; |
99 HbIcon mFavoriteIcon; |