author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 23 Jun 2010 18:12:57 +0300 | |
changeset 32 | 189d20c34778 |
parent 28 | 075425b8d9a4 |
child 33 | 11b6825f0862 |
permissions | -rw-r--r-- |
24 | 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; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
38 |
class QSortFilterProxyModel; |
24 | 39 |
|
40 |
// Class declaration |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
41 |
class RadioStationsView : public RadioViewBase |
24 | 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 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
60 |
void handleClick( const QModelIndex& index ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
61 |
void handleLongPress( HbAbstractViewItem* item, const QPointF& coords ); |
24 | 62 |
void updateAntennaStatus( bool connected ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
63 |
void updateViewMode(); |
24 | 64 |
void startScanning(); |
65 |
void finishScanning(); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
66 |
void updateVisibilities(); |
24 | 67 |
void clearList(); |
68 |
void rename(); // Called from context menu |
|
69 |
void toggleFavorite(); // Called from context menu |
|
70 |
void deleteStation(); // Called from context menu |
|
71 |
void renameDone( HbAction* action ); |
|
72 |
||
73 |
private: |
|
74 |
||
75 |
// from base class RadioViewBase |
|
76 |
||
77 |
void init(); |
|
78 |
void userAccepted(); |
|
79 |
||
80 |
// New functions |
|
81 |
||
82 |
void initListView(); |
|
83 |
||
84 |
private: //data |
|
85 |
||
86 |
RadioStationModel* mModel; |
|
87 |
||
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
88 |
QSortFilterProxyModel* mFilterModel; |
24 | 89 |
|
90 |
HbAction* mScanStationsAction; |
|
91 |
HbAction* mClearListAction; |
|
92 |
||
93 |
HbListView* mStationsList; |
|
94 |
||
95 |
HbAction* mFavoritesButton; |
|
96 |
HbAction* mLocalStationsButton; |
|
97 |
||
98 |
HbIcon mFavoriteIcon; |
|
99 |
HbIcon mNowPlayingIcon; |
|
100 |
||
101 |
QScopedPointer<RadioStation> mSelectedStation; |
|
102 |
||
103 |
QScopedPointer<RadioFrequencyScanner> mFrequencyScanner; |
|
104 |
||
105 |
enum UserQuestion { NoQuestion, DeleteStation, StartScanning, ClearList }; |
|
106 |
UserQuestion mCurrentQuestion; |
|
107 |
||
108 |
}; |
|
109 |
||
110 |
#endif // RADIOSTATIONSVIEW_H |