111 /** |
110 /** |
112 * C++ constructor. |
111 * C++ constructor. |
113 * |
112 * |
114 * @param aMediaList media list |
113 * @param aMediaList media list |
115 */ |
114 */ |
116 CGlxMetadataContainer(MGlxMetadataDialogObserver& aDialogObserver,const TDesC& aUri |
115 CGlxMetadataContainer(MGlxMetadataDialogObserver& aDialogObserver, |
117 ,MToolbarResetObserver& aResetToolbarObs); |
116 MToolbarResetObserver& aResetToolbarObs); |
118 |
117 |
119 /** |
118 /** |
120 * Symbian 2nd phase constructor |
119 * Symbian 2nd phase constructor |
121 * @param aRect rect for this control |
120 * @param aRect rect for this control |
|
121 * @para aUri uri for media item |
122 */ |
122 */ |
123 void ConstructL( const TRect& aRect); |
123 void ConstructL( const TRect& aRect, const TDesC& aUri); |
124 |
124 |
125 /** |
125 /** |
126 * Create media list with URI filter |
126 * Create media list with URI filter |
127 * This function creates the collection path filter and finally the MediaList |
127 * This function creates the collection path filter and finally the MediaList |
128 * |
128 */ |
129 * @param aIsRename If ETrue,then MediaList is created with iModifiedUri |
129 void CreateMediaListForSelectedItemL( ); |
130 * ,if EFalse,then created with iUri |
|
131 */ |
|
132 void CreateMediaListForSelectedItemL(TBool aIsRename = EFalse); |
|
133 /** |
130 /** |
134 * Create media list to get the tags list for the particular Item. |
131 * Create media list to get the tags list for the particular Item. |
135 * This function creates the collection path filter and finally the MediaList |
132 * This function creates the collection path filter and finally the MediaList |
136 * |
133 * |
137 */ |
134 */ |
161 * |
158 * |
162 * @param aTitleText new title entered by user. |
159 * @param aTitleText new title entered by user. |
163 * @return TFileName as modified uri |
160 * @return TFileName as modified uri |
164 */ |
161 */ |
165 TFileName ParseFileName(const TDesC& aTitleText); |
162 TFileName ParseFileName(const TDesC& aTitleText); |
|
163 |
|
164 /** |
|
165 * Refresh MediaList with modified FileName. |
|
166 * |
|
167 * @param aModifiedUri is the new media uri |
|
168 */ |
|
169 void RefreshMediaListL(const TDesC& aModifiedUri); |
|
170 |
166 public: |
171 public: |
167 //MedialistObserver APIS |
172 //MedialistObserver APIS |
168 void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ); |
173 void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ); |
169 void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList*/* aList */); |
174 void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList*/* aList */); |
170 void HandleAttributesAvailableL( TInt aItemIndex, |
175 void HandleAttributesAvailableL( TInt aItemIndex, |
180 void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList ); |
185 void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList ); |
181 void HandleErrorL(); |
186 void HandleErrorL(); |
182 MGlxMediaList& MediaList(); |
187 MGlxMediaList& MediaList(); |
183 void HandleCommandCompleteL(TAny* aSessionId, |
188 void HandleCommandCompleteL(TAny* aSessionId, |
184 CMPXCommand* /*aCommandResult*/, TInt aError, MGlxMediaList* aList); |
189 CMPXCommand* /*aCommandResult*/, TInt aError, MGlxMediaList* aList); |
185 /** |
190 |
186 * Create new mediaList with modified filename. |
191 |
187 */ |
|
188 void RefreshMediaListL(); |
|
189 |
|
190 private: //data |
192 private: //data |
191 |
193 |
192 MGlxMetadataDialogObserver& iDialogObesrver; |
194 MGlxMetadataDialogObserver& iDialogObesrver; |
193 //Flag to check if the item is a video. |
195 //Flag to check if the item is a video. |
194 TBool iVideo; |
196 TBool iVideo; |
198 TBool iSetVisible; |
200 TBool iSetVisible; |
199 TBool iLocationinfo; |
201 TBool iLocationinfo; |
200 RBuf iTextSetter; |
202 RBuf iTextSetter; |
201 RBuf iTagSetter; |
203 RBuf iTagSetter; |
202 RBuf iAlbumSetter; |
204 RBuf iAlbumSetter; |
203 const TDesC& iUri ; |
205 |
|
206 //(Owns) must always represent the media's current uri. |
|
207 HBufC* iUri; |
|
208 |
204 MGlxMediaList* iItemMediaList; |
209 MGlxMediaList* iItemMediaList; |
205 MGlxMediaList* iTagMediaList; |
210 MGlxMediaList* iTagMediaList; |
206 MGlxMediaList* iAlbumMediaList; |
211 MGlxMediaList* iAlbumMediaList; |
207 CGlxDefaultAttributeContext* iAlbumContext; |
212 CGlxDefaultAttributeContext* iAlbumContext; |
208 CGlxDefaultAttributeContext* iTagContext; |
213 CGlxDefaultAttributeContext* iTagContext; |
209 TGlxSelectionIterator iSelectionIterator; |
214 TGlxSelectionIterator iSelectionIterator; |
210 CGlxAttributeContext* iMainListAttributecontext; |
215 CGlxAttributeContext* iMainListAttributecontext; |
211 MToolbarResetObserver& iResetToolbarObs; // observer |
216 MToolbarResetObserver& iResetToolbarObs; // observer |
212 //New variable introduce to hold the modified uri name |
217 |
213 //since iUri is const type. |
218 //Flag to indicate rename command is started |
214 HBufC* iModifiedUri; |
219 TBool iRenameStarted; |
215 CGlxMetadataAsyncUpdate* iAsyncRequest; |
220 |
216 TBool iRenameCompleted; |
|
217 }; |
|
218 |
|
219 /** |
|
220 * CGlxMetadataAsyncUpdate |
|
221 * |
|
222 * Metadata asynchronous update implementation |
|
223 * Asynchronously refreshing the MediaList because it can't be done in any MediaList callback. |
|
224 */ |
|
225 class CGlxMetadataAsyncUpdate: public CActive |
|
226 { |
|
227 |
|
228 public: |
|
229 /** |
|
230 * Symbian standard two phase construction.Construct object of CGlxMetadataAsyncUpdate class. |
|
231 * |
|
232 * @param aObserver CGlxMetadataContainer |
|
233 * @return MetadataAsynchronous object |
|
234 */ |
|
235 static CGlxMetadataAsyncUpdate* NewL(CGlxMetadataContainer& aObserver); |
|
236 /** |
|
237 * Symbian standard two phase construction.Construct object of CGlxMetadataAsyncUpdate class. |
|
238 * |
|
239 * @param aObserver CGlxMetadataContainer |
|
240 * @return MetadataAsynchronous object |
|
241 */ |
|
242 static CGlxMetadataAsyncUpdate* NewLC(CGlxMetadataContainer& aObserver); |
|
243 /** |
|
244 * Destructor |
|
245 */ |
|
246 ~CGlxMetadataAsyncUpdate(); |
|
247 /** |
|
248 * Completes the active object causing a call from the |
|
249 * active scheduler to RunL() |
|
250 * (test in RunL using iStatus.Int()) |
|
251 */ |
|
252 void CompleteSelf(); |
|
253 private: |
|
254 /** |
|
255 * C++ constructor. |
|
256 * |
|
257 * @param aObserver CGlxMetadataContainer |
|
258 */ |
|
259 CGlxMetadataAsyncUpdate(CGlxMetadataContainer& aObserver); |
|
260 // from CActive |
|
261 void RunL(); |
|
262 void DoCancel(); |
|
263 |
|
264 private: |
|
265 CGlxMetadataContainer& iObserver; |
|
266 }; |
221 }; |
|
222 |
267 #endif //C_GLXMETADATACONTAINER_H__ |
223 #endif //C_GLXMETADATACONTAINER_H__ |
268 |
224 |
269 //End of file |
225 //End of file |
270 |
226 |