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