|
1 /* |
|
2 * Copyright (c) 2008-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: Metadata dialog implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_GLXMETADATACONTAINER_H__ |
|
20 #define C_GLXMETADATACONTAINER_H__ |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <glxmedialist.h> //media list |
|
25 #include <alf/alfenv.h> |
|
26 #include <aknsettingitemlist.h> // for CAknSettingItem |
|
27 #include "mglxmedialistobserver.h" |
|
28 #include <glxattributecontext.h> |
|
29 |
|
30 /* |
|
31 * whenever some operation in details view happens,we need to refresh the toolbar area. |
|
32 * Through this observer, we shall notify the main class to refresh the toolbar area. |
|
33 */ |
|
34 class MToolbarResetObserver |
|
35 { |
|
36 public: |
|
37 virtual void HandleToolbarResetting(TBool aVisible)= 0; |
|
38 }; |
|
39 |
|
40 //FORWARD DECLARATION |
|
41 class MGlxMediaList; |
|
42 class CGlxDetailsMulModelProvider; |
|
43 class MGlxMetadataDialogObserver; |
|
44 class CGlxCommandHandlerAddToContainer; |
|
45 |
|
46 #include "glxmedia.h" |
|
47 |
|
48 // CLASS DECLARATION |
|
49 /** |
|
50 * CGlxMetadataContainer |
|
51 * |
|
52 * Metadata Container implementation |
|
53 */ |
|
54 NONSHARABLE_CLASS( CGlxMetadataContainer ) : public CAknSettingItemList, |
|
55 public MGlxMediaListObserver |
|
56 |
|
57 { |
|
58 public: // Constructors and destructor |
|
59 void ViewDynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane); |
|
60 /** |
|
61 * Symbian standard tow phase construction.Construct object of CGlxMetadataContainer object. |
|
62 * |
|
63 * @param aRect rect for control |
|
64 * @param aMediaList media list |
|
65 * @return Metadata container object |
|
66 */ |
|
67 static CGlxMetadataContainer* NewL( const TRect& aRect, |
|
68 MGlxMetadataDialogObserver& aDialogObserver, |
|
69 const TDesC& aUri,MToolbarResetObserver& aResetToolbarObs ); |
|
70 |
|
71 /** |
|
72 * Symbian standard tow phase construction.Construct object of CGlxMetadataContainer object. |
|
73 * |
|
74 * @param aRect rect for control |
|
75 * @param aMediaList media list |
|
76 * @return Metadata container object |
|
77 */ |
|
78 static CGlxMetadataContainer* NewLC( const TRect& aRect, |
|
79 MGlxMetadataDialogObserver& aDialogObserver, |
|
80 const TDesC& aUri,MToolbarResetObserver& aResetToolbarObs); |
|
81 |
|
82 /** |
|
83 * Destructor |
|
84 */ |
|
85 ~CGlxMetadataContainer(); |
|
86 |
|
87 public: |
|
88 |
|
89 // @ref CAknSettingItemList::CreateSettingItemL |
|
90 CAknSettingItem* CreateSettingItemL(TInt aIdentifier); |
|
91 |
|
92 // @ref CAknSettingItemList::HandleListBoxEventL |
|
93 void HandleListBoxEventL(CEikListBox* aListBox, |
|
94 TListBoxEvent aEventType); |
|
95 void HandleListboxChangesL(); |
|
96 |
|
97 //Enable disble the options based on the current selected item |
|
98 TBool IsItemModifiable(); |
|
99 TBool IsLocationItem(); |
|
100 |
|
101 //Delete the location information |
|
102 void RemoveLocationL(); |
|
103 //Change MSK |
|
104 void ChangeMskL(); |
|
105 //Enable marquee support |
|
106 void EnableMarqueingL(); |
|
107 private: |
|
108 |
|
109 /** |
|
110 * C++ constructor. |
|
111 * |
|
112 * @param aMediaList media list |
|
113 */ |
|
114 CGlxMetadataContainer(MGlxMetadataDialogObserver& aDialogObserver, |
|
115 MToolbarResetObserver& aResetToolbarObs); |
|
116 |
|
117 /** |
|
118 * Symbian 2nd phase constructor |
|
119 * @param aRect rect for this control |
|
120 * @para aUri uri for media item |
|
121 */ |
|
122 void ConstructL( const TRect& aRect, const TDesC& aUri); |
|
123 |
|
124 /** |
|
125 * Create media list with URI filter |
|
126 * This function creates the collection path filter and finally the MediaList |
|
127 */ |
|
128 void CreateMediaListForSelectedItemL( ); |
|
129 /** |
|
130 * Create media list to get the tags list for the particular Item. |
|
131 * This function creates the collection path filter and finally the MediaList |
|
132 * |
|
133 */ |
|
134 void CreateTagsMediaListL(); |
|
135 /** |
|
136 * Create media list to get the Albums list for the particular Item. |
|
137 * This function creates the collection path filter and finally the MediaList |
|
138 * |
|
139 * @param aItemURI uri or file name of item |
|
140 */ |
|
141 void CreateAlbumsMediaListL(); |
|
142 //Set attributes to the settings list once fetched from medialist. |
|
143 void SetAttributesL(TMPXAttribute attribute); |
|
144 //Set the modifed name or description to the list and MDS |
|
145 void SetNameDescriptionL(TInt aItem); |
|
146 //Sets the duration and license items based on the selected item |
|
147 void SetDurationLIicenseItemVisibilityL(); |
|
148 //updates the tags item on callback. |
|
149 void UpdateTagsL(); |
|
150 //updates the Albums item on callback. |
|
151 void UpdateAlbumsL(); |
|
152 //Update the details field. |
|
153 void EditItemL(TInt aIndex, TBool /*aCalledFromMenu*/); |
|
154 /** |
|
155 * Parse the drive, path & extension from the old uri, |
|
156 * And return the modified uri by appending the new title |
|
157 * |
|
158 * @param aTitleText new title entered by user. |
|
159 * @return TFileName as modified uri |
|
160 */ |
|
161 TFileName ParseFileName(const TDesC& aTitleText); |
|
162 |
|
163 /** |
|
164 * Refresh MediaList with modified FileName. |
|
165 * |
|
166 * @param aModifiedUri is the new media uri |
|
167 */ |
|
168 void RefreshMediaListL(const TDesC& aModifiedUri); |
|
169 |
|
170 public: |
|
171 //MedialistObserver APIS |
|
172 void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ); |
|
173 void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList*/* aList */); |
|
174 void HandleAttributesAvailableL( TInt aItemIndex, |
|
175 const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList ); |
|
176 void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, |
|
177 TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList ); |
|
178 void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList ); |
|
179 void HandleMessageL( const CMPXMessage& aMessage, MGlxMediaList* aList ); |
|
180 void HandleError( TInt aError ); |
|
181 void HandleCommandCompleteL( CMPXCommand* aCommandResult, TInt aError, |
|
182 MGlxMediaList* aList ); |
|
183 void HandleMediaL( TInt aListIndex, MGlxMediaList* aList ); |
|
184 void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList ); |
|
185 void HandleErrorL(); |
|
186 MGlxMediaList& MediaList(); |
|
187 void HandleCommandCompleteL(TAny* aSessionId, |
|
188 CMPXCommand* /*aCommandResult*/, TInt aError, MGlxMediaList* aList); |
|
189 |
|
190 |
|
191 private: //data |
|
192 |
|
193 MGlxMetadataDialogObserver& iDialogObesrver; |
|
194 //Flag to check if the item is a video. |
|
195 TBool iVideo; |
|
196 //To check if marquee is enabled. |
|
197 TBool iMarquee; |
|
198 //to set visible duration and license items based on the Item. |
|
199 TBool iSetVisible; |
|
200 TBool iLocationinfo; |
|
201 RBuf iTextSetter; |
|
202 RBuf iTagSetter; |
|
203 RBuf iAlbumSetter; |
|
204 |
|
205 //(Owns) must always represent the media's current uri. |
|
206 HBufC* iUri; |
|
207 |
|
208 MGlxMediaList* iItemMediaList; |
|
209 MGlxMediaList* iTagMediaList; |
|
210 MGlxMediaList* iAlbumMediaList; |
|
211 CGlxDefaultAttributeContext* iAlbumContext; |
|
212 CGlxDefaultAttributeContext* iTagContext; |
|
213 TGlxSelectionIterator iSelectionIterator; |
|
214 CGlxAttributeContext* iMainListAttributecontext; |
|
215 MToolbarResetObserver& iResetToolbarObs; // observer |
|
216 |
|
217 //Flag to indicate rename command is started |
|
218 TBool iRenameStarted; |
|
219 |
|
220 }; |
|
221 |
|
222 #endif //C_GLXMETADATACONTAINER_H__ |
|
223 |
|
224 //End of file |
|
225 |