|
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 <hbeffect.h> |
|
24 |
|
25 #include "mpviewbase.h" |
|
26 #include "mpmpxcollectionviewdefs.h" |
|
27 |
|
28 class QActionGroup; |
|
29 class HbMainWindow; |
|
30 class HbAction; |
|
31 class HbMenu; |
|
32 class HbToolBar; |
|
33 class MpCollectionDocumentLoader; |
|
34 class MpCollectionContainerFactory; |
|
35 class MpCollectionContainer; |
|
36 class MpCollectionDataModel; |
|
37 class MpEngine; |
|
38 class MpMpxCollectionData; |
|
39 class MpNowPlayingWidget; |
|
40 class MpSnapshotWidget; |
|
41 class MpCollectionPopupHandler; |
|
42 |
|
43 class MpCollectionView : public MpViewBase |
|
44 { |
|
45 Q_OBJECT |
|
46 |
|
47 public: |
|
48 |
|
49 MpCollectionView(); |
|
50 virtual ~MpCollectionView(); |
|
51 |
|
52 void initializeView(); |
|
53 void activateView(); |
|
54 void deactivateView(); |
|
55 bool isActivated(); |
|
56 void openItem( int index ); |
|
57 void showItemDetails( int index ); |
|
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 openAlbums(); |
|
70 void openPlaylists(); |
|
71 void find(); |
|
72 void openMusicStore(); |
|
73 |
|
74 void openIndex( int index ); |
|
75 void findAlbumSongs( int index ); |
|
76 void playAlbumSongs( int albumIndex, int songIndex ); |
|
77 |
|
78 void back(); |
|
79 void exit(); |
|
80 |
|
81 void startPlaybackView(); |
|
82 void attachNowPlayingBanner( bool active ); |
|
83 void containerTransitionComplete( const HbEffect::EffectStatus &status ); |
|
84 |
|
85 void shufflePlayAll(); |
|
86 void addToPlaylist(); |
|
87 void deleteSongs(); |
|
88 void renameCurrentPlaylistContainer(); |
|
89 |
|
90 void playlistSaved( bool success ); |
|
91 void songsDeleted( bool success ); |
|
92 void playlistsRenamed( bool success ); |
|
93 |
|
94 void prepareToAddToPlaylist(); |
|
95 void handleIsolatedCollectionOpened( MpMpxCollectionData* collectionData ); |
|
96 void arrangeSongs(); |
|
97 void openContextMenu( int index, const QPointF &coords ); |
|
98 |
|
99 void handleUsbBlocked( bool blocked ); |
|
100 void handleLibraryAboutToUpdate(); |
|
101 void handleLibraryUpdated(); |
|
102 |
|
103 void setShuffleAction( bool enabled ); |
|
104 |
|
105 void containerDataChanged(); |
|
106 |
|
107 private: |
|
108 |
|
109 void setMainToolBar(); |
|
110 void setPlaylistToolBar(); |
|
111 |
|
112 HbAction *createToolBarAction( QActionGroup *actionsGroup, |
|
113 const QString& icon, const QString& objectName ); |
|
114 |
|
115 void updateMenu(); |
|
116 void addDefaultMenuOptions( HbMenu *menu, bool optRefresh, bool optExit ); |
|
117 void updateToolBar(); |
|
118 void setSoftkey(); |
|
119 |
|
120 void setBannerVisibility( bool visible ); |
|
121 int generateShuffleIndex(); |
|
122 void startContainerTransition( TCollectionContext contextFrom, TCollectionContext contextTo ); |
|
123 void closeActiveDialog( bool onlyContextMenu = false ); |
|
124 void showCorruptedNote(); |
|
125 |
|
126 private: |
|
127 |
|
128 TCollectionContext mCollectionContext; |
|
129 |
|
130 MpEngine *mMpEngine; // Not own |
|
131 MpMpxCollectionData *mCollectionData; // Not own |
|
132 |
|
133 MpCollectionContainerFactory *mContainerFactory; // Own |
|
134 MpCollectionContainer *mCollectionContainer; // Not own |
|
135 MpCollectionDataModel *mCollectionDataModel; // Own |
|
136 |
|
137 bool mActivated; |
|
138 MpNowPlayingWidget *mNowPlayingBanner; // Own |
|
139 bool mBannerAttached; |
|
140 |
|
141 HbMainWindow *mWindow; // Not own |
|
142 HbAction *mSoftKeyQuit; // Not own |
|
143 HbAction *mSoftKeyBack; // Not own |
|
144 HbAction *mShuffleAction; // Not own |
|
145 bool mShuffleEnabled; |
|
146 |
|
147 MpCollectionDocumentLoader *mDocumentLoader; // Own |
|
148 HbWidget *mMainContainer; // Own |
|
149 |
|
150 HbToolBar *mMainToolBar; |
|
151 HbToolBar *mPlaylistToolBar; |
|
152 |
|
153 MpSnapshotWidget *mSnapshot; |
|
154 |
|
155 bool mActivationWaiting; |
|
156 MpCollectionPopupHandler *mMpPopupHandler; // Own |
|
157 |
|
158 bool mUsbBlocked; |
|
159 |
|
160 }; |
|
161 |
|
162 #endif // MPCOLLECTIONVIEW_H |
|
163 |