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