|
1 /* |
|
2 * Copyright (c) 2007 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 the License "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: Handles collection Open operation related functionality |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VCXMYVIDEOSOPENHANDLER_H |
|
20 #define VCXMYVIDEOSOPENHANDLER_H |
|
21 |
|
22 class CVcxMyVideosCollectionPlugin; |
|
23 class MMPXCollectionPluginObserver; |
|
24 class CVcxMyVideosMdsDb; |
|
25 |
|
26 #include "vcxmyvideosmdsdb_stub.h" |
|
27 /** |
|
28 */ |
|
29 NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase, public MVcxMyVideosMdsAlbumsObserver |
|
30 { |
|
31 friend class CVcxMyVideosVideoCache; |
|
32 |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Two-phased constructor |
|
37 */ |
|
38 static CVcxMyVideosOpenHandler* NewL( CVcxMyVideosCollectionPlugin& aCollection, |
|
39 CVcxMyVideosVideoCache& aCache, |
|
40 CVcxMyVideosMdsDb& aMds ); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 virtual ~CVcxMyVideosOpenHandler(); |
|
46 |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Handle collection Open operation. |
|
51 * |
|
52 * @param aPath Path to open. |
|
53 */ |
|
54 void OpenL( const CMPXCollectionPath& aPath ); |
|
55 |
|
56 /** |
|
57 * From MVcxMyVideosMdsAlbumsObserver. |
|
58 */ |
|
59 void HandleAlbumOpenL(); |
|
60 |
|
61 /** |
|
62 * From MVcxMyVideosMdsAlbumsObserver, no implementation. |
|
63 */ |
|
64 void HandleGetAlbumsResp( CMPXMedia* /*aAlbumList*/ ) {} |
|
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 |
|
110 void DoHandleCreateVideoListRespL( |
|
111 CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete ); |
|
112 |
|
113 private: |
|
114 /** |
|
115 * 2nd-phase Constructor |
|
116 */ |
|
117 void ConstructL(); |
|
118 |
|
119 /** |
|
120 * Default Constructor |
|
121 */ |
|
122 CVcxMyVideosOpenHandler( CVcxMyVideosCollectionPlugin& aCollection, |
|
123 CVcxMyVideosVideoCache& aCache, |
|
124 CVcxMyVideosMdsDb& aMds ); |
|
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 |
|
155 private: // data |
|
156 |
|
157 /** |
|
158 * Collection plugin main class. Owner of this object. |
|
159 */ |
|
160 CVcxMyVideosCollectionPlugin& iCollection; |
|
161 |
|
162 /** |
|
163 * Videos cache, owned by iCollection. Reference is stored here |
|
164 * just to avoid one pointer access. |
|
165 */ |
|
166 CVcxMyVideosVideoCache& iCache; |
|
167 |
|
168 /** |
|
169 * Object for accessing MDS database, owned by iCollection. Reference is stored here |
|
170 * just to avoid one pointer access. |
|
171 */ |
|
172 CVcxMyVideosMdsDb& iMds; |
|
173 |
|
174 /** |
|
175 * The category ids being opened are stored here. These values are used |
|
176 * to filter list when items arrive from MDS. KVcxMvcCategoryIdAll category is not listed here. |
|
177 * This is in sync with iVideoListsBeingOpened. |
|
178 */ |
|
179 RArray<TInt> iCategoryIdsBeingOpened; |
|
180 |
|
181 /** |
|
182 * Video lists for categories being opened are stored here. |
|
183 * This is in sync with iCategoryIdsBeingOpened. |
|
184 */ |
|
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 |
|
206 public: // Friend classes |
|
207 |
|
208 friend class CCollectionPluginTest; |
|
209 |
|
210 }; |
|
211 |
|
212 #endif // VCXMYVIDEOSACTIVETASK_H |