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