|
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 #include "mpcommondefs.h" |
|
28 |
|
29 class MMPXCollectionUtility; |
|
30 class MMPXCollectionUiHelper; |
|
31 class CMPXCollectionOpenUtility; |
|
32 class MMPXPlaybackUtility; |
|
33 class MpMpxCollectionData; |
|
34 class MpMpxCollectionFrameworkWrapper; |
|
35 class QStringList; |
|
36 |
|
37 |
|
38 class MpMpxCollectionFrameworkWrapperPrivate : public MMPXCollectionObserver, |
|
39 public MMPXCHelperObserver, |
|
40 public MMpMpxIsolatedCollectionHelperObserver |
|
41 { |
|
42 public: |
|
43 |
|
44 explicit MpMpxCollectionFrameworkWrapperPrivate( MpMpxCollectionFrameworkWrapper *wrapper ); |
|
45 virtual ~MpMpxCollectionFrameworkWrapperPrivate(); |
|
46 |
|
47 void init( MpCommon::MpViewMode viewMode, TUid hostUid ); |
|
48 void openCollection( TCollectionContext context ); |
|
49 void openCollectionItem( int index ); |
|
50 void reopenCollection(); |
|
51 void back(); |
|
52 void findPlaylists( QStringList &playlists ); |
|
53 void createPlaylist( QString &playlistName, QList<int> &selection, MpMpxCollectionData *collectionData ); |
|
54 void saveToPlaylist( int playlistIndex, QList<int> &selection ); |
|
55 void saveToCurrentPlaylist( QList<int> &selection, MpMpxCollectionData *collectionData ); |
|
56 void deleteSongs( QList<int> &selection ); |
|
57 void renamePlaylist( QString &newName, int index ); |
|
58 void renamePlaylist( QString &newName ); |
|
59 void setShuffle( bool active ); |
|
60 void previewItem( int index ); |
|
61 void openIsolatedCollection( TCollectionContext context ); |
|
62 void releaseIsolatedCollection(); |
|
63 void reorderPlaylist( int playlistId, int songId, int originalOrdinal, int newOrdinal ); |
|
64 |
|
65 MpMpxCollectionData *collectionData(); |
|
66 |
|
67 private: |
|
68 |
|
69 |
|
70 void HandleOpenL( const CMPXMedia& aEntries, |
|
71 TInt aIndex,TBool aComplete,TInt aError ); |
|
72 void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist,TInt aError ); |
|
73 void HandleCollectionMessage( CMPXMessage* aMsg, TInt aErr ); |
|
74 void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError ); |
|
75 void HandleOperationCompleteL( TCHelperOperation aOperation, TInt aErr, void* aArgument ); |
|
76 void HandleIsolatedOpenL( const CMPXMedia& aEntries, TInt aError ); |
|
77 |
|
78 void DoInitL(); |
|
79 void DoOpenCollectionL( TCollectionContext aContext ); |
|
80 void DoOpenCollectionItemL( TInt aIndex ); |
|
81 void DoIncrementalOpenL(); |
|
82 void DoReopenCollectionL(); |
|
83 void DoBackL(); |
|
84 void DoFindPlaylistsL( QStringList &playlists ); |
|
85 void DoSaveToPlaylistL( TMPXItemId playlistId, QList<int> &selection, MpMpxCollectionData *collectionData ); |
|
86 void DoCreatePlaylistL( QString &playlistName, QList<int> &selection, MpMpxCollectionData* collectionData ); |
|
87 void DoSaveToPlaylistL( int playlistIndex, QList<int> &selection ); |
|
88 |
|
89 void DoDeleteSongsL( QList<int> &selection ); |
|
90 void DoRenamePlaylistL( QString &newName, int index ); |
|
91 void DoRenamePlaylistL( QString &newname ); |
|
92 void DoRenamePlaylistL( TMPXItemId id, QString &newName ); |
|
93 void DoSaveToCurrentPlaylistL( QList<int> &selection, MpMpxCollectionData *collectionData ); |
|
94 void DoSetShuffleL( bool active ); |
|
95 void DoPreviewItemL( int index ); |
|
96 void DoOpenIsolatedCollectionL( TCollectionContext context ); |
|
97 void DoReorderPlaylistL( int playlistId, int songId, int originalOrdinal, int newOrdinal ); |
|
98 void DoHandleCollectionMessageL( const CMPXMessage& aMsg ); |
|
99 |
|
100 void PreparePlaylistMediaL( CMPXMedia& aMedia, QList<int> &selection, MpMpxCollectionData *collectionData ); |
|
101 |
|
102 private: |
|
103 |
|
104 MpMpxCollectionFrameworkWrapper *q_ptr; |
|
105 |
|
106 MMPXCollectionUtility *iCollectionUtility; |
|
107 MMPXCollectionUiHelper *iCollectionUiHelper; |
|
108 CMPXCollectionOpenUtility *iIncrementalOpenUtil; |
|
109 CMpMpxIsolatedCollectionHelper *iIsolatedCollectionHelper; |
|
110 MMPXPlaybackUtility *iPlaybackUtility; |
|
111 MpMpxCollectionData *iCollectionData; // Owned |
|
112 MpMpxCollectionData *iIsolatedCollectionData; // Owned |
|
113 TBool iFirstIncrementalOpen; |
|
114 CMPXMedia *iUserPlaylists; // Owned |
|
115 TInt iNumItemsAdded; |
|
116 MpCommon::MpViewMode iViewMode; |
|
117 TUid mHostUid; |
|
118 |
|
119 }; |
|
120 |
|
121 #endif // MPMPXCOLLECTIONFRAMEWORKWRAPPER_P_H |
|
122 |