22 #include <mpxcollectionobserver.h> |
22 #include <mpxcollectionobserver.h> |
23 #include <mpxcollectionuihelperobserver.h> |
23 #include <mpxcollectionuihelperobserver.h> |
24 |
24 |
25 #include "mpmpxisolatedcollectionhelper.h" //MMpMpxIsolatedCollectionHelperObserver |
25 #include "mpmpxisolatedcollectionhelper.h" //MMpMpxIsolatedCollectionHelperObserver |
26 #include "mpmpxcollectionviewdefs.h" |
26 #include "mpmpxcollectionviewdefs.h" |
27 #include "mpcommondefs.h" |
27 |
28 |
28 |
29 class MMPXCollectionUtility; |
29 class MMPXCollectionUtility; |
30 class MMPXCollectionUiHelper; |
30 class MMPXCollectionUiHelper; |
31 class CMPXCollectionOpenUtility; |
31 class CMPXCollectionOpenUtility; |
32 class MMPXPlaybackUtility; |
32 class MMPXPlaybackUtility; |
35 class QStringList; |
35 class QStringList; |
36 |
36 |
37 |
37 |
38 class MpMpxCollectionFrameworkWrapperPrivate : public MMPXCollectionObserver, |
38 class MpMpxCollectionFrameworkWrapperPrivate : public MMPXCollectionObserver, |
39 public MMPXCHelperObserver, |
39 public MMPXCHelperObserver, |
40 public MMpMpxIsolatedCollectionHelperObserver |
40 public MMpMpxIsolatedCollectionHelperObserver, |
|
41 public MMPXCollectionFindObserver |
41 { |
42 { |
|
43 |
|
44 private: |
|
45 //Keep in sync with TMCBrowseType in mpxcollectiondb.hrh |
|
46 enum MpBrowseType{ |
|
47 BrowseAll = 0, |
|
48 BrowsePlaylist, |
|
49 BrowseArtist, |
|
50 BrowseAlbum, |
|
51 BrowsePodcasts, |
|
52 BrowseGenre, |
|
53 BrowseComposer, |
|
54 BrowseAlbumSong, |
|
55 BrowseAlbumMediaWall |
|
56 }; |
|
57 |
42 public: |
58 public: |
43 |
59 |
44 explicit MpMpxCollectionFrameworkWrapperPrivate( MpMpxCollectionFrameworkWrapper *wrapper ); |
60 explicit MpMpxCollectionFrameworkWrapperPrivate( MpMpxCollectionFrameworkWrapper *wrapper ); |
45 virtual ~MpMpxCollectionFrameworkWrapperPrivate(); |
61 virtual ~MpMpxCollectionFrameworkWrapperPrivate(); |
46 |
62 |
47 void init( MpCommon::MpViewMode viewMode, TUid hostUid ); |
63 void init( TUid hostUid ); |
48 void openCollection( TCollectionContext context ); |
64 void openCollection( TCollectionContext context ); |
49 void openCollectionItem( int index ); |
65 void openCollectionItem( int index ); |
50 void reopenCollection(); |
66 void reopenCollection(); |
51 void back(); |
67 void back(); |
52 void findPlaylists( QStringList &playlists ); |
68 void findPlaylists( QStringList &playlists ); |
59 void setShuffle( bool active ); |
75 void setShuffle( bool active ); |
60 void previewItem( int index ); |
76 void previewItem( int index ); |
61 void openIsolatedCollection( TCollectionContext context ); |
77 void openIsolatedCollection( TCollectionContext context ); |
62 void releaseIsolatedCollection(); |
78 void releaseIsolatedCollection(); |
63 void reorderPlaylist( int playlistId, int songId, int originalOrdinal, int newOrdinal ); |
79 void reorderPlaylist( int playlistId, int songId, int originalOrdinal, int newOrdinal ); |
64 |
80 void findAlbumSongs( int index ); |
|
81 void playAlbumSongs( int albumIndex, int songIndex, MpMpxCollectionData* collectionData ); |
|
82 void setRepeatFeatureEnabled( bool enable ); |
|
83 void setShuffleFeatureEnabled( bool enable ); |
|
84 void cancel(); |
|
85 |
65 MpMpxCollectionData *collectionData(); |
86 MpMpxCollectionData *collectionData(); |
|
87 void openShuffleAllSongsPath(); |
|
88 |
|
89 void savePath( QByteArray &data ); |
|
90 void restorePath( const QByteArray &data ); |
66 |
91 |
67 private: |
92 private: |
68 |
93 |
69 |
94 |
70 void HandleOpenL( const CMPXMedia& aEntries, |
95 void HandleOpenL( const CMPXMedia& aEntries, |
72 void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist,TInt aError ); |
97 void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist,TInt aError ); |
73 void HandleCollectionMessage( CMPXMessage* aMsg, TInt aErr ); |
98 void HandleCollectionMessage( CMPXMessage* aMsg, TInt aErr ); |
74 void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError ); |
99 void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError ); |
75 void HandleOperationCompleteL( TCHelperOperation aOperation, TInt aErr, void* aArgument ); |
100 void HandleOperationCompleteL( TCHelperOperation aOperation, TInt aErr, void* aArgument ); |
76 void HandleIsolatedOpenL( const CMPXMedia& aEntries, TInt aError ); |
101 void HandleIsolatedOpenL( const CMPXMedia& aEntries, TInt aError ); |
77 |
102 void HandleIsolatedOpenRestorePathL( const CMPXCollectionPath& aPath, TInt aError ); |
|
103 void HandleFindAllL( const CMPXMedia& aResults, TBool aComplete, TInt aError ); |
|
104 |
78 void DoInitL(); |
105 void DoInitL(); |
79 void DoOpenCollectionL( TCollectionContext aContext ); |
106 void DoOpenCollectionL( TCollectionContext aContext ); |
80 void DoOpenCollectionItemL( TInt aIndex ); |
107 void DoOpenCollectionItemL( TInt aIndex ); |
81 void DoIncrementalOpenL(); |
108 void DoIncrementalOpenL(); |
82 void DoReopenCollectionL(); |
109 void DoReopenCollectionL(); |
85 void DoSaveToPlaylistL( TMPXItemId playlistId, QList<int> &selection, MpMpxCollectionData *collectionData ); |
112 void DoSaveToPlaylistL( TMPXItemId playlistId, QList<int> &selection, MpMpxCollectionData *collectionData ); |
86 void DoCreatePlaylistL( QString &playlistName, QList<int> &selection, MpMpxCollectionData* collectionData ); |
113 void DoCreatePlaylistL( QString &playlistName, QList<int> &selection, MpMpxCollectionData* collectionData ); |
87 void DoSaveToPlaylistL( int playlistIndex, QList<int> &selection ); |
114 void DoSaveToPlaylistL( int playlistIndex, QList<int> &selection ); |
88 |
115 |
89 void DoDeleteSongsL( QList<int> &selection ); |
116 void DoDeleteSongsL( QList<int> &selection ); |
|
117 void DoDeleteAlbumSongsL( QList<int> &selection ); |
90 void DoRenamePlaylistL( QString &newName, int index ); |
118 void DoRenamePlaylistL( QString &newName, int index ); |
91 void DoRenamePlaylistL( QString &newname ); |
119 void DoRenamePlaylistL( QString &newname ); |
92 void DoRenamePlaylistL( TMPXItemId id, QString &newName ); |
120 void DoRenamePlaylistL( TMPXItemId id, QString &newName ); |
93 void DoSaveToCurrentPlaylistL( QList<int> &selection, MpMpxCollectionData *collectionData ); |
121 void DoSaveToCurrentPlaylistL( QList<int> &selection, MpMpxCollectionData *collectionData ); |
94 void DoSetShuffleL( bool active ); |
122 void DoSetShuffleL( bool active ); |
95 void DoPreviewItemL( int index ); |
123 void DoPreviewSongL( int index ); |
|
124 void DoPreviewAlbumSongL( int index ); |
96 void DoOpenIsolatedCollectionL( TCollectionContext context ); |
125 void DoOpenIsolatedCollectionL( TCollectionContext context ); |
97 void DoReorderPlaylistL( int playlistId, int songId, int originalOrdinal, int newOrdinal ); |
126 void DoReorderPlaylistL( int playlistId, int songId, int originalOrdinal, int newOrdinal ); |
|
127 void DoFindAlbumSongsL( int index ); |
|
128 void DoPlayAlbumSongsL( int albumIndex, int songIndex, MpMpxCollectionData* collectionData ); |
|
129 |
98 void DoHandleCollectionMessageL( const CMPXMessage& aMsg ); |
130 void DoHandleCollectionMessageL( const CMPXMessage& aMsg ); |
|
131 void DoHandleItemChangedMessageL( const CMPXMessage& aMsg ); |
99 |
132 |
100 void PreparePlaylistMediaL( CMPXMedia& aMedia, QList<int> &selection, MpMpxCollectionData *collectionData ); |
133 void PreparePlaylistMediaL( CMPXMedia& aMedia, QList<int> &selection, MpMpxCollectionData *collectionData ); |
|
134 void createPlaybackUtilityL(); |
|
135 void DoPlayAllSongsPlaylistL(); |
|
136 void DoSavePathL( QByteArray &data ); |
|
137 void DoRestorePathL( const QByteArray &data ); |
101 |
138 |
102 private: |
139 private: |
103 |
140 |
104 MpMpxCollectionFrameworkWrapper *q_ptr; |
141 MpMpxCollectionFrameworkWrapper *q_ptr; |
105 |
142 |
111 MpMpxCollectionData *iCollectionData; // Owned |
148 MpMpxCollectionData *iCollectionData; // Owned |
112 MpMpxCollectionData *iIsolatedCollectionData; // Owned |
149 MpMpxCollectionData *iIsolatedCollectionData; // Owned |
113 TBool iFirstIncrementalOpen; |
150 TBool iFirstIncrementalOpen; |
114 CMPXMedia *iUserPlaylists; // Owned |
151 CMPXMedia *iUserPlaylists; // Owned |
115 TInt iNumItemsAdded; |
152 TInt iNumItemsAdded; |
116 MpCommon::MpViewMode iViewMode; |
|
117 TUid mHostUid; |
153 TUid mHostUid; |
|
154 TBool iRepeatFeature; |
|
155 TBool iShuffleFeature; |
|
156 TBool iReopen; |
|
157 TBool iShuffleAll; |
|
158 TBool iRestoreDefaultPath; |
|
159 TInt iRestorePathIndex; |
|
160 TMPXItemId iRestorePathIndexId; |
118 |
161 |
119 }; |
162 }; |
120 |
163 |
121 #endif // MPMPXCOLLECTIONFRAMEWORKWRAPPER_P_H |
164 #endif // MPMPXCOLLECTIONFRAMEWORKWRAPPER_P_H |
122 |
165 |