|
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: Cloud view implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_GLXCONTAINERINFOBUBBLE_H |
|
22 #define C_GLXCONTAINERINFOBUBBLE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <mglxmedialistobserver.h> //for base class |
|
26 #include "glxbubbletimer.h" //for timer functionality |
|
27 #include "glxinfobubble.h" //info bubble |
|
28 |
|
29 |
|
30 //Forward Declaration |
|
31 class CGlxDefaultThumbnailContext; |
|
32 class CGlxDefaultAttributeContext; |
|
33 class MGlxMediaList; |
|
34 |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * CGlxContainerInfoBubble |
|
40 * It Fetches attributes from medialist and launch Info bubble |
|
41 * |
|
42 */ |
|
43 class CGlxContainerInfoBubble : public CGlxInfoBubble, public |
|
44 MGlxTimerNotifier, public MGlxMediaListObserver |
|
45 |
|
46 { |
|
47 public: |
|
48 /** |
|
49 * @function NewL |
|
50 * @since S60 3.2 |
|
51 * Perform the two phase construction |
|
52 * @param aMediaList - medialist from which attributes will be fetched |
|
53 * @param aEnv - Env Variable of Alf |
|
54 * @param aOwnerControl - Owner control which will be the parent of Infobubble |
|
55 * @return Pointer to newly created object |
|
56 */ |
|
57 |
|
58 IMPORT_C static CGlxContainerInfoBubble *NewL(MGlxMediaList *aMediaList, |
|
59 CAlfEnv &aEnv, CAlfControl &aOwnerControl); |
|
60 |
|
61 /** |
|
62 * @function NewLC |
|
63 * @since S60 3.2 |
|
64 * Perform the two phase construction |
|
65 * @param aMediaList - medialist from which attributes will be fetched |
|
66 * @param aEnv - Env Variable of Alf |
|
67 * @param aOwnerControl - Owner control which will be the parent of Infobubble |
|
68 * @return Pointer to newly created object |
|
69 */ |
|
70 |
|
71 IMPORT_C static CGlxContainerInfoBubble *NewLC(MGlxMediaList *aMediaList, |
|
72 CAlfEnv &aEnv, CAlfControl &aOwnerControl); |
|
73 |
|
74 /** |
|
75 * Virtual Function from MGlxTimernotifier |
|
76 */ |
|
77 void TimerCompleteL(); |
|
78 |
|
79 /** |
|
80 * Destructor |
|
81 */ |
|
82 ~CGlxContainerInfoBubble(); |
|
83 |
|
84 /** |
|
85 * @function SetFocus |
|
86 * @since S60 3.2 |
|
87 * @param aPos - Reference position for Info Bubble |
|
88 * @return none |
|
89 */ |
|
90 void SetFocus(TPoint aPos); |
|
91 |
|
92 /** |
|
93 * @function C++ default constructor |
|
94 * @param aMediaList - medialist from which attributes will be fetched |
|
95 * @param aEnv - Env Variable of Alf |
|
96 * @since S60 3.2 |
|
97 */ |
|
98 CGlxContainerInfoBubble(MGlxMediaList *aMediaList); |
|
99 |
|
100 /** |
|
101 * @function ConstructL |
|
102 * @since S60 3.2 |
|
103 * Perform the second phase of two phase construction |
|
104 * @param aEnv - Env Variable of Alf |
|
105 * @param aOwnerControl - Owner control which will be the parent of Infobubble |
|
106 */ |
|
107 void ConstructL(CAlfEnv &aEnv, CAlfControl &aOwnerControl); |
|
108 |
|
109 public: |
|
110 //medialist observer |
|
111 /** |
|
112 * @function HandleItemAddedL |
|
113 * Notification that media items were added to the list |
|
114 * @param aStartIndex First item that was added (inserted) |
|
115 * @param aEndIndex Last item that was added (inserted) |
|
116 * @param aList List that this callback relates to |
|
117 */ |
|
118 void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, |
|
119 MGlxMediaList* aList); |
|
120 |
|
121 /** |
|
122 * @function HandleMediaL |
|
123 * Notification that media object is now available for an item |
|
124 * @param Index of the item |
|
125 * @param aList List that this callback relates to |
|
126 */ |
|
127 void HandleMediaL(TInt aListIndex, MGlxMediaList* aList); |
|
128 |
|
129 /** |
|
130 * @function HandleItemRemoved |
|
131 * Notification that media item was removed from the list |
|
132 * @param aStartIndex First item that was removed |
|
133 * @param aEndIndex Last item that was removed |
|
134 * @param aList List that this callback relates to |
|
135 */ |
|
136 void HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex, |
|
137 MGlxMediaList* aList); |
|
138 |
|
139 /** |
|
140 * @function HandleItemModifiedL |
|
141 * Notification that media item was changed |
|
142 * @param aItemIndexes Indexes of items that were changed |
|
143 * @param aList List that this callback relates to |
|
144 */ |
|
145 void HandleItemModifiedL(const RArray<TInt>& aItemIndexes, |
|
146 MGlxMediaList* aList); |
|
147 |
|
148 /** |
|
149 * @function HandleAttributesAvailableL |
|
150 * Notification that an attribute is available |
|
151 * @param aItemIndex Index of the for which the thumbnail is available |
|
152 * @param aAttributes Array of attributes that have become available |
|
153 * @param aList List that this callback relates to |
|
154 */ |
|
155 void HandleAttributesAvailableL(TInt aItemIndex, |
|
156 const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList); |
|
157 |
|
158 /** |
|
159 * @function HandleFocusChangedL |
|
160 * Notification that focus has moved |
|
161 * @param aType the direction of the focus change |
|
162 * @param aNewIndex the new index after the focus change |
|
163 * @param aOldIndex the old index before the focus change |
|
164 * @param aList List that this callback relates to |
|
165 */ |
|
166 void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, |
|
167 TInt aOldIndex, MGlxMediaList* aList); |
|
168 |
|
169 /** |
|
170 * @function HandleItemSelected |
|
171 * Notification that an item has been selected/deselected |
|
172 * @param aIndex Index of the item that has been selected/deselected |
|
173 * @param aSelected Boolean to indicate selection/deselection |
|
174 * @param aList List that the selection relates to |
|
175 */ |
|
176 void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList); |
|
177 |
|
178 /** |
|
179 * @function HandleMessageL |
|
180 * Notification from the collection. E.g. Items added/modified/deleted and progress notifications |
|
181 * @param aMessage Message notification from the collection |
|
182 * @param aList List that the notification relates to |
|
183 */ |
|
184 void HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList); |
|
185 |
|
186 private: |
|
187 |
|
188 /** |
|
189 * @function ShowNow : Calls Info Bubble for the focussed item. |
|
190 * @since S60 3.2 |
|
191 * @return none |
|
192 */ |
|
193 void ShowNowL(); |
|
194 |
|
195 /** |
|
196 * Sets the attributes |
|
197 * @return none |
|
198 */ |
|
199 void SetAttributesL(); |
|
200 |
|
201 /** |
|
202 * Sets the attributes |
|
203 * @ param attributes array |
|
204 * @ param attributes count |
|
205 * @return none |
|
206 */ |
|
207 void SetAttributesL(const RArray<TMPXAttribute>& aAttributes, const TInt& aAttributescount); |
|
208 |
|
209 /** |
|
210 * Get the MediaTitle |
|
211 * @param media |
|
212 * @return if the title changed |
|
213 */ |
|
214 TBool GetMediaTitleL(const TGlxMedia& aMedia); |
|
215 |
|
216 /** |
|
217 * Sets the MediaSubTitle |
|
218 * @param media |
|
219 * @return if the subtitle changed |
|
220 */ |
|
221 TBool GetMediaSubTitleL(const TGlxMedia& aMedia); |
|
222 |
|
223 /** |
|
224 * Sets the MediaThumbNail |
|
225 * @param aMedia,media |
|
226 * @param aIdSpaceId,Id-space identifier |
|
227 * @param aSize,thumbnail size |
|
228 * @param thumbnailattribute |
|
229 * @return if new texture was created |
|
230 */ |
|
231 TBool GetMediaThumbNailL(const TGlxMedia& aMedia, TGlxIdSpaceId& aIdSpaceId, |
|
232 TSize& aSize, TMPXAttribute& aAttrThumbnail); |
|
233 |
|
234 private: |
|
235 /**medialist not owned */ |
|
236 MGlxMediaList *iMediaList; |
|
237 |
|
238 /**flag for Timer completion */ |
|
239 TBool iTimerComplete; |
|
240 |
|
241 /** iThumbnailContext for getting Thumbnail form medialist*/ |
|
242 CGlxDefaultThumbnailContext *iThumbnailContext; |
|
243 |
|
244 /** for getting attribute form medialist*/ |
|
245 CGlxDefaultAttributeContext *iAttributeContext; |
|
246 |
|
247 /**position used for Info Bubble */ |
|
248 TPoint iPos; |
|
249 |
|
250 /**variable used for providing delay */ |
|
251 CGlxBubbleTimer *iTimer; |
|
252 |
|
253 /**Stores the first line of text */ |
|
254 HBufC* iMediaTitle; |
|
255 |
|
256 /**stores the second line of text */ |
|
257 HBufC* iMediaSubTitle; |
|
258 |
|
259 /**Image variable for Thumbnail texture*/ |
|
260 CAlfTexture* iTexture; |
|
261 |
|
262 /** The id of the thumbnail texture retrieved from the texture manager */ |
|
263 TInt iThumbnailId; |
|
264 }; |
|
265 |
|
266 #endif // C_GLXCONTAINERINFOBUBBLE_H |
|
267 |
|
268 // End of File |