53
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 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: MPX Collection view container implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef CMPXCOLLECTIONVIEWHGCONTAINER_H
|
|
21 |
#define CMPXCOLLECTIONVIEWHGCONTAINER_H
|
|
22 |
|
|
23 |
|
|
24 |
// INCLUDES
|
|
25 |
#include <coecntrl.h>
|
|
26 |
|
|
27 |
#include <ganes/HgScrollBufferObserverIface.h>
|
|
28 |
#include <ganes/HgSelectionObserverIface.h>
|
|
29 |
#include <ganes/HgVgMediaWallObserverIface.h>
|
|
30 |
#include <ganes/HgItem.h>
|
|
31 |
#include <mpxcommonframeworkdefs.h> // TMPXItemId
|
|
32 |
#include "mpxcollectionviewhgtnloader.h"
|
|
33 |
#include "mpxcommonlistboxarrayobserver.h"
|
|
34 |
#include "mpxcommonlistboxarraybase.h"
|
|
35 |
|
|
36 |
// FORWARD DECLARATION
|
|
37 |
class CAknContextPane;
|
|
38 |
class CAknIconArray;
|
|
39 |
class CAknsBasicBackgroundControlContext;
|
|
40 |
class CEikMenuPane;
|
|
41 |
class CHgScroller;
|
|
42 |
class CHgScroller;
|
|
43 |
class CHgVgMediaWall;
|
|
44 |
class CMPXCollectionViewHgPlaylistHelper;
|
|
45 |
class CMPXCommonUiHelper;
|
|
46 |
class CMPXMediaArray;
|
|
47 |
class MCoeControlObserver;
|
|
48 |
class MEikCommandObserver;
|
|
49 |
class MEikListBoxObserver;
|
|
50 |
class MMPXCollectionUiHelper;
|
|
51 |
class MMPXCollectionUtility;
|
|
52 |
class MMPXPlaybackUtility;
|
|
53 |
class MMpxCbaHandler;
|
|
54 |
class TAknsItemID;
|
|
55 |
class CAsyncOneShot;
|
|
56 |
class MMPXSelectedAlbumHandler;
|
|
57 |
|
|
58 |
// CLASS DECLARATION
|
|
59 |
|
|
60 |
/**
|
|
61 |
* MPX Collection view container.
|
|
62 |
*
|
|
63 |
* @lib mpxcollectionviewhg.lib
|
|
64 |
* @since S60 v5.0
|
|
65 |
*/
|
|
66 |
NONSHARABLE_CLASS( CMPXCollectionViewHgContainer )
|
|
67 |
: public CCoeControl
|
|
68 |
, public MCoeControlObserver
|
|
69 |
, public MMPXCommonListBoxArrayObserver
|
|
70 |
, public MHgScrollBufferObserver
|
|
71 |
, public MHgSelectionObserver
|
|
72 |
, public MMPXCollectionFindObserver
|
|
73 |
, public MHgVgMediaWallObserver
|
|
74 |
, public MMpxTNLoaderObserver
|
|
75 |
, public MCoeForegroundObserver
|
|
76 |
{
|
|
77 |
public:
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Two-phased constructor.
|
|
81 |
*
|
|
82 |
* @since 5.1
|
|
83 |
* @param aView Command observer.
|
|
84 |
* @param aObserver MEikListBoxObserver
|
|
85 |
* @param aIsEmbedded ETrue to indicate that view is embedded
|
|
86 |
* @return Pointer to newly created object.
|
|
87 |
*/
|
|
88 |
static CMPXCollectionViewHgContainer* NewL(
|
|
89 |
MEikCommandObserver* aView,
|
|
90 |
MEikListBoxObserver* aObserver,
|
|
91 |
MMPXSelectedAlbumHandler* aSelectedAlbumHandler,
|
|
92 |
TBool aIsEmbedded );
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Destructor.
|
|
96 |
*/
|
|
97 |
virtual ~CMPXCollectionViewHgContainer();
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Sets playback status with item id
|
|
101 |
*
|
|
102 |
* @param aId item id of the song
|
|
103 |
* @param aStatus status of the song
|
|
104 |
*/
|
|
105 |
void SetPlaybackStatusByIdL( TMPXItemId aId, TMPXPlaybackState aStatus, TInt aIndex = 0 );
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Get current playback index
|
|
109 |
*
|
|
110 |
* @return Current playback index, KErrNotFound if nothing is playing
|
|
111 |
*/
|
|
112 |
TInt PlaybackIndex();
|
|
113 |
|
|
114 |
/**
|
|
115 |
* Activates reorder mode
|
|
116 |
*
|
|
117 |
* @param aEnable ETrue to enable reorder mode, EFalse to disable
|
|
118 |
*/
|
|
119 |
void ActivateReorderMode( TBool aEnable );
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Set reorder mode
|
|
123 |
*
|
|
124 |
* @param aEnable ETrue to enable reorder mode, EFalse to disable reorder mode
|
|
125 |
* @param aIndex current selected index
|
|
126 |
*/
|
|
127 |
void SetReorderGrabbedMode( TBool aEnable, TInt aIndex = 0 );
|
|
128 |
|
|
129 |
/**
|
|
130 |
* Determines if it's currently in reorder mode
|
|
131 |
*
|
|
132 |
* @return ETrue if in reorder mode, EFalse otherwise
|
|
133 |
*/
|
|
134 |
TBool IsInReorderMode();
|
|
135 |
|
|
136 |
/**
|
|
137 |
* Move current reorder index relatively
|
|
138 |
*
|
|
139 |
* @param aDirection +1 to move down, -1 to move up
|
|
140 |
*/
|
|
141 |
void MoveReorderIndex( TInt aDirection );
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Set current reorder index
|
|
145 |
*
|
|
146 |
* @param aIndex current reorder index
|
|
147 |
*/
|
|
148 |
void SetReorderIndex( TInt aIndex );
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Confirm reorder
|
|
152 |
*/
|
|
153 |
void ConfirmReorderL();
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Cancel reorder
|
|
157 |
*/
|
|
158 |
void CancelReorder();
|
|
159 |
|
|
160 |
/**
|
|
161 |
* Gets original index of currently selected item in reorder mode
|
|
162 |
*/
|
|
163 |
TInt GetOriginalIndex();
|
|
164 |
|
|
165 |
/**
|
|
166 |
* Update Titlepane icon to reorder image
|
|
167 |
*/
|
|
168 |
void UpdateReorderTitleIconL();
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Update titlepane to use original icon
|
|
172 |
*/
|
|
173 |
void RestoreOriginalTitleIconL();
|
|
174 |
|
|
175 |
/**
|
|
176 |
* Content is ready
|
|
177 |
*/
|
|
178 |
void ContentIsReady( TBool aReady );
|
|
179 |
|
|
180 |
/**
|
|
181 |
* Returns list box array, ownership not transfered
|
|
182 |
*
|
|
183 |
* @since 3.1
|
|
184 |
* @return A pointer to the list box array
|
|
185 |
*/
|
|
186 |
CMPXCommonListBoxArrayBase* ListBoxArray() const;
|
|
187 |
|
|
188 |
/**
|
|
189 |
* Return number of listbox items shown in the current listbox.
|
|
190 |
*
|
|
191 |
* @since 3.1
|
|
192 |
* @return The number of items shown in the list box
|
|
193 |
*/
|
|
194 |
TInt CurrentListItemCount() const;
|
|
195 |
|
|
196 |
/**
|
|
197 |
* Return total number of listbox items in the listbox.
|
|
198 |
*
|
|
199 |
* @since 3.1
|
|
200 |
* @return Total items in the list box
|
|
201 |
*/
|
|
202 |
TInt TotalListItemCount() const;
|
|
203 |
|
|
204 |
/**
|
|
205 |
* Gets top listbox item index (relative to the original listbox).
|
|
206 |
* @return Top listbox item index
|
|
207 |
*
|
|
208 |
* @since 3.1
|
|
209 |
*/
|
|
210 |
TInt TopLbxItemIndex() const;
|
|
211 |
|
|
212 |
/**
|
|
213 |
* Gets bottom listbox item index (relative to the original listbox).
|
|
214 |
* @return Bottom listbox item index
|
|
215 |
*
|
|
216 |
* @since 3.1
|
|
217 |
*/
|
|
218 |
TInt BottomLbxItemIndex() const;
|
|
219 |
|
|
220 |
/**
|
|
221 |
* Gets current listbox item index (relative to the original listbox).
|
|
222 |
* @return Current listbox item index
|
|
223 |
*
|
|
224 |
* @since 3.1
|
|
225 |
*/
|
|
226 |
TInt CurrentLbxItemIndex() const;
|
|
227 |
|
|
228 |
/*
|
|
229 |
* Mark the grabbed item for reordering the playlist.
|
|
230 |
*/
|
|
231 |
void MarkGrabedItemL( TInt aIndex );
|
|
232 |
|
|
233 |
/**
|
|
234 |
* Get current selected listbox items indices (relative to the original
|
|
235 |
* listbox). Ownership not transferred.
|
|
236 |
*
|
|
237 |
* @since 3.1
|
|
238 |
* @return Current listbox item indices
|
|
239 |
*/
|
|
240 |
const CArrayFix<TInt>* CurrentSelectionIndicesL() const;
|
|
241 |
|
|
242 |
/**
|
|
243 |
* Sewt current selected listbox items indices
|
|
244 |
*
|
|
245 |
* @since 3.1
|
|
246 |
* @param aIndices Array of selection indices, ownership not transfered
|
|
247 |
*/
|
|
248 |
void SetCurrentSelectionIndicesL( CArrayFix<TInt>* aIndices ) const;
|
|
249 |
|
|
250 |
/**
|
|
251 |
* Set top listbox item index.
|
|
252 |
*
|
|
253 |
* @since 3.1
|
|
254 |
* @param aIndex Actual listbox index.
|
|
255 |
*/
|
|
256 |
void SetLbxTopItemIndex( TInt aIndex );
|
|
257 |
|
|
258 |
/**
|
|
259 |
* Set current listbox item index.
|
|
260 |
*
|
|
261 |
* @since 3.1
|
|
262 |
* @param aIndex Actual listbox index.
|
|
263 |
*/
|
|
264 |
void SetLbxCurrentItemIndex( TInt aIndex );
|
|
265 |
|
|
266 |
/**
|
|
267 |
* Set current listbox item index and highlight it.
|
|
268 |
*
|
|
269 |
* @since 3.1
|
|
270 |
* @param aIndex Actual listbox index.
|
|
271 |
*/
|
|
272 |
void SetLbxCurrentItemIndexAndDraw( TInt aIndex );
|
|
273 |
|
|
274 |
/**
|
|
275 |
* Clear listbox selection.
|
|
276 |
*
|
|
277 |
* @since 3.1
|
|
278 |
*/
|
|
279 |
void ClearLbxSelection();
|
|
280 |
|
|
281 |
/**
|
|
282 |
* Sets list box backround text. This text is visible if the list box
|
|
283 |
* has no items.
|
|
284 |
*
|
|
285 |
* @param aText The text for the empty list box background.
|
|
286 |
* @since 3.2
|
|
287 |
*/
|
|
288 |
void SetLbxEmptyTextL( const TDesC& aText );
|
|
289 |
|
|
290 |
/**
|
|
291 |
* Draws list box item index
|
|
292 |
*
|
|
293 |
* @since 3.2
|
|
294 |
*/
|
|
295 |
void DrawLbxItemL( TInt aIndex );
|
|
296 |
|
|
297 |
/**
|
|
298 |
* Set Find box's focus.
|
|
299 |
*
|
|
300 |
* @since 3.1
|
|
301 |
* @param aFocus ETrue if set focus on FindBox. Otherwise, EFalse.
|
|
302 |
*/
|
|
303 |
void SetFindBoxFocus( TBool aFocus );
|
|
304 |
|
|
305 |
/**
|
|
306 |
* Handle listbox item addition.
|
|
307 |
*
|
|
308 |
* @since 3.1
|
|
309 |
*/
|
|
310 |
void HandleLbxItemAdditionL();
|
|
311 |
|
|
312 |
/**
|
|
313 |
* Handle listbox item addition, preserving the current display index.
|
|
314 |
*
|
|
315 |
* @since 3.1
|
|
316 |
*/
|
|
317 |
void HandleLbxItemAdditionPreserveIndexL();
|
|
318 |
|
|
319 |
/**
|
|
320 |
* Handle listbox item removal.
|
|
321 |
*
|
|
322 |
* @since 3.1
|
|
323 |
*/
|
|
324 |
void HandleLbxItemRemovalL();
|
|
325 |
|
|
326 |
/**
|
|
327 |
* Show/hide find box
|
|
328 |
*
|
|
329 |
* @since 3.1
|
|
330 |
* @param aIsVisible ETrue to set findbox visible. Otherwise, EFalse
|
|
331 |
*/
|
|
332 |
void SetFindBoxVisibilityL( TBool aIsVisible );
|
|
333 |
|
|
334 |
/**
|
|
335 |
* Determine find box visibility
|
|
336 |
*
|
|
337 |
* @since 3.1
|
|
338 |
* @return ETrue if find box is currently visible, EFalse otherwise
|
|
339 |
*/
|
|
340 |
TBool FindBoxVisibility();
|
|
341 |
|
|
342 |
/**
|
|
343 |
* Restore the PopupCBA of find box
|
|
344 |
*/
|
|
345 |
void RestoreFindBoxPopupCBA();
|
|
346 |
|
|
347 |
/**
|
|
348 |
* Calculate the top index of the visible items
|
|
349 |
*
|
|
350 |
* @since 3.1
|
|
351 |
* @param aBottomIndex the bottom index of the visible items
|
|
352 |
* @return top index
|
|
353 |
*/
|
|
354 |
TInt CalculateTopIndex( TInt aBottomIndex );
|
|
355 |
|
|
356 |
|
|
357 |
/**
|
|
358 |
* Enable/disable find box
|
|
359 |
*
|
|
360 |
* @since 3.1
|
|
361 |
* @aEnable ETrue to enable find box, EFalse to disable
|
|
362 |
*/
|
|
363 |
void EnableFindBox( TBool aEnable );
|
|
364 |
|
|
365 |
/**
|
|
366 |
* Enable/disable marking
|
|
367 |
*
|
|
368 |
* @since 3.1
|
|
369 |
* @aEnable ETrue to enable marking, EFalse to disable
|
|
370 |
*/
|
|
371 |
void EnableMarking( TBool aEnable );
|
|
372 |
|
|
373 |
/**
|
|
374 |
* Custom handling of commands for markable lists.
|
|
375 |
*/
|
|
376 |
void HandleMarkableListProcessCommandL( TInt aCommand );
|
|
377 |
|
|
378 |
/**
|
|
379 |
* Custom handling of menu pane for markable lists
|
|
380 |
*/
|
|
381 |
void HandleMarkableListDynInitMenuPane(
|
|
382 |
TInt aResourceId,
|
|
383 |
CEikMenuPane* aMenuPane );
|
|
384 |
|
|
385 |
|
|
386 |
// from base class MMPXViewContainer
|
|
387 |
|
|
388 |
/**
|
|
389 |
* Handles key events.
|
|
390 |
*
|
|
391 |
* @param aKeyEvent The key event.
|
|
392 |
* @param aType The type of key event.
|
|
393 |
*/
|
|
394 |
TKeyResponse HandleKeyEventL(
|
|
395 |
const TKeyEvent& aKeyEvent,
|
|
396 |
TEventCode aType );
|
|
397 |
|
|
398 |
/**
|
|
399 |
* Handles the retrieval of the view container's help context.
|
|
400 |
*
|
|
401 |
* @param aContext The control's help context.
|
|
402 |
*/
|
|
403 |
void HandleHelpContext( TCoeHelpContext& aContext ) const;
|
|
404 |
|
|
405 |
/**
|
|
406 |
* Returns the indicators for the specified item within the view container
|
|
407 |
*
|
|
408 |
* @param aIndex specified array index
|
|
409 |
* @return Indicator icon indices
|
|
410 |
*/
|
|
411 |
RArray<TInt> IndicatorsL( TInt aIndex );
|
|
412 |
|
|
413 |
void SetCbaHandler( MMpxCbaHandler* aCbaHandler );
|
|
414 |
|
|
415 |
// from base class CCoeControl
|
|
416 |
|
|
417 |
/**
|
|
418 |
* From CCoeControl.
|
|
419 |
* Handles key events.
|
|
420 |
*
|
|
421 |
* @param aKeyEvent The key event.
|
|
422 |
* @param aType The type of key event.
|
|
423 |
*/
|
|
424 |
TKeyResponse OfferKeyEventL(
|
|
425 |
const TKeyEvent& aKeyEvent,
|
|
426 |
TEventCode aType );
|
|
427 |
|
|
428 |
/**
|
|
429 |
* From CCoeControl.
|
|
430 |
* Gets the control's help context.
|
|
431 |
*
|
|
432 |
* @param aContext The control's help context.
|
|
433 |
*/
|
|
434 |
void GetHelpContext( TCoeHelpContext& aContext ) const;
|
|
435 |
|
|
436 |
/**
|
|
437 |
* From CoeControl.
|
|
438 |
* Handles a change to the control's resources.
|
|
439 |
*
|
|
440 |
* @param aType A message UID value.
|
|
441 |
*/
|
|
442 |
void HandleResourceChange( TInt aType );
|
|
443 |
|
|
444 |
/**
|
|
445 |
* From CoeControl.
|
|
446 |
* Draw this application's view to the screen
|
|
447 |
*
|
|
448 |
* @param aRect the rectangle of this view that needs updating
|
|
449 |
*/
|
|
450 |
void Draw( const TRect& aRect ) const;
|
|
451 |
|
|
452 |
/**
|
|
453 |
* From CoeControl.
|
|
454 |
* Get the control input capabilities
|
|
455 |
*/
|
|
456 |
TCoeInputCapabilities InputCapabilities() const;
|
|
457 |
|
|
458 |
TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
|
|
459 |
|
|
460 |
void HandleGainingForeground();
|
|
461 |
|
|
462 |
void HandleLosingForeground();
|
|
463 |
|
|
464 |
// from base class MCoeControlObserver
|
|
465 |
|
|
466 |
/**
|
|
467 |
* From MCoeControlObserver, Acts upon changes in the hosted control's state.
|
|
468 |
* This class's implementation is trivial and should be able to be safely
|
|
469 |
* re-implemented in directly client-derived classes. For non-base setting
|
|
470 |
* page classes, a call to the base class should be made.
|
|
471 |
* @param aControl Control that caused the event. (not used in default implementation)
|
|
472 |
* @param aEventType Type of the event.
|
|
473 |
*/
|
|
474 |
void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
|
|
475 |
|
|
476 |
|
|
477 |
/**
|
|
478 |
* From MMPXCommonListBoxArrayObserver.
|
|
479 |
* Handle listbox array events
|
|
480 |
*
|
|
481 |
* @param aEvent list box event
|
|
482 |
*/
|
|
483 |
void HandleListBoxArrayEventL(
|
|
484 |
MMPXCommonListBoxArrayObserver::TMPXCommonListBoxArrayEvents aEvent );
|
|
485 |
|
|
486 |
|
|
487 |
// from base class MHgScrollBufferObserver
|
|
488 |
|
|
489 |
/**
|
|
490 |
* from MHgScrollBufferObserver
|
|
491 |
* Buffer position changed.
|
|
492 |
* The items between the aBufferStart and aBufferEnd should be loaded as soon as possible.
|
|
493 |
*
|
|
494 |
* @param aBufferStart The index of the first item in buffer.
|
|
495 |
* @param aBufferEnd The index of the last item in buffer.
|
|
496 |
* @param aDirection report direction of scrolling
|
|
497 |
*/
|
|
498 |
void Request(TInt aBufferStart, TInt aBufferEnd, THgScrollDirection aDirection);
|
|
499 |
|
|
500 |
// from base class MHgBufferOwner
|
|
501 |
|
|
502 |
/**
|
|
503 |
* from MHgBufferOwner
|
|
504 |
*
|
|
505 |
*
|
|
506 |
*/
|
|
507 |
void Release(TInt aReleaseStart, TInt aReleaseEnd);
|
|
508 |
|
|
509 |
|
|
510 |
// from base class MHgSelectionObserver
|
|
511 |
|
|
512 |
/**
|
|
513 |
* Handle selection.
|
|
514 |
*
|
|
515 |
* @param aIndex Selected item index.
|
|
516 |
*/
|
|
517 |
void HandleSelectL( TInt aIndex );
|
|
518 |
|
|
519 |
void HandleSelectL( TInt aIndex, CCoeControl* aControl );
|
|
520 |
/**
|
|
521 |
* Handle opening.
|
|
522 |
*
|
|
523 |
* @param aIndex Opened item index.
|
|
524 |
*/
|
|
525 |
void HandleOpenL( TInt aIndex );
|
|
526 |
void HandleOpenL( TInt aIndex, CCoeControl* aControl );
|
|
527 |
|
|
528 |
|
|
529 |
/**
|
|
530 |
* From MMPXCollectionFindObserver
|
|
531 |
* Handle callback for "find" operation
|
|
532 |
*
|
|
533 |
* @param aEntries, CMPXMedia to be returned
|
|
534 |
* @param aComplete ETrue no more entries. EFalse more entries
|
|
535 |
* expected
|
|
536 |
* @param aError error code
|
|
537 |
*/
|
|
538 |
void HandleFindAllL( const CMPXMedia& aResults, TBool aComplete, TInt aError );
|
|
539 |
|
|
540 |
void TNReadyL(TInt aError, CFbsBitmap* aBitmap, CFbsBitmap* aMask, TInt aIndex);
|
|
541 |
|
|
542 |
/**
|
|
543 |
* Determines if current selected list item is a song
|
|
544 |
*
|
|
545 |
* @return ETrue if is a song, EFalse otherwise
|
|
546 |
*/
|
|
547 |
TBool IsSelectedItemASong();
|
|
548 |
|
|
549 |
void HandleItemCommandL( TInt aCommand );
|
|
550 |
|
|
551 |
CMPXMedia* SelectedItemMediaL();
|
|
552 |
|
|
553 |
/**
|
|
554 |
* Determines if current view is TBoneview
|
|
555 |
*
|
|
556 |
* @return ETrue if current view is TBoneview, EFalse otherwise
|
|
557 |
*/
|
|
558 |
TBool IsTBoneView();
|
|
559 |
|
|
560 |
TBool OfferCommandL(TInt aCommand);
|
|
561 |
|
|
562 |
/**
|
|
563 |
* Records begin state for the transition animation.
|
|
564 |
*/
|
|
565 |
void BeginFullScreenAnimation();
|
|
566 |
|
|
567 |
/**
|
|
568 |
* Set the previous view Uid
|
|
569 |
*
|
|
570 |
* @param aViewUid UId of the previous view.
|
|
571 |
*/
|
|
572 |
void SetPreviousViewId(TUid aViewUid);
|
|
573 |
|
|
574 |
/**
|
|
575 |
* Hides container window controls.
|
|
576 |
*/
|
|
577 |
void HideContainerWindow();
|
|
578 |
|
|
579 |
private:
|
|
580 |
|
|
581 |
/**
|
|
582 |
* C++ constructor.
|
|
583 |
*/
|
|
584 |
CMPXCollectionViewHgContainer(
|
|
585 |
MEikCommandObserver* aView,
|
|
586 |
MEikListBoxObserver* aObserver,
|
|
587 |
MMPXSelectedAlbumHandler* aSelectedAlbumHandler,
|
|
588 |
TBool aIsEmbedded);
|
|
589 |
|
|
590 |
/**
|
|
591 |
* Symbian 2nd phase constructor.
|
|
592 |
*/
|
|
593 |
void ConstructL();
|
|
594 |
|
|
595 |
/**
|
|
596 |
* Creates listbox array
|
|
597 |
*/
|
|
598 |
CMPXCommonListBoxArrayBase* CreateListBoxArrayL();
|
|
599 |
|
|
600 |
/**
|
|
601 |
* From MHgVgMediaWallObserver
|
|
602 |
*/
|
|
603 |
void HandleMediaWallEvent(TInt aEvent, CHgVgMediaWall* aSender);
|
|
604 |
|
|
605 |
/**
|
|
606 |
* Creates icon array, populates iIconArray to be used by listbox
|
|
607 |
*/
|
|
608 |
void CreateIconArrayL();
|
|
609 |
|
|
610 |
/**
|
|
611 |
* Sets default icon for HgList
|
|
612 |
*/
|
|
613 |
void SetDefaultIconL();
|
|
614 |
|
|
615 |
/**
|
|
616 |
* Sets default icon for list item
|
|
617 |
*/
|
|
618 |
void SetDefaultIconL(TInt aIndex);
|
|
619 |
|
|
620 |
/*
|
|
621 |
* Adds detail to the list item at the specified index
|
|
622 |
*/
|
|
623 |
void AddDetailToDisplayedItemL( CHgItem* aVisualItem, CMPXMedia* aMedia, TInt aIndex);
|
|
624 |
void AddThumbnailToDisplayedItemL( CHgItem* aVisualItem, CMPXMedia* aMedia, TInt aIndex);
|
|
625 |
void SetTitleL( CHgItem* aVisualItem, CMPXMedia* aMedia );
|
|
626 |
void SetSongTitleL( CHgItem* aVisualItem, CMPXMedia* aMedia );
|
|
627 |
void SetDetailCountL( CHgItem* aVisualItem, CMPXMedia* aMedia );
|
|
628 |
void SetDetailArtistL( CHgItem* aVisualItem, CMPXMedia* aMedia );
|
|
629 |
void SetDetailAlbumL( CHgItem* aVisualItem, CMPXMedia* aMedia );
|
|
630 |
void SetDetailDurationL( CHgItem* aVisualItem, CMPXMedia* aMedia );
|
|
631 |
void UpdateTimeIndicatorsL( TDes& aBuf, TInt aDuration );
|
|
632 |
void SetDetailIndicatorL( CHgItem* aVisualItem, TInt aIndex );
|
|
633 |
void SetDetailIconL( CHgItem* aVisualItem, TInt aIndex );
|
|
634 |
void SetDetailThumbnailL( CMPXMedia* aMedia, TInt aIndex = 0 );
|
|
635 |
CGulIcon* DefaultIconL();
|
|
636 |
void SetDetailIconShuffleL();
|
|
637 |
TBool SetShuffleItemTextL(CHgItem* aItem, CMPXMedia* aMedia);
|
|
638 |
void SetShuffleItemToListL( CHgScroller* aList );
|
|
639 |
|
|
640 |
/**
|
|
641 |
* Set the collection context
|
|
642 |
*/
|
|
643 |
void SetCollectionContextL();
|
|
644 |
|
|
645 |
void ProvideDataL( TInt aStart, TInt aEnd );
|
|
646 |
|
|
647 |
void SetScrollbarType();
|
|
648 |
|
|
649 |
void CancelTNRequest();
|
|
650 |
|
|
651 |
/**
|
|
652 |
* Save the selected album item
|
|
653 |
*
|
|
654 |
*/
|
|
655 |
void SaveSelectedAlbumItemL(TInt aIndex);
|
|
656 |
|
|
657 |
/**
|
|
658 |
* Write the album name, artist name and album art in media data to file
|
|
659 |
*
|
|
660 |
* @param aMedia the selected media data in Album view
|
|
661 |
*/
|
|
662 |
void WriteToStreamFileL( const CMPXMedia* aMedia );
|
|
663 |
|
|
664 |
/**
|
|
665 |
* Read the album name, artist name and album art from file
|
|
666 |
*
|
|
667 |
* @param aMedia the media data will be returned
|
|
668 |
*/
|
|
669 |
void ReadFromStreamFileL( CMPXMedia* aMedia );
|
|
670 |
|
|
671 |
void RestoreSelectedAlbumItemL(const CMPXMediaArray& aMediaArray);
|
|
672 |
|
|
673 |
/**
|
|
674 |
* Refresh list as needed
|
|
675 |
*/
|
|
676 |
void RefreshL(TInt aIndex);
|
|
677 |
|
|
678 |
/**
|
|
679 |
* Refresh list as needed
|
|
680 |
*/
|
|
681 |
void RefreshNoThumbnailL(TInt aIndex);
|
|
682 |
|
|
683 |
/**
|
|
684 |
* Clean AlbumArt request Queue
|
|
685 |
*/
|
|
686 |
void CleanAlbumArtReqQueue();
|
|
687 |
|
|
688 |
/**
|
|
689 |
* Handle data providing in requests in visible area
|
|
690 |
* @param aBufferStart the starting buffer index
|
|
691 |
* @param aBufferEnd the ending buffer index
|
|
692 |
*/
|
|
693 |
void ProvideDataIntersectL(TInt aBufferStart, TInt aBufferEnd);
|
|
694 |
|
|
695 |
/**
|
|
696 |
* Handle data providing in requests in non visible area
|
|
697 |
* @param aBufferStart the starting buffer index
|
|
698 |
* @param aBufferEnd the ending buffer index
|
|
699 |
*/
|
|
700 |
void ProvideDataDifferenceL(TInt aBufferStart, TInt aBufferEnd);
|
|
701 |
|
|
702 |
/**
|
|
703 |
* Provide data without providing thumbnails to list
|
|
704 |
* @param aMediaArray the media array to pull data from
|
|
705 |
* @param aStartIndex the starting index index
|
|
706 |
*/
|
|
707 |
void ProvideDataWithoutThumbnailsL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
|
|
708 |
|
|
709 |
/**
|
|
710 |
* Provide data without providing thumbnails to media wall
|
|
711 |
* @param aMediaArray the media array to pull data from
|
|
712 |
* @param aStartIndex the starting index index
|
|
713 |
*/
|
|
714 |
void ProvideDataWithoutThumbnailsMwL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
|
|
715 |
|
|
716 |
/**
|
|
717 |
* Handle data providing in specified range.
|
|
718 |
* @param aBufferStart the starting buffer index
|
|
719 |
* @param aBufferEnd the ending buffer index
|
|
720 |
*/
|
|
721 |
void ProvideDataForRangeL( TInt aBufferStart, TInt aBufferEnd );
|
|
722 |
|
|
723 |
/**
|
|
724 |
* Prepare media wall to be shown
|
|
725 |
* @param aMediaArray the media array to pull data from
|
|
726 |
* @param aCount Number of items in media wall
|
|
727 |
*/
|
|
728 |
void PrepareMediaWallL(const CMPXMediaArray& aMediaArray, TInt aCount);
|
|
729 |
|
|
730 |
/**
|
|
731 |
* Prepare TBone view to be shown
|
|
732 |
* @param aMediaArray the media array to pull data from
|
|
733 |
* @param aCount Number of items in media wall portion of tbone.
|
|
734 |
*/
|
|
735 |
void PrepareMediaWallWithListL(const CMPXMediaArray& aMediaArray, TInt aCount);
|
|
736 |
|
|
737 |
/**
|
|
738 |
* Prepare list to be shown
|
|
739 |
* @param aMediaArray the media array to pull data from
|
|
740 |
* @param aCount Number of items in list
|
|
741 |
*/
|
|
742 |
void PrepareListL(const CMPXMediaArray& aMediaArray, TInt aCount);
|
|
743 |
|
|
744 |
/**
|
|
745 |
* Handle list resizing
|
|
746 |
* @param aMediaArray the media array to pull data from
|
|
747 |
* @param aCount Number of items in list
|
|
748 |
*/
|
|
749 |
void ResizeListL(const CMPXMediaArray& aMediaArray, TInt aCount);
|
|
750 |
|
|
751 |
/**
|
|
752 |
* Get the current list instance
|
|
753 |
* @param aIndex Index from list control
|
|
754 |
* @return Instance of scroller object
|
|
755 |
*/
|
|
756 |
CHgScroller* CurrentListWidget();
|
|
757 |
|
|
758 |
/**
|
|
759 |
* Resolve the type of view based on current browsing context
|
|
760 |
* @param aCount Count from media array
|
|
761 |
*/
|
|
762 |
void ResolveCurrentViewType(TInt aCount);
|
|
763 |
|
|
764 |
/**
|
|
765 |
* Clean up the previous view's resources.
|
|
766 |
*/
|
|
767 |
void CleanPrevView();
|
|
768 |
|
|
769 |
/**
|
|
770 |
* Initiate shuffle play all operation
|
|
771 |
* @return ETrue if shuffle operation is started.
|
|
772 |
*/
|
|
773 |
TBool ShufflePlayAllL(TInt aIndex);
|
|
774 |
|
|
775 |
/**
|
|
776 |
* Update the collection path and open it to start playback.
|
|
777 |
* @param aIndex The selected media array index to start playing.
|
|
778 |
* @param aSelectAll Indicate if all items should be selected.
|
|
779 |
*/
|
|
780 |
void UpdatePathAndOpenL(TInt aIndex, TBool aSelectAll = EFalse);
|
|
781 |
|
|
782 |
/**
|
|
783 |
* Construct a collection path with the current selection and
|
|
784 |
* construct a playlist from path to start playback.
|
|
785 |
* @param aResults The media results from find operation.
|
|
786 |
*/
|
|
787 |
void UpdatePathAndOpenPlaylistL( const CMPXMedia& aResults );
|
|
788 |
|
|
789 |
/**
|
|
790 |
* Find songs belonging to album.
|
|
791 |
* @param aIndex Index in media array of albums
|
|
792 |
*/
|
|
793 |
void FindAlbumSongsL(TInt aIndex);
|
|
794 |
|
|
795 |
/**
|
|
796 |
* Find songs belonging to playlist.
|
|
797 |
* @param aIndex Index in media array of playlists
|
|
798 |
*/
|
|
799 |
void FindPlaylistSongsL(TInt aIndex);
|
|
800 |
|
|
801 |
/**
|
|
802 |
* Find songs belonging to genre.
|
|
803 |
* @param aIndex Index in media array of genres
|
|
804 |
*/
|
|
805 |
void FindGenreSongsL(TInt aIndex);
|
|
806 |
|
|
807 |
/**
|
|
808 |
* Check if the currently playing track is in path
|
|
809 |
* @param aPath Collection path of playlist
|
|
810 |
* @return ETrue if current track is playing
|
|
811 |
*/
|
|
812 |
TBool IsPlayingCurrentIndexL(CMPXCollectionPath* aPath);
|
|
813 |
|
|
814 |
/**
|
|
815 |
* Show list of songs in an album in a dialog popup.
|
|
816 |
* @param aAlbum Album container with list of songs
|
|
817 |
*/
|
|
818 |
void ShowAlbumSongsDialogL( const CMPXMedia& aAlbum );
|
|
819 |
|
|
820 |
/**
|
|
821 |
* Show list of songs in an album
|
|
822 |
* @param aAlbum Album container with list of songs
|
|
823 |
*/
|
|
824 |
void ShowAlbumSongsL( const CMPXMedia& aAlbum );
|
|
825 |
|
|
826 |
/**
|
|
827 |
* Open the album to show its contents
|
|
828 |
* @param aIndex Index of the album in media array
|
|
829 |
*/
|
|
830 |
void OpenAlbumL(TInt aIndex);
|
|
831 |
|
|
832 |
/**
|
|
833 |
* Play the album
|
|
834 |
* @param aIndex Index of the album in media array
|
|
835 |
*/
|
|
836 |
void PlayAlbumL(TInt aIndex);
|
|
837 |
|
|
838 |
/**
|
|
839 |
* Play the playlist
|
|
840 |
* @param aIndex Index of the album in media array
|
|
841 |
*/
|
|
842 |
void PlayPlaylistL(TInt aIndex);
|
|
843 |
|
|
844 |
/**
|
|
845 |
* Play the genre
|
|
846 |
* @param aIndex Index of the album in media array
|
|
847 |
*/
|
|
848 |
void PlayGenreL(TInt aIndex);
|
|
849 |
|
|
850 |
static TInt AsyncCallback( TAny* aPtr );
|
|
851 |
|
|
852 |
/**
|
|
853 |
* Prepare to show the TBone view.
|
|
854 |
*/
|
|
855 |
void PrepareTboneViewL();
|
|
856 |
|
|
857 |
/**
|
|
858 |
* Check if shuffle item is present in the view.
|
|
859 |
* @return ETrue if shuffle item is present.
|
|
860 |
*/
|
|
861 |
TBool ShuffleItemPresent();
|
|
862 |
|
|
863 |
/**
|
|
864 |
* Mapping function to convert from list index to media index.
|
|
865 |
* @param aIndex Index from list control
|
|
866 |
* @return media array index
|
|
867 |
*/
|
|
868 |
TInt MediaIndex(TInt aIndex) const;
|
|
869 |
|
|
870 |
/**
|
|
871 |
* Load and set empty text.
|
|
872 |
*/
|
|
873 |
void LoadAndSetEmptyTextL();
|
|
874 |
|
|
875 |
/**
|
|
876 |
* End fullscreen animation effects.
|
|
877 |
*/
|
|
878 |
void EndFullScreenAnimation();
|
|
879 |
|
|
880 |
/**
|
|
881 |
* Resolve popup list rectangle size.
|
|
882 |
*/
|
|
883 |
void ResolvePopupListSizeL();
|
|
884 |
|
|
885 |
/**
|
|
886 |
* Setup transition type
|
|
887 |
* @param aType Type of transition to be used.
|
|
888 |
* @param aPrevViewWasPlayback ETrue if previous view was playback.
|
|
889 |
* This information used to decide animation direction.
|
|
890 |
*/
|
|
891 |
void SetupTransitionType( TInt aType, TBool aPrevViewWasPlayback = EFalse );
|
|
892 |
|
|
893 |
private: // data member
|
|
894 |
|
|
895 |
/**
|
|
896 |
* Context of collection view. It's the exact location within collection navigation
|
|
897 |
* based on category type + category.
|
|
898 |
*/
|
|
899 |
enum TContext
|
|
900 |
{
|
|
901 |
EContextUnknown,
|
|
902 |
EContextGroupCollection,
|
|
903 |
EContextGroupArtist,
|
|
904 |
EContextGroupAlbum,
|
|
905 |
EContextGroupPlaylist,
|
|
906 |
EContextGroupSong,
|
|
907 |
EContextGroupPodcast,
|
|
908 |
EContextGroupGenre,
|
|
909 |
EContextGroupComposer,
|
|
910 |
EContextItemArtist,
|
|
911 |
EContextItemAlbum,
|
|
912 |
EContextItemPlaylist,
|
|
913 |
EContextItemSong,
|
|
914 |
EContextItemPodcast,
|
|
915 |
EContextItemGenre,
|
|
916 |
EContextItemComposer
|
|
917 |
};
|
|
918 |
|
|
919 |
enum TDefaultIcon
|
|
920 |
{
|
|
921 |
EMPXDefaultIconNotSet = -1,
|
|
922 |
EMPXDefaultIconArtist,
|
|
923 |
EMPXDefaultIconAlbum,
|
|
924 |
EMPXDefaultIconPlaylist,
|
|
925 |
EMPXDefaultIconSongs,
|
|
926 |
EMPXDefaultIconPodcasts,
|
|
927 |
EMPXDefaultIconGenre,
|
|
928 |
EMPXDefaultIconComposer,
|
|
929 |
EMPXDefaultTitleIconPodcasts,
|
|
930 |
EMPXDefaultIconEmpty
|
|
931 |
};
|
|
932 |
|
|
933 |
enum TViewType
|
|
934 |
{
|
|
935 |
EMPXViewUnknown,
|
|
936 |
EMPXViewMediawall,
|
|
937 |
EMPXViewList,
|
|
938 |
EMPXViewTBone
|
|
939 |
};
|
|
940 |
|
|
941 |
enum TFindOp
|
|
942 |
{
|
|
943 |
EMPXNoOp,
|
|
944 |
EMPXOpenAlbum,
|
|
945 |
EMPXPlayAlbum,
|
|
946 |
EMPXPlayPlaylist,
|
|
947 |
EMPXPlayGenre
|
|
948 |
};
|
|
949 |
|
|
950 |
MEikCommandObserver* iView; // not owned
|
|
951 |
MEikListBoxObserver* iListBoxObserver; // not owned
|
|
952 |
CAknContextPane* iContextPane; // Not owned
|
|
953 |
CMPXCollectionViewListBoxArray* iListBoxArray; // owned
|
|
954 |
CEikImage* iNewIcon; // New context icon, owned
|
|
955 |
CEikImage* iOrigIcon; // New context icon, not owned
|
|
956 |
TBool iReorder;
|
|
957 |
TBool iReady;
|
|
958 |
TBool iIsEmbedded;
|
|
959 |
|
|
960 |
CAknPopupList* iDialog; // Album tracks dielog. owned.
|
|
961 |
|
|
962 |
THgScrollDirection iDirection;
|
|
963 |
RArray<TBool> iThumbnailReqMap;
|
|
964 |
|
|
965 |
HBufC* iAlbumTitle;
|
|
966 |
HBufC* iSongTitle;
|
|
967 |
|
|
968 |
TBool iPodcastContext;
|
|
969 |
TBool iTitleSet;
|
|
970 |
TDefaultIcon iCurrentDefaultIcon;
|
|
971 |
|
|
972 |
TFileName iSelectedAlbumItemFileName;
|
|
973 |
CMPXMedia* iSelectedMediaInAlbumView;
|
|
974 |
|
|
975 |
CMPXCommonUiHelper* iCommonUiHelper; // Owned
|
|
976 |
MMPXCollectionUtility* iCollectionUtility; // Owned
|
|
977 |
MMPXPlaybackUtility* iPlaybackUtility; // Owned
|
|
978 |
|
|
979 |
CHgScroller* iMwListWidget; // Owned
|
|
980 |
CHgScroller* iListWidget; // Owned
|
|
981 |
CHgVgMediaWall* iMediaWall; // Owned
|
|
982 |
CMpxTNLoader* iThumbnailManager; // Owned
|
|
983 |
|
|
984 |
TContext iContext;
|
|
985 |
TContext iPrevContext;
|
|
986 |
TInt iResourceOffset; // Must be freed
|
|
987 |
TBool iIsMarkingEnabled;
|
|
988 |
TInt iTopIndex;
|
|
989 |
TInt iBottomIndex;
|
|
990 |
TSize iImageSize;
|
|
991 |
CAknsBasicBackgroundControlContext* iBgContext; // Owned
|
|
992 |
|
|
993 |
CArrayFixFlat<TInt>* iListSelections; // Owned
|
|
994 |
CAknIconArray* iIconArray; // Owned
|
|
995 |
|
|
996 |
MMPXCollectionUiHelper* iCollectionUiHelper;
|
|
997 |
CMPXCollectionPlaylist* iPlaylist;
|
|
998 |
CMPXCollectionViewHgPlaylistHelper* iPlaylistHelper;
|
|
999 |
|
|
1000 |
// List/Media wall management
|
|
1001 |
TInt iLastValidMediaItemIndex;
|
|
1002 |
TInt iRequestStart;
|
|
1003 |
TInt iRequestEnd;
|
|
1004 |
TInt iAlbumIndex; // opened album index in mediawall
|
|
1005 |
TInt iSelectedAlbumIndex; // selected album index in mediawall
|
|
1006 |
TInt iRestoredAlbumIndex; // restored selected album index
|
|
1007 |
MMPXSelectedAlbumHandler* iSelectedAlbumHandler;
|
|
1008 |
TBool iDefaultIconSet;
|
|
1009 |
MMpxCbaHandler* iCbaHandler;
|
|
1010 |
TViewType iCurrentViewType;
|
|
1011 |
TViewType iPrevViewType;
|
|
1012 |
TFindOp iFindOp;
|
|
1013 |
TBool iIsForeground;
|
|
1014 |
TBool iDelayedControlCreation;
|
|
1015 |
CAsyncCallBack* iAsyncCallBack;
|
|
1016 |
TBool iOpenAlbumTracks;
|
|
1017 |
TInt iShuffleItem;
|
|
1018 |
TBool iSetEmptyTextNeeded;
|
|
1019 |
TTransitionType iTranstionType;
|
|
1020 |
TBool iLayoutSwitch;
|
|
1021 |
TRect iPopupListRect;
|
|
1022 |
TUid iPreviousViewId;
|
|
1023 |
TBool iPreviousOrientation;
|
|
1024 |
TBool iDrawBackGround;
|
|
1025 |
};
|
|
1026 |
|
|
1027 |
#endif // CMPXCOLLECTIONVIEWHGCONTAINER_H
|
|
1028 |
|
|
1029 |
// End of File
|