mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h
changeset 0 ff3acec5bc43
child 1 8118492f1bdf
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     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 
       
    56 // CLASS DECLARATION
       
    57 
       
    58 /**
       
    59  *  MPX Collection view container.
       
    60  *
       
    61  *  @lib mpxcollectionviewhg.lib
       
    62  *  @since S60 v5.0
       
    63  */
       
    64 NONSHARABLE_CLASS( CMPXCollectionViewHgContainer )
       
    65     : public CCoeControl
       
    66     , public MCoeControlObserver
       
    67     , public MMPXCommonListBoxArrayObserver
       
    68 	, public MHgScrollBufferObserver
       
    69 	, public MHgSelectionObserver
       
    70     , public MMPXCollectionFindObserver
       
    71     , public MHgVgMediaWallObserver
       
    72     , public MMpxTNLoaderObserver
       
    73 	{
       
    74 public:
       
    75 
       
    76     /**
       
    77      * Two-phased constructor.
       
    78      *
       
    79      * @since 5.1
       
    80      * @param aView Command observer.
       
    81      * @param aObserver MEikListBoxObserver
       
    82      * @param aIsEmbedded ETrue to indicate that view is embedded
       
    83      * @return Pointer to newly created object.
       
    84      */
       
    85     static CMPXCollectionViewHgContainer* NewL(
       
    86         MEikCommandObserver* aView,
       
    87         MEikListBoxObserver* aObserver,
       
    88         TBool aIsEmbedded );
       
    89 
       
    90     /**
       
    91      * Destructor.
       
    92      */
       
    93     virtual ~CMPXCollectionViewHgContainer();
       
    94 
       
    95     /**
       
    96      * Sets playback status with item id
       
    97      *
       
    98      * @param aId item id of the song
       
    99      * @param aStatus status of the song
       
   100      */
       
   101     void SetPlaybackStatusByIdL( TMPXItemId aId, TMPXPlaybackState aStatus, TInt aIndex = 0 );
       
   102 
       
   103     /**
       
   104      * Get current playback index
       
   105      *
       
   106      * @return Current playback index, KErrNotFound if nothing is playing
       
   107      */
       
   108     TInt PlaybackIndex();
       
   109 
       
   110     /**
       
   111      * Activates reorder mode
       
   112      *
       
   113      * @param aEnable ETrue to enable reorder mode, EFalse to disable
       
   114      */
       
   115     void ActivateReorderMode( TBool aEnable );
       
   116 
       
   117     /**
       
   118      * Set reorder mode
       
   119      *
       
   120      * @param aEnable ETrue to enable reorder mode, EFalse to disable reorder mode
       
   121      * @param aIndex current selected index
       
   122      */
       
   123     void SetReorderGrabbedMode( TBool aEnable, TInt aIndex = 0 );
       
   124 
       
   125     /**
       
   126      * Determines if it's currently in reorder mode
       
   127      *
       
   128      * @return ETrue if in reorder mode, EFalse otherwise
       
   129      */
       
   130     TBool IsInReorderMode();
       
   131 
       
   132     /**
       
   133      * Move current reorder index relatively
       
   134      *
       
   135      * @param aDirection +1 to move down, -1 to move up
       
   136      */
       
   137     void MoveReorderIndex( TInt aDirection );
       
   138 
       
   139     /**
       
   140      * Set current reorder index
       
   141      *
       
   142      * @param aIndex current reorder index
       
   143      */
       
   144     void SetReorderIndex( TInt aIndex );
       
   145 
       
   146     /**
       
   147      * Confirm reorder
       
   148      */
       
   149     void ConfirmReorderL();
       
   150 
       
   151     /**
       
   152      * Cancel reorder
       
   153      */
       
   154     void CancelReorder();
       
   155 
       
   156     /**
       
   157      * Gets original index of currently selected item in reorder mode
       
   158      */
       
   159     TInt GetOriginalIndex();
       
   160 
       
   161     /**
       
   162      * Update Titlepane icon to reorder image
       
   163      */
       
   164     void UpdateReorderTitleIconL();
       
   165 
       
   166     /**
       
   167      * Update titlepane to use original icon
       
   168      */
       
   169     void RestoreOriginalTitleIconL();
       
   170 
       
   171     /**
       
   172      * Content is ready
       
   173      */
       
   174     void ContentIsReady( TBool aReady );
       
   175 
       
   176     /**
       
   177      * Returns list box array, ownership not transfered
       
   178      *
       
   179      * @since 3.1
       
   180      * @return A pointer to the list box array
       
   181      */
       
   182     CMPXCommonListBoxArrayBase* ListBoxArray() const;
       
   183 
       
   184     /**
       
   185      * Return number of listbox items shown in the current listbox.
       
   186      *
       
   187      * @since 3.1
       
   188      * @return The number of items shown in the list box
       
   189      */
       
   190     TInt CurrentListItemCount() const;
       
   191 
       
   192     /**
       
   193      * Return total number of listbox items in the listbox.
       
   194      *
       
   195      * @since 3.1
       
   196      * @return Total items in the list box
       
   197      */
       
   198     TInt TotalListItemCount() const;
       
   199 
       
   200     /**
       
   201      * Gets top listbox item index (relative to the original listbox).
       
   202      * @return Top listbox item index
       
   203      *
       
   204      * @since 3.1
       
   205      */
       
   206     TInt TopLbxItemIndex() const;
       
   207 
       
   208     /**
       
   209      * Gets bottom listbox item index (relative to the original listbox).
       
   210      * @return Bottom listbox item index
       
   211      *
       
   212      * @since 3.1
       
   213      */
       
   214     TInt BottomLbxItemIndex() const;
       
   215 
       
   216     /**
       
   217      * Gets current listbox item index (relative to the original listbox).
       
   218      * @return Current listbox item index
       
   219      *
       
   220      * @since 3.1
       
   221      */
       
   222     TInt CurrentLbxItemIndex() const;
       
   223 
       
   224     /**
       
   225      * Get current selected listbox items indices (relative to the original
       
   226      * listbox). Ownership not transferred.
       
   227      *
       
   228      * @since 3.1
       
   229      * @return Current listbox item indices
       
   230      */
       
   231     const CArrayFix<TInt>* CurrentSelectionIndicesL() const;
       
   232 
       
   233     /**
       
   234      * Sewt current selected listbox items indices
       
   235      *
       
   236      * @since 3.1
       
   237      * @param aIndices Array of selection indices, ownership not transfered
       
   238      */
       
   239     void SetCurrentSelectionIndicesL( CArrayFix<TInt>* aIndices ) const;
       
   240 
       
   241     /**
       
   242      * Set top listbox item index.
       
   243      *
       
   244      * @since 3.1
       
   245      * @param aIndex Actual listbox index.
       
   246      */
       
   247     void SetLbxTopItemIndex( TInt aIndex );
       
   248 
       
   249     /**
       
   250      * Set current listbox item index.
       
   251      *
       
   252      * @since 3.1
       
   253      * @param aIndex Actual listbox index.
       
   254      */
       
   255     void SetLbxCurrentItemIndex( TInt aIndex );
       
   256 
       
   257     /**
       
   258      * Set current listbox item index and highlight it.
       
   259      *
       
   260      * @since 3.1
       
   261      * @param aIndex Actual listbox index.
       
   262      */
       
   263     void SetLbxCurrentItemIndexAndDraw( TInt aIndex );
       
   264 
       
   265     /**
       
   266      * Clear listbox selection.
       
   267      *
       
   268      * @since 3.1
       
   269      */
       
   270     void ClearLbxSelection();
       
   271 
       
   272     /**
       
   273      * Sets list box backround text. This text is visible if the list box
       
   274      * has no items.
       
   275      *
       
   276      * @param aText The text for the empty list box background.
       
   277      * @since 3.2
       
   278      */
       
   279 	void SetLbxEmptyTextL( const TDesC& aText );
       
   280 
       
   281     /**
       
   282      * Draws list box item index
       
   283      *
       
   284      * @since 3.2
       
   285      */
       
   286     void DrawLbxItemL( TInt aIndex );
       
   287 
       
   288     /**
       
   289      * Set Find box's focus.
       
   290      *
       
   291      * @since 3.1
       
   292      * @param aFocus ETrue if set focus on FindBox. Otherwise, EFalse.
       
   293      */
       
   294     void SetFindBoxFocus( TBool aFocus );
       
   295 
       
   296     /**
       
   297      * Handle listbox item addition.
       
   298      *
       
   299      * @since 3.1
       
   300      */
       
   301     void HandleLbxItemAdditionL();
       
   302 
       
   303     /**
       
   304      * Handle listbox item addition, preserving the current display index.
       
   305      *
       
   306      * @since 3.1
       
   307      */
       
   308     void HandleLbxItemAdditionPreserveIndexL();
       
   309 
       
   310     /**
       
   311      * Handle listbox item removal.
       
   312      *
       
   313      * @since 3.1
       
   314      */
       
   315     void HandleLbxItemRemovalL();
       
   316 
       
   317     /**
       
   318      * Show/hide find box
       
   319      *
       
   320      * @since 3.1
       
   321      * @param aIsVisible ETrue to set findbox visible. Otherwise, EFalse
       
   322      */
       
   323     void SetFindBoxVisibilityL( TBool aIsVisible );
       
   324 
       
   325     /**
       
   326      * Determine find box visibility
       
   327      *
       
   328      * @since 3.1
       
   329      * @return ETrue if find box is currently visible, EFalse otherwise
       
   330      */
       
   331     TBool FindBoxVisibility();
       
   332 
       
   333     /**
       
   334      * Restore the PopupCBA of find box
       
   335      */
       
   336     void RestoreFindBoxPopupCBA();
       
   337 
       
   338     /**
       
   339      * Calculate the top index of the visible items
       
   340      *
       
   341      * @since 3.1
       
   342      * @param aBottomIndex the bottom index of the visible items
       
   343      * @return top index
       
   344      */
       
   345     TInt CalculateTopIndex( TInt aBottomIndex );
       
   346 
       
   347 
       
   348     /**
       
   349      * Enable/disable find box
       
   350      *
       
   351      * @since 3.1
       
   352      * @aEnable ETrue to enable find box, EFalse to disable
       
   353      */
       
   354     void EnableFindBox( TBool aEnable );
       
   355 
       
   356     /**
       
   357      * Enable/disable marking
       
   358      *
       
   359      * @since 3.1
       
   360      * @aEnable ETrue to enable marking, EFalse to disable
       
   361      */
       
   362     void EnableMarking( TBool aEnable );
       
   363 
       
   364     /**
       
   365      * Custom handling of commands for markable lists.
       
   366      */
       
   367     void HandleMarkableListProcessCommandL( TInt aCommand );
       
   368 
       
   369     /**
       
   370      * Custom handling of menu pane for markable lists
       
   371      */
       
   372     void HandleMarkableListDynInitMenuPane(
       
   373         TInt aResourceId,
       
   374         CEikMenuPane* aMenuPane );
       
   375 
       
   376 
       
   377 // from base class MMPXViewContainer
       
   378 
       
   379     /**
       
   380      * Handles key events.
       
   381      *
       
   382      * @param aKeyEvent The key event.
       
   383      * @param aType The type of key event.
       
   384      */
       
   385     TKeyResponse HandleKeyEventL(
       
   386         const TKeyEvent& aKeyEvent,
       
   387         TEventCode aType );
       
   388 
       
   389     /**
       
   390      * Handles the retrieval of the view container's help context.
       
   391      *
       
   392      * @param aContext The control's help context.
       
   393      */
       
   394     void HandleHelpContext( TCoeHelpContext& aContext ) const;
       
   395 
       
   396     /**
       
   397      * Returns the indicators for the specified item within the view container
       
   398      *
       
   399      * @param aIndex specified array index
       
   400      * @return Indicator icon indices
       
   401      */
       
   402     RArray<TInt> IndicatorsL( TInt aIndex );
       
   403 
       
   404     void SetCbaHandler( MMpxCbaHandler* aCbaHandler );
       
   405 
       
   406 // from base class CCoeControl
       
   407 
       
   408     /**
       
   409      * From CCoeControl.
       
   410      * Handles key events.
       
   411      *
       
   412      * @param aKeyEvent The key event.
       
   413      * @param aType The type of key event.
       
   414      */
       
   415     TKeyResponse OfferKeyEventL(
       
   416         const TKeyEvent& aKeyEvent,
       
   417         TEventCode aType );
       
   418 
       
   419     /**
       
   420      * From CCoeControl.
       
   421      * Gets the control's help context.
       
   422      *
       
   423      * @param aContext The control's help context.
       
   424      */
       
   425     void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   426 
       
   427     /**
       
   428      * From CoeControl.
       
   429      * Handles a change to the control's resources.
       
   430      *
       
   431      * @param aType A message UID value.
       
   432      */
       
   433     void HandleResourceChange( TInt aType );
       
   434 
       
   435     /**
       
   436      * From CoeControl.
       
   437      * Draw this application's view to the screen
       
   438      *
       
   439      * @param aRect the rectangle of this view that needs updating
       
   440      */
       
   441     void Draw( const TRect& aRect ) const;
       
   442 
       
   443     /**
       
   444      * From CoeControl.
       
   445      * Get the control input capabilities
       
   446      */
       
   447 	TCoeInputCapabilities InputCapabilities() const;
       
   448 
       
   449     TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
   450 
       
   451 
       
   452 // from base class MCoeControlObserver
       
   453 
       
   454     /**
       
   455     * From MCoeControlObserver, Acts upon changes in the hosted control's state.
       
   456     * This class's implementation is trivial and should be able to be safely
       
   457     * re-implemented in directly client-derived classes. For non-base setting
       
   458     * page classes, a call to the base class should be made.
       
   459     * @param aControl Control that caused the event. (not used in default implementation)
       
   460     * @param aEventType Type of the event.
       
   461     */
       
   462     void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
       
   463 
       
   464 
       
   465     /**
       
   466      * From MMPXCommonListBoxArrayObserver.
       
   467      * Handle listbox array events
       
   468      *
       
   469      *  @param aEvent list box event
       
   470      */
       
   471     void HandleListBoxArrayEventL(
       
   472         MMPXCommonListBoxArrayObserver::TMPXCommonListBoxArrayEvents aEvent );
       
   473 
       
   474 
       
   475 // from base class MHgScrollBufferObserver
       
   476 
       
   477     /**
       
   478      * from MHgScrollBufferObserver
       
   479      * Buffer position changed.
       
   480      * The items between the aBufferStart and aBufferEnd should be loaded as soon as possible.
       
   481      *
       
   482      * @param aBufferStart The index of the first item in buffer.
       
   483      * @param aBufferEnd The index of the last item in buffer.
       
   484      * @param aDirection report direction of scrolling
       
   485      */
       
   486     void Request(TInt aBufferStart, TInt aBufferEnd, THgScrollDirection aDirection);
       
   487 
       
   488 // from base class MHgBufferOwner
       
   489 
       
   490     /**
       
   491      * from MHgBufferOwner
       
   492      *
       
   493      *
       
   494      */
       
   495     void Release(TInt aReleaseStart, TInt aReleaseEnd);
       
   496 
       
   497 
       
   498 // from base class MHgSelectionObserver
       
   499 
       
   500     /**
       
   501      * Handle selection.
       
   502      *
       
   503      * @param aIndex Selected item index.
       
   504      */
       
   505     void HandleSelectL( TInt aIndex );
       
   506 
       
   507     void HandleSelectL( TInt aIndex, CCoeControl* aControl );
       
   508     /**
       
   509      * Handle opening.
       
   510      *
       
   511      * @param aIndex Opened item index.
       
   512      */
       
   513     void HandleOpenL( TInt aIndex );
       
   514     void HandleOpenL( TInt aIndex, CCoeControl* aControl );
       
   515 
       
   516 
       
   517     /**
       
   518      *  From MMPXCollectionFindObserver
       
   519      *  Handle callback for "find" operation
       
   520      *
       
   521      *  @param aEntries, CMPXMedia to be returned
       
   522      *  @param aComplete ETrue no more entries. EFalse more entries
       
   523      *                   expected
       
   524      *  @param aError error code
       
   525      */
       
   526     void HandleFindAllL( const CMPXMedia& aResults, TBool aComplete, TInt aError );
       
   527 
       
   528     void TNReadyL(TInt aError, CFbsBitmap* aBitmap, CFbsBitmap* aMask, TInt aIndex);
       
   529 
       
   530     /**
       
   531      * Determines if current selected list item is a song
       
   532      *
       
   533      * @return ETrue if is a song, EFalse otherwise
       
   534      */
       
   535 	TBool IsSelectedItemASong();
       
   536 	
       
   537 	void HandleItemCommandL( TInt aCommand );
       
   538 	
       
   539 	CMPXMedia* SelectedItemMediaL();
       
   540 	
       
   541 private:
       
   542 
       
   543     /**
       
   544      * C++ constructor.
       
   545      */
       
   546     CMPXCollectionViewHgContainer(
       
   547         MEikCommandObserver* aView,
       
   548         MEikListBoxObserver* aObserver,
       
   549         TBool aIsEmbedded);
       
   550 
       
   551     /**
       
   552      * Symbian 2nd phase constructor.
       
   553      */
       
   554     void ConstructL();
       
   555 
       
   556     /**
       
   557      * Creates listbox array
       
   558      */
       
   559     CMPXCommonListBoxArrayBase* CreateListBoxArrayL();
       
   560 
       
   561     /**
       
   562      * From MHgVgMediaWallObserver
       
   563      */
       
   564     void HandleMediaWallEvent(TInt aEvent, CHgVgMediaWall* aSender);
       
   565 
       
   566     /**
       
   567      * Creates icon array, populates iIconArray to be used by listbox
       
   568      */
       
   569     void CreateIconArrayL();
       
   570 
       
   571     /**
       
   572      * Sets default icon for HgList
       
   573      */
       
   574     void SetDefaultIconL();
       
   575 
       
   576     /**
       
   577      * Sets default icon for list item
       
   578      */
       
   579     void SetDefaultIconL(TInt aIndex);
       
   580 
       
   581     /*
       
   582 	 * Adds detail to the list item at the specified index
       
   583      */
       
   584     void AddDetailToDisplayedItemL( CHgItem* aVisualItem, CMPXMedia* aMedia, TInt aIndex);
       
   585     void AddThumbnailToDisplayedItemL( CHgItem* aVisualItem, CMPXMedia* aMedia, TInt aIndex);
       
   586     void SetTitleL( CHgItem* aVisualItem, CMPXMedia* aMedia );
       
   587     void SetSongTitleL( CHgItem* aVisualItem, CMPXMedia* aMedia );
       
   588     void SetDetailCountL( CHgItem* aVisualItem, CMPXMedia* aMedia );
       
   589     void SetDetailArtistL( CHgItem* aVisualItem, CMPXMedia* aMedia );
       
   590     void SetDetailAlbumL( CHgItem* aVisualItem, CMPXMedia* aMedia );
       
   591     void SetDetailDurationL( CHgItem* aVisualItem, CMPXMedia* aMedia );
       
   592     void UpdateTimeIndicatorsL( TDes& aBuf, TInt aDuration );
       
   593     void SetDetailIndicatorL( CHgItem* aVisualItem, TInt aIndex );
       
   594     void SetDetailIconL( CHgItem* aVisualItem, TInt aIndex );
       
   595     void SetDetailThumbnailL( CMPXMedia* aMedia, TInt aIndex = 0 );
       
   596 	CGulIcon* DefaultIconL();
       
   597 	void SetDetailIconShuffleL();
       
   598 	TBool SetShuffleItemTextL(CHgItem* aItem, CMPXMedia* aMedia);
       
   599 	void SetShuffleItemToListL( CHgScroller* aList );
       
   600 
       
   601     /**
       
   602      * Set the collection context
       
   603      */
       
   604     void SetCollectionContextL();
       
   605 
       
   606     void ProvideDataL( TInt aStart, TInt aEnd );
       
   607 
       
   608     void SetScrollbarType();
       
   609 
       
   610     void CancelTNRequest();
       
   611 
       
   612     /**
       
   613       * Save the selected album item
       
   614       *
       
   615       */
       
   616     void SaveSelectedAlbumItemL(TInt aIndex);
       
   617 
       
   618     /**
       
   619      * Write the album name, artist name and album art in media data to file
       
   620      *
       
   621      * @param aMedia         the selected media data in Album view
       
   622      */
       
   623     void WriteToStreamFileL( const CMPXMedia* aMedia );
       
   624 
       
   625     /**
       
   626      * Read the album name, artist name and album art from file
       
   627      *
       
   628      * @param aMedia         the media data will be returned
       
   629      */
       
   630     void ReadFromStreamFileL( CMPXMedia* aMedia );
       
   631 
       
   632 	void RestoreSelectedAlbumItemL(const CMPXMediaArray& aMediaArray);
       
   633 
       
   634     /**
       
   635      * Refresh list as needed
       
   636      */
       
   637     void RefreshL(TInt aIndex);
       
   638 
       
   639     /**
       
   640      * Refresh list as needed
       
   641      */
       
   642     void RefreshNoThumbnailL(TInt aIndex);
       
   643 
       
   644 	/**
       
   645 	* Clean AlbumArt request Queue
       
   646 	*/
       
   647     void CleanAlbumArtReqQueue();
       
   648 
       
   649     /**
       
   650      * Handle requests in visible area
       
   651      * @param aBufferStart  the starting buffer index
       
   652      * @param aBufferEnd  the ending buffer index
       
   653      */
       
   654     void ProvideDataIntersectL(TInt aBufferStart, TInt aBufferEnd);
       
   655 
       
   656     /**
       
   657      * Refresh list as needed
       
   658      * @param aBufferStart  the starting buffer index
       
   659      * @param aBufferEnd  the ending buffer index
       
   660      */
       
   661     void ProvideDataDifferenceL(TInt aBufferStart, TInt aBufferEnd);
       
   662     void ProvideDataWithoutThumbnailsL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
       
   663     void ProvideDataWithoutThumbnailsMwL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
       
   664     void ProvideDataForRangeL( TInt aBufferStart, TInt aBufferEnd );
       
   665 
       
   666 	void PrepareMediaWallL(const CMPXMediaArray& aMediaArray, TInt aCount);
       
   667 	void PrepareMediaWallWithListL(const CMPXMediaArray& aMediaArray, TInt aCount);
       
   668 	void PrepareListL(const CMPXMediaArray& aMediaArray, TInt aCount);
       
   669 	void ResizeListL(const CMPXMediaArray& aMediaArray, TInt aCount);
       
   670 
       
   671 	CHgScroller* CurrentListWidget();
       
   672 	void ResolveCurrentViewType();
       
   673 	void CleanPrevView();
       
   674 
       
   675 	TBool ShufflePlayAllL(TInt aIndex);
       
   676 	void UpdatePathAndOpenL(TInt aIndex, TBool aSelectAll = EFalse);
       
   677 	void UpdatePathAndOpenPlaylistL( const CMPXMedia& aResults );
       
   678 	void FindAlbumSongsL(TInt aIndex);
       
   679 	void FindPlaylistSongsL(TInt aIndex);
       
   680 	void FindGenreSongsL(TInt aIndex);
       
   681 	TBool IsPlayingCurrentIndexL(CMPXCollectionPath* aPath);
       
   682 	void ShowAlbumSongsDialogL( const CMPXMedia& aResults );
       
   683     void ShowAlbumSongsL( const CMPXMedia& aAlbum );
       
   684     void OpenAlbumL(TInt aIndex);
       
   685     void PlayAlbumL(TInt aIndex);
       
   686     void PlayPlaylistL(TInt aIndex);
       
   687     void PlayGenreL(TInt aIndex);
       
   688 
       
   689 private: // data member
       
   690 
       
   691     /**
       
   692      * Context of collection view. It's the exact location within collection navigation
       
   693      * based on category type + category.
       
   694      */
       
   695     enum TContext
       
   696         {
       
   697         EContextUnknown,
       
   698         EContextGroupCollection,
       
   699         EContextGroupArtist,
       
   700         EContextGroupAlbum,
       
   701         EContextGroupPlaylist,
       
   702         EContextGroupSong,
       
   703         EContextGroupPodcast,
       
   704         EContextGroupGenre,
       
   705         EContextGroupComposer,
       
   706         EContextItemArtist,
       
   707         EContextItemAlbum,
       
   708         EContextItemPlaylist,
       
   709         EContextItemSong,
       
   710         EContextItemPodcast,
       
   711         EContextItemGenre,
       
   712         EContextItemComposer
       
   713         };
       
   714 
       
   715     enum TDefaultIcon
       
   716         {
       
   717         EMPXDefaultIconNotSet = -1,
       
   718         EMPXDefaultIconArtist,
       
   719         EMPXDefaultIconAlbum,
       
   720         EMPXDefaultIconPlaylist,
       
   721         EMPXDefaultIconSongs,
       
   722         EMPXDefaultIconPodcasts,
       
   723         EMPXDefaultIconGenre,
       
   724         EMPXDefaultIconComposer,
       
   725         EMPXDefaultTitleIconPodcasts,
       
   726         EMPXDefaultIconEmpty
       
   727         };
       
   728 
       
   729     enum TViewType
       
   730         {
       
   731         EMPXViewUnknown,
       
   732         EMPXViewCoverFlow,
       
   733         EMPXViewList,
       
   734         EMPXViewTBone
       
   735         };
       
   736 
       
   737     enum TFindOp
       
   738         {
       
   739         EMPXNoOp,
       
   740         EMPXOpenAlbum,
       
   741         EMPXPlayAlbum,
       
   742         EMPXPlayPlaylist,
       
   743         EMPXPlayGenre
       
   744         };
       
   745 
       
   746     MEikCommandObserver*            iView; // not owned
       
   747     MEikListBoxObserver*            iListBoxObserver; // not owned
       
   748     CAknContextPane*                iContextPane;    // Not owned
       
   749     CMPXCollectionViewListBoxArray* iListBoxArray; // owned
       
   750     CEikImage*                      iNewIcon;  // New context icon, owned
       
   751     CEikImage*                      iOrigIcon;  // New context icon, not owned
       
   752     TBool                           iReorder;
       
   753     TBool                           iReady;
       
   754     TBool                           iIsEmbedded;
       
   755 
       
   756     THgScrollDirection iDirection;
       
   757     RArray<TBool> iThumbnailReqMap;
       
   758 
       
   759     HBufC* iAlbumTitle;
       
   760     HBufC* iSongTitle;
       
   761 
       
   762     TBool iPodcastContext;
       
   763     TBool iTitleSet;
       
   764     TDefaultIcon iCurrentDefaultIcon;
       
   765 
       
   766     TFileName iSelectedAlbumItemFileName;
       
   767     CMPXMedia* iSelectedMediaInAlbumView;
       
   768 
       
   769 	CMPXCommonUiHelper*         iCommonUiHelper;        // Owned
       
   770     MMPXCollectionUtility* 		iCollectionUtility;		// Owned
       
   771     MMPXPlaybackUtility* 		iPlaybackUtility;       // Owned
       
   772 
       
   773     CHgScroller* 				iMwListWidget;  		// Owned
       
   774     CHgScroller* 				iListWidget;  		    // Owned
       
   775     CHgVgMediaWall* 			iMediaWall;             // Owned
       
   776     CMpxTNLoader*               iThumbnailManager;      // Owned
       
   777 
       
   778     TContext                    iContext;
       
   779     TContext                    iPrevContext;
       
   780     TInt                        iResourceOffset;        // Must be freed
       
   781     TBool                       iIsMarkingEnabled;
       
   782 	TInt						iTopIndex;
       
   783 	TInt						iBottomIndex;
       
   784 	TSize						iImageSize;
       
   785     CAknsBasicBackgroundControlContext* iBgContext; 	// Owned
       
   786 
       
   787     CArrayFixFlat<TInt>*        iListSelections;        // Owned
       
   788     CAknIconArray*              iIconArray;             // Owned
       
   789 
       
   790     MMPXCollectionUiHelper* iCollectionUiHelper;
       
   791     CMPXCollectionPlaylist* iPlaylist;
       
   792     CMPXCollectionViewHgPlaylistHelper* iPlaylistHelper;
       
   793 
       
   794     // List/Media wall management
       
   795     TInt iLastValidMediaItemIndex;
       
   796     TInt iRequestStart;
       
   797     TInt iRequestEnd;
       
   798     TInt iAlbumIndex; // opened album index in mediawall
       
   799     TInt iSelectedAlbumIndex; // selected album index in mediawall
       
   800     TInt iRestoredAlbumIndex; // restored selected album index
       
   801     TBool iDefaultIconSet;
       
   802     MMpxCbaHandler* iCbaHandler;
       
   803     TViewType iCurrentViewType;
       
   804     TViewType iPrevViewType;
       
   805     TFindOp iFindOp;
       
   806 
       
   807     };
       
   808 
       
   809 #endif  // CMPXCOLLECTIONVIEWHGCONTAINER_H
       
   810 
       
   811 // End of File