author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 11 Jun 2010 13:38:32 +0300 | |
changeset 28 | 075425b8d9a4 |
parent 24 | 6df133bd92e1 |
child 32 | 189d20c34778 |
child 34 | bc10a61bd7d3 |
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> |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
24 |
#include <QPointer> |
24 | 25 |
|
26 |
// User includes |
|
27 |
#include "radioviewbase.h" |
|
28 |
||
29 |
// Forward declarations |
|
30 |
class RadioWindow; |
|
31 |
class RadioStationModel; |
|
32 |
class HbListView; |
|
33 |
class HbPushButton; |
|
34 |
class HbAbstractViewItem; |
|
35 |
class RadioUiLoader; |
|
36 |
class RadioStation; |
|
37 |
class RadioStationFilterModel; |
|
38 |
class RadioFrequencyScanner; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
39 |
class QSortFilterProxyModel; |
24 | 40 |
|
41 |
// Class declaration |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
42 |
class RadioStationsView : public RadioViewBase |
24 | 43 |
{ |
44 |
Q_OBJECT |
|
45 |
Q_PROPERTY(HbIcon nowPlayingIcon READ nowPlayingIcon WRITE setNowPlayingIcon) |
|
46 |
Q_PROPERTY(HbIcon favoriteIcon READ favoriteIcon WRITE setFavoriteIcon) |
|
47 |
||
48 |
public: |
|
49 |
||
50 |
explicit RadioStationsView(); |
|
51 |
~RadioStationsView(); |
|
52 |
||
53 |
void setNowPlayingIcon( const HbIcon& nowPlayingIcon ); |
|
54 |
HbIcon nowPlayingIcon() const; |
|
55 |
||
56 |
void setFavoriteIcon( const HbIcon& favoriteIcon ); |
|
57 |
HbIcon favoriteIcon() const; |
|
58 |
||
59 |
private slots: |
|
60 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
61 |
void handleClick( const QModelIndex& index ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
62 |
void handleLongPress( HbAbstractViewItem* item, const QPointF& coords ); |
24 | 63 |
void updateAntennaStatus( bool connected ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
64 |
void updateViewMode(); |
24 | 65 |
void startScanning(); |
66 |
void finishScanning(); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
67 |
void updateVisibilities(); |
24 | 68 |
void clearList(); |
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 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
89 |
QPointer<QSortFilterProxyModel> mFilterModel; |
24 | 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 |