9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Handles collection Open operation related functionality* |
14 * Description: Handles collection Open operation related functionality |
|
15 * |
15 */ |
16 */ |
16 |
|
17 |
17 |
18 |
18 |
19 #ifndef VCXMYVIDEOSOPENHANDLER_H |
19 #ifndef VCXMYVIDEOSOPENHANDLER_H |
20 #define VCXMYVIDEOSOPENHANDLER_H |
20 #define VCXMYVIDEOSOPENHANDLER_H |
21 |
21 |
22 class CVcxMyVideosCollectionPlugin; |
22 class CVcxMyVideosCollectionPlugin; |
23 class MMPXCollectionPluginObserver; |
23 class MMPXCollectionPluginObserver; |
24 class CVcxMyVideosMdsDb; |
24 class CVcxMyVideosMdsDb; |
25 |
25 |
|
26 #include "vcxmyvideosmdsdb.h" |
26 /** |
27 /** |
27 */ |
28 */ |
28 NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase |
29 NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase, public MVcxMyVideosMdsAlbumsObserver |
29 { |
30 { |
30 friend class CVcxMyVideosVideoCache; |
31 friend class CVcxMyVideosVideoCache; |
31 |
32 |
32 public: |
33 public: |
|
34 |
33 /** |
35 /** |
34 * Two-phased constructor |
36 * Two-phased constructor |
35 */ |
37 */ |
36 static CVcxMyVideosOpenHandler* NewL( CVcxMyVideosCollectionPlugin& aCollection, |
38 static CVcxMyVideosOpenHandler* NewL( CVcxMyVideosCollectionPlugin& aCollection, |
37 CVcxMyVideosVideoCache& aCache, |
39 CVcxMyVideosVideoCache& aCache, |
50 * @param aPath Path to open. |
52 * @param aPath Path to open. |
51 */ |
53 */ |
52 void OpenL( const CMPXCollectionPath& aPath ); |
54 void OpenL( const CMPXCollectionPath& aPath ); |
53 |
55 |
54 /** |
56 /** |
55 * Leaving version of HandleCreateVideoListResp. |
57 * From MVcxMyVideosMdsAlbumsObserver. |
56 * Handler function for list fetching events. This callback is called as a response |
58 */ |
57 * to iCache.CreateVideoListL(). |
59 void HandleAlbumOpenL(); |
58 * |
60 |
59 * @param aVideoList List of videos fetched from MDS. |
61 /** |
60 * @param aNewItemsStartIndex Start position for the new items added. |
62 * From MVcxMyVideosMdsAlbumsObserver, no implementation. |
61 * @param aComplete ETrue if list is complete and no more items are expected, |
63 */ |
62 * EFalse if there are more to come. |
64 void HandleGetAlbumsResp( CMPXMedia* /*aAlbumList*/ ) {} |
63 */ |
65 |
|
66 /** |
|
67 * From MVcxMyVideosMdsAlbumsObserver, no implementation. |
|
68 */ |
|
69 void HandleGetAlbumContentIdsResp( TUint32 /*aAlbumId*/, |
|
70 RArray<TVcxMyVideosAlbumVideo>& /*aContentArray*/ ) {} |
|
71 |
|
72 /** |
|
73 * From MVcxMyVideosMdsAlbumsObserver, no implementation. |
|
74 */ |
|
75 void HandleAddVideosToAlbumResp( CMPXMedia* /*aCmd*/, |
|
76 RPointerArray<CMdEInstanceItem>& /*aItemArray*/ ) {} |
|
77 |
|
78 /** |
|
79 * From MVcxMyVideosMdsAlbumsObserver, no implementation. |
|
80 */ |
|
81 void HandleRemoveRelationsResp( RArray<TUint32>& /*aRelationIds*/, |
|
82 RArray<TUint32>& /*aResults*/ ) {} |
|
83 |
|
84 /** |
|
85 * From MVcxMyVideosMdsAlbumsObserver, no implementation. |
|
86 */ |
|
87 void HandleRemoveAlbumsResp( CMPXMedia* /*aCmd*/, |
|
88 RArray<TUint32>& /*aResultIds*/ ) {} |
|
89 |
|
90 /** |
|
91 * From MVcxMyVideosMdsAlbumsObserver, no implementation. |
|
92 */ |
|
93 void HandleRelationEvent( TObserverNotificationType /*aType*/, |
|
94 const RArray<TMdERelation>& /*aRelationArray*/ ) {} |
|
95 |
|
96 /** |
|
97 * Called as a response to GetAlbumContentVideosL. |
|
98 * |
|
99 * @param aAlbumId ID of the album containing the result videos. |
|
100 * @param aVideoList Media containing array of videos. |
|
101 * @param aError Error code in case of failure. |
|
102 * @param aFirstNewItemIndex Index of the first new item. |
|
103 * @param aNewItemCount How many new items in the query since the last results. |
|
104 * @param aComplete ETrue if query is complete, EFalse if there is more to come. |
|
105 */ |
|
106 void HandleGetAlbumContentVideosResp( TUint32 aAlbumId, CMPXMedia& aVideoList, |
|
107 TInt aError, TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete ); |
|
108 |
|
109 |
64 void DoHandleCreateVideoListRespL( |
110 void DoHandleCreateVideoListRespL( |
65 CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete ); |
111 CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete ); |
66 |
112 |
67 private: |
113 private: |
68 /** |
114 /** |
69 * 2nd-phase Constructor |
115 * 2nd-phase Constructor |
70 */ |
116 */ |
71 void ConstructL(); |
117 void ConstructL(); |
75 */ |
121 */ |
76 CVcxMyVideosOpenHandler( CVcxMyVideosCollectionPlugin& aCollection, |
122 CVcxMyVideosOpenHandler( CVcxMyVideosCollectionPlugin& aCollection, |
77 CVcxMyVideosVideoCache& aCache, |
123 CVcxMyVideosVideoCache& aCache, |
78 CVcxMyVideosMdsDb& aMds ); |
124 CVcxMyVideosMdsDb& aMds ); |
79 |
125 |
|
126 /** |
|
127 * Opens category. |
|
128 * |
|
129 * @param aCategoryId Category to open. |
|
130 */ |
|
131 void OpenCategoryL( TUint32 aCategoryId ); |
|
132 |
|
133 /** |
|
134 * Leaving version of HandleGetAlbumContentVideosResp. |
|
135 */ |
|
136 void HandleGetAlbumContentVideosRespL( |
|
137 TUint32 aAlbumId, CMPXMedia& /*aVideoList*/, TInt aError, |
|
138 TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/, TBool aComplete ); |
|
139 public: |
|
140 |
|
141 /** |
|
142 * If album is opened when the album list is not yet complete, |
|
143 * then the album ID which is tried to open is stored here. |
|
144 * The open processing is continued when album list is received |
|
145 * from MDS. There can't be several album opens pending since |
|
146 * we do not call HandleOpen before we get the album list. |
|
147 */ |
|
148 TUint32 iPendingAlbumOpenId; |
|
149 |
|
150 /** |
|
151 * for testing, temp |
|
152 */ |
|
153 CMPXMedia* iAlbumVideoList; |
|
154 |
80 private: // data |
155 private: // data |
81 |
156 |
82 /** |
157 /** |
83 * Collection plugin main class. Owner of this object. |
158 * Collection plugin main class. Owner of this object. |
84 */ |
159 */ |
106 /** |
181 /** |
107 * Video lists for categories being opened are stored here. |
182 * Video lists for categories being opened are stored here. |
108 * This is in sync with iCategoryIdsBeingOpened. |
183 * This is in sync with iCategoryIdsBeingOpened. |
109 */ |
184 */ |
110 RArray<CMPXMedia*> iVideoListsBeingOpened; |
185 RArray<CMPXMedia*> iVideoListsBeingOpened; |
|
186 |
|
187 /** |
|
188 * The album IDs being opened are stored here. These values are used |
|
189 * to filter list when items arrive from MDS. |
|
190 * This is in sync with iAlbumVideoListsBeingOpened. |
|
191 */ |
|
192 RArray<TInt> iAlbumIdsBeingOpened; |
|
193 |
|
194 /** |
|
195 * Video lists for albums being opened are stored here. |
|
196 * This is in sync with iAlbumIdsBeingOpened. |
|
197 */ |
|
198 RArray<CMPXMedia*> iAlbumVideoListsBeingOpened; |
|
199 |
|
200 /** |
|
201 * Path being opened is stored here for the HandleOpenL call. |
|
202 * Not Own. |
|
203 */ |
|
204 const CMPXCollectionPath* iPath; |
|
205 |
111 }; |
206 }; |
112 |
207 |
113 #endif // VCXMYVIDEOSACTIVETASK_H |
208 #endif // VCXMYVIDEOSACTIVETASK_H |