|
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: Music Player collection view. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MPCOLLECTIONVIEW_H |
|
19 #define MPCOLLECTIONVIEW_H |
|
20 |
|
21 #include <QObject> |
|
22 |
|
23 #include <hbview.h> |
|
24 #include <hbeffect.h> |
|
25 |
|
26 #include "mpmpxcollectionviewdefs.h" |
|
27 #include "mpviewbase.h" |
|
28 |
|
29 class QActionGroup; |
|
30 class HbMainWindow; |
|
31 class HbAction; |
|
32 class HbMenu; |
|
33 class HbToolBar; |
|
34 class MpCollectionDocumentLoader; |
|
35 class MpCollectionContainerFactory; |
|
36 class MpCollectionContainer; |
|
37 class MpCollectionDataModel; |
|
38 class MpMpxFrameworkWrapper; |
|
39 class MpMpxCollectionData; |
|
40 class MpNowPlayingWidget; |
|
41 class MpSnapshotWidget; |
|
42 class MpCollectionSongScanner; |
|
43 |
|
44 class MpCollectionView : public MpViewBase |
|
45 { |
|
46 Q_OBJECT |
|
47 |
|
48 public: |
|
49 |
|
50 MpCollectionView(); |
|
51 virtual ~MpCollectionView(); |
|
52 |
|
53 void initializeView(); |
|
54 void activateView(); |
|
55 void deactivateView(); |
|
56 |
|
57 void orientationChange( Qt::Orientation orientation ); |
|
58 |
|
59 signals: |
|
60 |
|
61 void command( int command ); |
|
62 |
|
63 public slots: |
|
64 |
|
65 void setContext( TCollectionContext context ); |
|
66 |
|
67 void openSongs(); |
|
68 void openArtists(); |
|
69 void openPlaylists(); |
|
70 void openGenres(); |
|
71 void find(); |
|
72 void openMusicStore(); |
|
73 |
|
74 void openIndex( int index ); |
|
75 |
|
76 void back(); |
|
77 void exit(); |
|
78 |
|
79 void startPlaybackView(); |
|
80 void attachNowPlayingBanner( bool active ); |
|
81 void nowPlayingBannerActivated(); |
|
82 void nowPlayingBannerChosenFxComplete1( const HbEffect::EffectStatus &status ); |
|
83 void nowPlayingBannerChosenFxComplete2( const HbEffect::EffectStatus &status ); |
|
84 void containerTransitionComplete( const HbEffect::EffectStatus &status ); |
|
85 |
|
86 void shufflePlayAll(); |
|
87 void refreshLibrary(); |
|
88 void addToPlaylist(); |
|
89 void deleteSongs(); |
|
90 void renameCurrentPlaylistContainer(); |
|
91 |
|
92 void playlistSaved( bool success ); |
|
93 void songsDeleted( bool success ); |
|
94 void playlistsRenamed( bool success ); |
|
95 |
|
96 void handleScanningComplete(); |
|
97 |
|
98 void openContextMenu( int index, const QPointF &coords ); |
|
99 |
|
100 private: |
|
101 |
|
102 void openDefaultViewContextMenu( int index, const QPointF &coords ); |
|
103 void openFetchViewContextMenu( int index, const QPointF &coords ); |
|
104 |
|
105 void setMainToolBar(); |
|
106 void setPlaylistToolBar(); |
|
107 |
|
108 HbAction *createToolBarAction( QActionGroup *actionsGroup, |
|
109 const QString& iconOn, |
|
110 const QString& iconOff, |
|
111 const QString& toolTip ); |
|
112 |
|
113 void updateMenu(); |
|
114 void updateToolBar(); |
|
115 void setSoftkey(); |
|
116 void clearSoftkey(); |
|
117 |
|
118 void setBannerVisibility( bool visible ); |
|
119 int generateShuffleIndex(); |
|
120 void launchAddToPlaylistDialog( QList<int> selection ); |
|
121 void startContainerTransition( TCollectionContext contextFrom, TCollectionContext contextTo ); |
|
122 void requestDelete(QList<int> selection); |
|
123 |
|
124 private: |
|
125 |
|
126 TCollectionContext mCollectionContext; |
|
127 |
|
128 MpMpxFrameworkWrapper *mMpxWrapper; // Own |
|
129 MpMpxCollectionData *mCollectionData; // Not own |
|
130 |
|
131 MpCollectionContainerFactory *mContainerFactory; // Own |
|
132 MpCollectionContainer *mCollectionContainer; // Not own |
|
133 MpCollectionDataModel *mCollectionDataModel; // Own |
|
134 |
|
135 bool mActivated; |
|
136 MpNowPlayingWidget *mNowPlayingBanner; // Own |
|
137 bool mBannerAttached; |
|
138 bool mEffectOnGoing; |
|
139 |
|
140 HbMainWindow *mWindow; // Not own |
|
141 HbAction *mSoftKeyQuit; // Not own |
|
142 HbAction *mSoftKeyBack; // Not own |
|
143 |
|
144 MpCollectionDocumentLoader *mDocumentLoader; // Own |
|
145 HbWidget *mMainContainer; // Own |
|
146 |
|
147 HbToolBar *mMainToolBar; |
|
148 HbToolBar *mPlaylistToolBar; |
|
149 |
|
150 MpSnapshotWidget *mSnapshot; |
|
151 MpCollectionSongScanner *mSongScanner; // Own |
|
152 bool mScanning; |
|
153 |
|
154 }; |
|
155 |
|
156 #endif // MPCOLLECTIONVIEW_H |
|
157 |