|
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 RADIOSTATIONSVIEW_H |
|
19 #define RADIOSTATIONSVIEW_H |
|
20 |
|
21 // System includes |
|
22 #include <HbIcon> |
|
23 #include <QScopedPointer> |
|
24 |
|
25 // User includes |
|
26 #include "radioviewbase.h" |
|
27 |
|
28 // Forward declarations |
|
29 class RadioWindow; |
|
30 class RadioStationModel; |
|
31 class HbListView; |
|
32 class HbPushButton; |
|
33 class HbAbstractViewItem; |
|
34 class RadioUiLoader; |
|
35 class RadioStation; |
|
36 class RadioStationFilterModel; |
|
37 class RadioFrequencyScanner; |
|
38 class QSortFilterProxyModel; |
|
39 |
|
40 // Class declaration |
|
41 class RadioStationsView : public RadioViewBase |
|
42 { |
|
43 Q_OBJECT |
|
44 Q_PROPERTY(HbIcon nowPlayingIcon READ nowPlayingIcon WRITE setNowPlayingIcon) |
|
45 Q_PROPERTY(HbIcon favoriteIcon READ favoriteIcon WRITE setFavoriteIcon) |
|
46 |
|
47 public: |
|
48 |
|
49 explicit RadioStationsView(); |
|
50 ~RadioStationsView(); |
|
51 |
|
52 void setNowPlayingIcon( const HbIcon& nowPlayingIcon ); |
|
53 HbIcon nowPlayingIcon() const; |
|
54 |
|
55 void setFavoriteIcon( const HbIcon& favoriteIcon ); |
|
56 HbIcon favoriteIcon() const; |
|
57 |
|
58 private slots: |
|
59 |
|
60 void handleClick( const QModelIndex& index ); |
|
61 void handleLongPress( HbAbstractViewItem* item, const QPointF& coords ); |
|
62 void updateAntennaStatus( bool connected ); |
|
63 void updateViewMode(); |
|
64 void startScanning(); |
|
65 void finishScanning(); |
|
66 void updateVisibilities(); |
|
67 void clearList(); |
|
68 void play(); // Called from context menu |
|
69 void rename(); // Called from context menu |
|
70 void toggleFavorite(); // Called from context menu |
|
71 void deleteStation(); // Called from context menu |
|
72 void renameDone( HbAction* action ); |
|
73 |
|
74 private: |
|
75 |
|
76 // from base class RadioViewBase |
|
77 |
|
78 void init(); |
|
79 void userAccepted(); |
|
80 |
|
81 // New functions |
|
82 |
|
83 void initListView(); |
|
84 |
|
85 private: //data |
|
86 |
|
87 RadioStationModel* mModel; |
|
88 |
|
89 QSortFilterProxyModel* mFilterModel; |
|
90 |
|
91 HbAction* mScanStationsAction; |
|
92 HbAction* mClearListAction; |
|
93 |
|
94 HbListView* mStationsList; |
|
95 |
|
96 HbAction* mFavoritesButton; |
|
97 HbAction* mLocalStationsButton; |
|
98 |
|
99 HbIcon mFavoriteIcon; |
|
100 HbIcon mNowPlayingIcon; |
|
101 |
|
102 QScopedPointer<RadioStation> mSelectedStation; |
|
103 |
|
104 QScopedPointer<RadioFrequencyScanner> mFrequencyScanner; |
|
105 |
|
106 enum UserQuestion { NoQuestion, DeleteStation, StartScanning, ClearList }; |
|
107 UserQuestion mCurrentQuestion; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif // RADIOSTATIONSVIEW_H |