|
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: Publish the downloads collection content in the photosuite |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef GLXCONTENTHARVESTERPLUGINDOWNLOADS_H_ |
|
19 #define GLXCONTENTHARVESTERPLUGINDOWNLOADS_H_ |
|
20 |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <liwcommon.h> |
|
25 |
|
26 #include <glxmediaid.h> // for TGlxMediaId |
|
27 #include <mglxmedialistobserver.h> // for MGlxMediaListObserver |
|
28 #include <glxmedialistiterator.h> // for TGlxSequentialIterator |
|
29 |
|
30 #include <contentharvesterplugin.h> |
|
31 #include <contentharvesterpluginuids.hrh> |
|
32 #include "glxcontentharvesterplugin.h" |
|
33 #include "glxcontentharvesterpluginbase.h" |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class MGlxMediaList; |
|
37 class CLiwGenericParamList; |
|
38 class CLiwServiceHandler; |
|
39 class CPeriodic; |
|
40 class MLiwInterface; |
|
41 class CGlxAttributeContext; |
|
42 class CGlxThumbnailContext; |
|
43 |
|
44 // CLASS DECLARATION |
|
45 /** |
|
46 * CP Content Harvester plugin |
|
47 * |
|
48 */ |
|
49 |
|
50 class CGlxContentHarvesterPluginDownloads : public CGlxContentHarvesterPluginBase, |
|
51 public MGlxMediaListObserver, public MLiwNotifyCallback |
|
52 { |
|
53 public: // Constructors and destructor |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 */ |
|
57 static CGlxContentHarvesterPluginDownloads* NewLC( MLiwInterface* aCPSInterface, |
|
58 MGlxContentHarvesterPlugin* aCHplugin ); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CGlxContentHarvesterPluginDownloads(); |
|
64 |
|
65 // from base class |
|
66 |
|
67 /** |
|
68 * Here the preview Thumbnails are updated |
|
69 */ |
|
70 void UpdateDataL(); |
|
71 |
|
72 /** |
|
73 * This is a call back from the Matrix Menu whenever there is change in focus |
|
74 */ |
|
75 TInt HandleNotifyL( |
|
76 TInt aCmdId, |
|
77 TInt aEventId, |
|
78 CLiwGenericParamList& aEventParamList, |
|
79 const CLiwGenericParamList& aInParamList); |
|
80 |
|
81 /** |
|
82 * updates media list with coressponding context depending on the focus |
|
83 * to show the thumbnails |
|
84 */ |
|
85 void UpdatePreviewThumbnailListL( ); |
|
86 |
|
87 /** |
|
88 * Returns the collection items count |
|
89 */ |
|
90 TInt Count(); |
|
91 |
|
92 private: |
|
93 |
|
94 /** |
|
95 * Perform the second phase construction |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 /** |
|
100 * Default constructor. |
|
101 */ |
|
102 CGlxContentHarvesterPluginDownloads( MLiwInterface* aCPSInterface, |
|
103 MGlxContentHarvesterPlugin* aCHplugin ); |
|
104 |
|
105 /** |
|
106 * Update data in Content Publisher Storage |
|
107 */ |
|
108 void UpdateDataInCPSL(TInt aHandle); |
|
109 |
|
110 /** |
|
111 * This retrievs the bitmap handle and updates the index of the |
|
112 * thumbnail to be shown |
|
113 */ |
|
114 TInt UpdateItem(TInt aItemIndex); |
|
115 |
|
116 /* |
|
117 * This Updates the thumbnail/Preview list with thumbnails already present |
|
118 */ |
|
119 void HandleItemChanged(); |
|
120 |
|
121 /* |
|
122 * This Function is called when the collection recives a focus and losses the focus |
|
123 * @param aOn :True : The collection is in focus |
|
124 * : False : The collection lost the focus |
|
125 */ |
|
126 void ActivateL( TBool aOn ); |
|
127 |
|
128 /** |
|
129 * Delets the medial list created. |
|
130 */ |
|
131 void DestroyMedialist(); |
|
132 |
|
133 /** |
|
134 * Creates a media list |
|
135 */ |
|
136 void CreateMedialistL(); |
|
137 |
|
138 /** |
|
139 * Adds the context and observers to the media list |
|
140 */ |
|
141 void AddContextAndObserverL(); |
|
142 |
|
143 /** |
|
144 * Adds the context and observers to the media list |
|
145 */ |
|
146 void RemoveContextAndObserver(); |
|
147 |
|
148 //Call back from the Media list for any error occured |
|
149 void HandleError( TInt /*aError*/ ); |
|
150 |
|
151 |
|
152 private: // from MGlxMediaListObserver |
|
153 |
|
154 /** |
|
155 * @ref MGlxMediaListObserver::HandleItemAddedL |
|
156 */ |
|
157 void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ); |
|
158 /** |
|
159 * @ref MGlxMediaListObserver::HandleMediaL |
|
160 */ |
|
161 void HandleMediaL( TInt aListIndex, MGlxMediaList* aList ); |
|
162 /** |
|
163 * @ref MGlxMediaListObserver::HandleItemRemoved |
|
164 */ |
|
165 void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList ); |
|
166 /** |
|
167 * @ref MGlxMediaListObserver::HandleItemModifiedL |
|
168 */ |
|
169 void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList ); |
|
170 /** |
|
171 * @ref MGlxMediaListObserver::HandleAttributesAvailableL |
|
172 */ |
|
173 void HandleAttributesAvailableL( |
|
174 TInt aItemIndex, const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList ); |
|
175 /** |
|
176 * @ref MGlxMediaListObserver::HandleFocusChangedL |
|
177 */ |
|
178 void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, |
|
179 TInt aOldIndex, MGlxMediaList* aList ); |
|
180 /** |
|
181 * @ref MGlxMediaListObserver::HandleItemSelected |
|
182 */ |
|
183 void HandleItemSelectedL( TInt aIndex, TBool aSelected, MGlxMediaList* aList ); |
|
184 /** |
|
185 * @ref MGlxMediaListObserver::HandleMessageL |
|
186 */ |
|
187 void HandleMessageL( const CMPXMessage& aMessage, MGlxMediaList* aList ); |
|
188 |
|
189 private: // data |
|
190 |
|
191 /** |
|
192 * Instance of CPS interface used for update with CPS. |
|
193 */ |
|
194 MLiwInterface* iCPSInterface; |
|
195 CLiwGenericParamList* iInParamList; |
|
196 CLiwGenericParamList* iOutParamList; |
|
197 CPeriodic* iPeriodic; |
|
198 |
|
199 /// Owned: Media list |
|
200 MGlxMediaList* iMediaList; |
|
201 |
|
202 /// Own: the thumbnail context |
|
203 CGlxThumbnailContext* iThumbnailContext; |
|
204 |
|
205 /// Own: Thuimbnail Iterator |
|
206 TGlxSequentialIterator iThumbnailIterator; |
|
207 |
|
208 RArray<TInt> iPreviewItemCount; |
|
209 |
|
210 // Preview thumbnail index |
|
211 TInt iProgressIndex; |
|
212 |
|
213 //this variable holds the value ,whether the collection is in focus or not |
|
214 TBool iIsFocused; |
|
215 }; |
|
216 |
|
217 #endif /*GLXCONTENTHARVESTERPLUGINDOWNLOADS_H_*/ |