mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h
branchRCL_3
changeset 14 943ff5625028
parent 4 beaa16f65879
child 17 c8156a91d13c
equal deleted inserted replaced
11:13afc0e517bd 14:943ff5625028
    51 class MMPXCollectionUtility;
    51 class MMPXCollectionUtility;
    52 class MMPXPlaybackUtility;
    52 class MMPXPlaybackUtility;
    53 class MMpxCbaHandler;
    53 class MMpxCbaHandler;
    54 class TAknsItemID;
    54 class TAknsItemID;
    55 class CAsyncOneShot;
    55 class CAsyncOneShot;
       
    56 class MMPXSelectedAlbumHandler;
    56 
    57 
    57 // CLASS DECLARATION
    58 // CLASS DECLARATION
    58 
    59 
    59 /**
    60 /**
    60  *  MPX Collection view container.
    61  *  MPX Collection view container.
    85      * @return Pointer to newly created object.
    86      * @return Pointer to newly created object.
    86      */
    87      */
    87     static CMPXCollectionViewHgContainer* NewL(
    88     static CMPXCollectionViewHgContainer* NewL(
    88         MEikCommandObserver* aView,
    89         MEikCommandObserver* aView,
    89         MEikListBoxObserver* aObserver,
    90         MEikListBoxObserver* aObserver,
       
    91         MMPXSelectedAlbumHandler* aSelectedAlbumHandler,
    90         TBool aIsEmbedded );
    92         TBool aIsEmbedded );
    91 
    93 
    92     /**
    94     /**
    93      * Destructor.
    95      * Destructor.
    94      */
    96      */
   547      * Determines if current view is TBoneview
   549      * Determines if current view is TBoneview
   548      *
   550      *
   549      * @return ETrue if current view is TBoneview, EFalse otherwise
   551      * @return ETrue if current view is TBoneview, EFalse otherwise
   550      */
   552      */
   551 	TBool IsTBoneView();
   553 	TBool IsTBoneView();
   552 	
   554 
       
   555 	TBool OfferCommandL(TInt aCommand);
       
   556 
       
   557 	/**
       
   558 	 * Records begin state for the transition animation.
       
   559 	 *
       
   560 	 * @param aPrevViewWasPlayback ETrue if previous view was playback.
       
   561 	 *     This information used to decide animation direction.
       
   562 	 */
       
   563 	void BeginFullScreenAnimation( TBool aPrevViewWasPlayback = EFalse );
       
   564 
       
   565 	/**
       
   566 	 * Set the previous view Uid
       
   567 	 *
       
   568 	 * @param aViewUid UId of the previous view.
       
   569 	 */
       
   570 	void SetPreviousViewId(TUid aViewUid);
       
   571 
       
   572 
   553 private:
   573 private:
   554 
   574 
   555     /**
   575     /**
   556      * C++ constructor.
   576      * C++ constructor.
   557      */
   577      */
   558     CMPXCollectionViewHgContainer(
   578     CMPXCollectionViewHgContainer(
   559         MEikCommandObserver* aView,
   579         MEikCommandObserver* aView,
   560         MEikListBoxObserver* aObserver,
   580         MEikListBoxObserver* aObserver,
       
   581         MMPXSelectedAlbumHandler* aSelectedAlbumHandler,
   561         TBool aIsEmbedded);
   582         TBool aIsEmbedded);
   562 
   583 
   563     /**
   584     /**
   564      * Symbian 2nd phase constructor.
   585      * Symbian 2nd phase constructor.
   565      */
   586      */
   657 	* Clean AlbumArt request Queue
   678 	* Clean AlbumArt request Queue
   658 	*/
   679 	*/
   659     void CleanAlbumArtReqQueue();
   680     void CleanAlbumArtReqQueue();
   660 
   681 
   661     /**
   682     /**
   662      * Handle requests in visible area
   683      * Handle data providing in requests in visible area
   663      * @param aBufferStart  the starting buffer index
   684      * @param aBufferStart  the starting buffer index
   664      * @param aBufferEnd  the ending buffer index
   685      * @param aBufferEnd  the ending buffer index
   665      */
   686      */
   666     void ProvideDataIntersectL(TInt aBufferStart, TInt aBufferEnd);
   687     void ProvideDataIntersectL(TInt aBufferStart, TInt aBufferEnd);
   667 
   688 
   668     /**
   689     /**
   669      * Refresh list as needed
   690      * Handle data providing in requests in non visible area
   670      * @param aBufferStart  the starting buffer index
   691      * @param aBufferStart  the starting buffer index
   671      * @param aBufferEnd  the ending buffer index
   692      * @param aBufferEnd  the ending buffer index
   672      */
   693      */
   673     void ProvideDataDifferenceL(TInt aBufferStart, TInt aBufferEnd);
   694     void ProvideDataDifferenceL(TInt aBufferStart, TInt aBufferEnd);
       
   695 
       
   696     /**
       
   697      * Provide data without providing thumbnails to list
       
   698      * @param aMediaArray  the media array to pull data from
       
   699      * @param aStartIndex  the starting index index
       
   700      */
   674     void ProvideDataWithoutThumbnailsL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
   701     void ProvideDataWithoutThumbnailsL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
       
   702 
       
   703     /**
       
   704      * Provide data without providing thumbnails to media wall
       
   705      * @param aMediaArray  the media array to pull data from
       
   706      * @param aStartIndex  the starting index index
       
   707      */
   675     void ProvideDataWithoutThumbnailsMwL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
   708     void ProvideDataWithoutThumbnailsMwL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
       
   709 
       
   710     /**
       
   711      * Handle data providing in specified range.
       
   712      * @param aBufferStart  the starting buffer index
       
   713      * @param aBufferEnd  the ending buffer index
       
   714      */
   676     void ProvideDataForRangeL( TInt aBufferStart, TInt aBufferEnd );
   715     void ProvideDataForRangeL( TInt aBufferStart, TInt aBufferEnd );
   677 
   716 
       
   717     /**
       
   718      * Prepare media wall to be shown
       
   719      * @param aMediaArray  the media array to pull data from
       
   720      * @param aCount  Number of items in media wall
       
   721      */
   678 	void PrepareMediaWallL(const CMPXMediaArray& aMediaArray, TInt aCount);
   722 	void PrepareMediaWallL(const CMPXMediaArray& aMediaArray, TInt aCount);
       
   723 
       
   724     /**
       
   725      * Prepare TBone view to be shown
       
   726      * @param aMediaArray  the media array to pull data from
       
   727      * @param aCount  Number of items in media wall portion of tbone.
       
   728      */
   679 	void PrepareMediaWallWithListL(const CMPXMediaArray& aMediaArray, TInt aCount);
   729 	void PrepareMediaWallWithListL(const CMPXMediaArray& aMediaArray, TInt aCount);
       
   730 
       
   731     /**
       
   732      * Prepare list to be shown
       
   733      * @param aMediaArray  the media array to pull data from
       
   734      * @param aCount  Number of items in list
       
   735      */
   680 	void PrepareListL(const CMPXMediaArray& aMediaArray, TInt aCount);
   736 	void PrepareListL(const CMPXMediaArray& aMediaArray, TInt aCount);
       
   737 
       
   738     /**
       
   739      * Handle list resizing
       
   740      * @param aMediaArray  the media array to pull data from
       
   741      * @param aCount  Number of items in list
       
   742      */
   681 	void ResizeListL(const CMPXMediaArray& aMediaArray, TInt aCount);
   743 	void ResizeListL(const CMPXMediaArray& aMediaArray, TInt aCount);
   682 
   744 
       
   745     /**
       
   746      * Get the current list instance
       
   747      * @param aIndex Index from list control
       
   748      * @return Instance of scroller object
       
   749      */
   683 	CHgScroller* CurrentListWidget();
   750 	CHgScroller* CurrentListWidget();
       
   751 
       
   752     /**
       
   753      * Resolve the type of view based on current browsing context
       
   754      */
   684 	void ResolveCurrentViewType();
   755 	void ResolveCurrentViewType();
       
   756 
       
   757     /**
       
   758      * Clean up the previous view's resources.
       
   759      */
   685 	void CleanPrevView();
   760 	void CleanPrevView();
   686 
   761 
       
   762     /**
       
   763      * Initiate shuffle play all operation
       
   764      * @return ETrue if shuffle operation is started.
       
   765      */
   687 	TBool ShufflePlayAllL(TInt aIndex);
   766 	TBool ShufflePlayAllL(TInt aIndex);
       
   767 
       
   768     /**
       
   769      * Update the collection path and open it to start playback.
       
   770      * @param aIndex The selected media array index to start playing.
       
   771      * @param aSelectAll Indicate if all items should be selected.
       
   772      */
   688 	void UpdatePathAndOpenL(TInt aIndex, TBool aSelectAll = EFalse);
   773 	void UpdatePathAndOpenL(TInt aIndex, TBool aSelectAll = EFalse);
       
   774 
       
   775     /**
       
   776      * Construct a collection path with the current selection and
       
   777      * construct a playlist from path to start playback.
       
   778      * @param aResults The media results from find operation.
       
   779      */
   689 	void UpdatePathAndOpenPlaylistL( const CMPXMedia& aResults );
   780 	void UpdatePathAndOpenPlaylistL( const CMPXMedia& aResults );
       
   781 
       
   782     /**
       
   783      * Find songs belonging to album.
       
   784      * @param aIndex Index in media array of albums
       
   785      */
   690 	void FindAlbumSongsL(TInt aIndex);
   786 	void FindAlbumSongsL(TInt aIndex);
       
   787 
       
   788     /**
       
   789      * Find songs belonging to playlist.
       
   790      * @param aIndex Index in media array of playlists
       
   791      */
   691 	void FindPlaylistSongsL(TInt aIndex);
   792 	void FindPlaylistSongsL(TInt aIndex);
       
   793 
       
   794     /**
       
   795      * Find songs belonging to genre.
       
   796      * @param aIndex Index in media array of genres
       
   797      */
   692 	void FindGenreSongsL(TInt aIndex);
   798 	void FindGenreSongsL(TInt aIndex);
       
   799 
       
   800     /**
       
   801      * Check if the currently playing track is in path
       
   802      * @param aPath Collection path of playlist
       
   803      * @return ETrue if current track is playing
       
   804      */
   693 	TBool IsPlayingCurrentIndexL(CMPXCollectionPath* aPath);
   805 	TBool IsPlayingCurrentIndexL(CMPXCollectionPath* aPath);
   694 	void ShowAlbumSongsDialogL( const CMPXMedia& aResults );
   806 
       
   807     /**
       
   808      * Show list of songs in an album in a dialog popup.
       
   809      * @param aAlbum Album container with list of songs
       
   810      */
       
   811 	void ShowAlbumSongsDialogL( const CMPXMedia& aAlbum );
       
   812 
       
   813     /**
       
   814      * Show list of songs in an album
       
   815      * @param aAlbum Album container with list of songs
       
   816      */
   695     void ShowAlbumSongsL( const CMPXMedia& aAlbum );
   817     void ShowAlbumSongsL( const CMPXMedia& aAlbum );
       
   818 
       
   819     /**
       
   820      * Open the album to show its contents
       
   821      * @param aIndex Index of the album in media array
       
   822      */
   696     void OpenAlbumL(TInt aIndex);
   823     void OpenAlbumL(TInt aIndex);
       
   824 
       
   825     /**
       
   826      * Play the album
       
   827      * @param aIndex Index of the album in media array
       
   828      */
   697     void PlayAlbumL(TInt aIndex);
   829     void PlayAlbumL(TInt aIndex);
       
   830 
       
   831     /**
       
   832      * Play the playlist
       
   833      * @param aIndex Index of the album in media array
       
   834      */
   698     void PlayPlaylistL(TInt aIndex);
   835     void PlayPlaylistL(TInt aIndex);
       
   836 
       
   837     /**
       
   838      * Play the genre
       
   839      * @param aIndex Index of the album in media array
       
   840      */
   699     void PlayGenreL(TInt aIndex);
   841     void PlayGenreL(TInt aIndex);
   700 
   842 
   701     static TInt AsyncCallback( TAny* aPtr );
   843     static TInt AsyncCallback( TAny* aPtr );
   702     
   844 
       
   845     /**
       
   846      * Prepare to show the TBone view.
       
   847      */
       
   848 	void PrepareTboneViewL();
       
   849 
       
   850     /**
       
   851      * Check if shuffle item is present in the view.
       
   852      * @return ETrue if shuffle item is present.
       
   853      */
       
   854 	TBool ShuffleItemPresent();
       
   855 
       
   856     /**
       
   857      * Mapping function to convert from list index to media index.
       
   858      * @param aIndex Index from list control
       
   859      * @return media array index
       
   860      */
       
   861 	TInt MediaIndex(TInt aIndex) const;
       
   862 
       
   863 	/**
       
   864      * Load and set empty text.
       
   865      */
       
   866 	void LoadAndSetEmptyTextL();
       
   867 
       
   868     /**
       
   869      * End fullscreen animation effects.
       
   870      */
       
   871     void EndFullScreenAnimation();
       
   872 
       
   873     /**
       
   874      * Resolve popup list rectangle size.
       
   875      */
       
   876     void ResolvePopupListSizeL();
       
   877 
   703 private: // data member
   878 private: // data member
   704 
   879 
   705     /**
   880     /**
   706      * Context of collection view. It's the exact location within collection navigation
   881      * Context of collection view. It's the exact location within collection navigation
   707      * based on category type + category.
   882      * based on category type + category.
   741         };
   916         };
   742 
   917 
   743     enum TViewType
   918     enum TViewType
   744         {
   919         {
   745         EMPXViewUnknown,
   920         EMPXViewUnknown,
   746         EMPXViewCoverFlow,
   921         EMPXViewMediawall,
   747         EMPXViewList,
   922         EMPXViewList,
   748         EMPXViewTBone
   923         EMPXViewTBone
   749         };
   924         };
   750 
   925 
   751     enum TFindOp
   926     enum TFindOp
   812     TInt iRequestStart;
   987     TInt iRequestStart;
   813     TInt iRequestEnd;
   988     TInt iRequestEnd;
   814     TInt iAlbumIndex; // opened album index in mediawall
   989     TInt iAlbumIndex; // opened album index in mediawall
   815     TInt iSelectedAlbumIndex; // selected album index in mediawall
   990     TInt iSelectedAlbumIndex; // selected album index in mediawall
   816     TInt iRestoredAlbumIndex; // restored selected album index
   991     TInt iRestoredAlbumIndex; // restored selected album index
       
   992     MMPXSelectedAlbumHandler* iSelectedAlbumHandler;
   817     TBool iDefaultIconSet;
   993     TBool iDefaultIconSet;
   818     MMpxCbaHandler* iCbaHandler;
   994     MMpxCbaHandler* iCbaHandler;
   819     TViewType iCurrentViewType;
   995     TViewType iCurrentViewType;
   820     TViewType iPrevViewType;
   996     TViewType iPrevViewType;
   821     TFindOp iFindOp;
   997     TFindOp iFindOp;
   822     TBool iIsForeground;
   998     TBool iIsForeground;
   823     TBool iDelayedControlCreation;
   999     TBool iDelayedControlCreation;
   824     CAsyncCallBack* iAsyncCallBack;
  1000     CAsyncCallBack* iAsyncCallBack;
       
  1001     TBool iOpenAlbumTracks;
       
  1002     TInt iShuffleItem;
       
  1003     TBool iSetEmptyTextNeeded;
       
  1004     TTransitionType iTranstionType;
       
  1005     TBool iLayoutSwitch;
       
  1006     TRect iPopupListRect;
       
  1007     TUid iPreviousViewId;
   825     };
  1008     };
   826 
  1009 
   827 #endif  // CMPXCOLLECTIONVIEWHGCONTAINER_H
  1010 #endif  // CMPXCOLLECTIONVIEWHGCONTAINER_H
   828 
  1011 
   829 // End of File
  1012 // End of File