mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgimp.h
branchRCL_3
changeset 53 3de6c4cf6b67
child 66 1f1dad4af8f8
equal deleted inserted replaced
52:14979e23cb5e 53:3de6c4cf6b67
       
     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 implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CMPXCOLLECTIONVIEWHGIMP_H
       
    20 #define C_CMPXCOLLECTIONVIEWHGIMP_H
       
    21 
       
    22 //Version Information
       
    23 #define MUSIC_PLAYER_VERSION_MAJOR 16 //Road Runner Music Player
       
    24 #define MUSIC_PLAYER_VERSION_MINOR 10 //year 2010
       
    25 #define MUSIC_PLAYER_VERSION_WEEK 11  //Week Number 
       
    26 
       
    27 // INCLUDES
       
    28 #include <eikclb.h>
       
    29 #include <AknWaitDialog.h>
       
    30 #include <eikprogi.h>
       
    31 #include <mpxmediageneraldefs.h>
       
    32 #include <mpxcollectionobserver.h>
       
    33 #include <mpxplaybackobserver.h>
       
    34 #include <mpxcollectionuihelper.h>
       
    35 #include <mpxcollectionuihelperobserver.h>
       
    36 #include <mpxcollectionhelper.h>
       
    37 #include <mpxcollectionpath.h>  // TMPXItemId
       
    38 #include <mpxviewactivationobserver.h>
       
    39 #include "mpxcbahandler.h"
       
    40 
       
    41 #include "mpxcollectionviewhg.h"
       
    42 #include "mpxplaybackframeworkdefs.h" // TMPXPlaybackPlayerType
       
    43 #include "mpxwaitnotedefs.h"
       
    44 #include "mpxselectedalbumhandler.h"
       
    45 
       
    46 // FORWARD DECLARATIONS
       
    47 class CAiwGenericParamList;
       
    48 class CAiwServiceHandler;
       
    49 class CAknNaviLabel;
       
    50 class CAknNavigationControlContainer;
       
    51 class CAknNavigationDecorator;
       
    52 class CAknQueryDialog;
       
    53 class CEikButtonGroupContainer;
       
    54 class CMPXCollectionOpenUtility;
       
    55 class CMPXCollectionPlaylist;
       
    56 class CMPXCollectionViewHgContainer;
       
    57 class CMPXCommonUiHelper;
       
    58 class CMediaRecognizer;
       
    59 class CMediatorCommandInitiator;
       
    60 class CSendUi;
       
    61 class CUpnpCopyCommand;
       
    62 
       
    63 #ifdef BACKSTEPPING_INCLUDED
       
    64 class MMPXBackSteppingUtility;
       
    65 #endif // BACKSTEPPING_INCLUDED
       
    66 
       
    67 class MMPXCollectionUtility;
       
    68 class MMPXPlaybackUtility;
       
    69 class MMPXPlayerManager;
       
    70 class MMPXViewUtility;
       
    71 class MProfileEngine;
       
    72 class CRepository;
       
    73 // CLASS DECLARATION
       
    74 
       
    75 /**
       
    76  *  MPX collection view.
       
    77  *
       
    78  *  @lib mpxcollectionview.lib
       
    79  *  @since S60 v3.1
       
    80  */
       
    81 NONSHARABLE_CLASS( CMPXCollectionViewHgImp ) : public CMPXCollectionViewHg,
       
    82                                              public MMPXCollectionObserver,
       
    83                                              public MMPXPlaybackObserver,
       
    84                                              public MMPXPlaybackCallback,
       
    85                                              public MEikListBoxObserver,
       
    86                                              public MProgressDialogCallback,
       
    87                                              public MMPXCollectionFindObserver,
       
    88                                              public MMPXCollectionHelperObserver,
       
    89                                              public MMPXCHelperObserver,
       
    90                                              public MMPXViewActivationObserver,
       
    91                                              public MCoeViewDeactivationObserver,
       
    92                                              public MCoeViewActivationObserver,
       
    93                                              public MMpxCbaHandler,
       
    94                                              public MMPXSelectedAlbumHandler
       
    95     {
       
    96 public:
       
    97 
       
    98     /**
       
    99      * Two-phased constructor.
       
   100      *
       
   101      * @since 3.0
       
   102      * @return Pointer to newly created object.
       
   103      */
       
   104     static CMPXCollectionViewHgImp* NewL();
       
   105 
       
   106     /**
       
   107      * Two-phased constructor.
       
   108      *
       
   109      * @since 3.0
       
   110      * @return Pointer to newly created object.
       
   111      */
       
   112     static CMPXCollectionViewHgImp* NewLC();
       
   113 
       
   114     /**
       
   115      * Destructor.
       
   116      */
       
   117     virtual ~CMPXCollectionViewHgImp();
       
   118 
       
   119     /**
       
   120      * Launch music shop application.
       
   121      *
       
   122      * @ since 3.1
       
   123      */
       
   124     void LaunchMusicShopL();
       
   125 
       
   126     /**
       
   127      *  Saves selected album.
       
   128      *
       
   129      *  @param aMedia Album to be stored
       
   130      */
       
   131      void SaveSelectedAlbumL (CMPXMedia &aMedia);
       
   132 
       
   133      /**
       
   134      *  Restores selected album.
       
   135      *
       
   136      *  @return media of restored album
       
   137      */
       
   138      const CMPXMedia* RestoreSelectedAlbum ();
       
   139 
       
   140 
       
   141 private:
       
   142 
       
   143     /**
       
   144      * C++ constructor.
       
   145      */
       
   146     CMPXCollectionViewHgImp();
       
   147 
       
   148     /**
       
   149      * By default Symbian 2nd phase constructor is private.
       
   150      */
       
   151     void ConstructL();
       
   152 
       
   153     /**
       
   154      * Delete the selected items
       
   155      * @param aCommand the command that triggered the deletion
       
   156      *
       
   157      */
       
   158     void DeleteSelectedItemsL(TInt aCommand);
       
   159     
       
   160 	/**
       
   161      * Delete the selected items in TBone view
       
   162      * @param aCommand the command that triggered the deletion
       
   163      *
       
   164      */
       
   165     void DeleteSelectedTBoneItemsL( TInt aCommand );
       
   166 
       
   167     /**
       
   168      * Updates list box
       
   169      *
       
   170      * @param aEntries collection entries opened
       
   171      * @param aIndex focused entry
       
   172      * @param aComplete ETrue no more entries. EFalse more entries
       
   173      *                   expected
       
   174      */
       
   175     void UpdateListBoxL(
       
   176         const CMPXMedia& aEntries,
       
   177         TInt aIndex,
       
   178         TBool aComplete);
       
   179 
       
   180     /**
       
   181      * Displays error notes.
       
   182      *
       
   183      * @param aError Error code to be handled.
       
   184      */
       
   185     void HandleError( TInt aError );
       
   186 
       
   187     /**
       
   188      * Updates the title pane
       
   189      */
       
   190     void UpdateTitlePaneL();
       
   191 
       
   192     /**
       
   193      * Update navi pane in reorder mode
       
   194      */
       
   195     void UpdateReorderNaviPaneL();
       
   196 
       
   197     /**
       
   198      * Updates playback status/indicator
       
   199      * Returns the current selection index of now playing song
       
   200      * if a match is found in current context
       
   201      *
       
   202      * @return Index of the song that is currently playing
       
   203      */
       
   204     TInt UpdatePlaybackStatusL();
       
   205 
       
   206     /**
       
   207      * Start either the refresh or scanning note
       
   208      */
       
   209     void StartWaitNoteL( TWaitNoteType aNoteType );
       
   210 
       
   211     /**
       
   212      * Start either the delete wait note
       
   213      *
       
   214      */
       
   215     void StartDeleteWaitNoteL();
       
   216 
       
   217     /**
       
   218      * Updates the progress note text and progress bar
       
   219      *
       
   220      * @param aProgressText Text to be displayed on the progress note
       
   221      */
       
   222     void UpdateProcessL( const TDesC& aProgressText );
       
   223 
       
   224     /**
       
   225     * Close a wait note
       
   226     */
       
   227     void CloseWaitNoteL();
       
   228 
       
   229     /**
       
   230      * Activates reorder mode
       
   231      */
       
   232     void ActivateReorderGrabbedModeL();
       
   233 
       
   234     /**
       
   235      * Deactivates reorder mode
       
   236      *
       
   237      * @param aExit ETrue to exit reorder mode, EFalse otherwise
       
   238      */
       
   239     void DeactivateReorderGrabbedModeL( TBool aExit );
       
   240 
       
   241     /**
       
   242      * Change the button group
       
   243      *
       
   244      * @param aResId resource ID
       
   245      */
       
   246     void SetNewCbaL( TInt aResId );
       
   247 
       
   248     /**
       
   249      * Display the details dialog
       
   250      *
       
   251      * @param aDataArray Array containing the data to display
       
   252      * @param aDialogResourceId Resource defination for the dialog
       
   253      * @param aTitleResourceId Resource defination for the title of the dialog
       
   254      */
       
   255     void DisplayDetailsDialogL( MDesC16Array& aDataArray,
       
   256         TInt aDialogResourceId, TInt aTitleResourceId );
       
   257 
       
   258     /**
       
   259      * Display collection details
       
   260      *
       
   261      * @param aMedia media object containing the library details
       
   262      */
       
   263     void DoShowCollectionDetailsL( const CMPXMedia& aMedia );
       
   264 
       
   265     /**
       
   266      * Display playlist details
       
   267      *
       
   268      * @param aMedia media object containing the playlist details
       
   269      */
       
   270     void DoShowPlaylistDetailsL( const CMPXMedia& aMedia );
       
   271 
       
   272     /**
       
   273      * Handles Upnp menus from DynInitMenuPaneL()
       
   274      *
       
   275      * @param aResourceId Resource id of the option menu
       
   276      * @param aMenuPane Reference to the menu pane
       
   277      */
       
   278     void HandleDynInitUpnpL( TInt aResourceId, CEikMenuPane& aMenuPane );
       
   279 
       
   280     /**
       
   281      * Checks if UPnP AP is defined
       
   282      *
       
   283      * @return ETrue if visible, EFalse otherwise
       
   284      */
       
   285     TBool IsUpnpVisibleL();
       
   286 
       
   287     /**
       
   288      * Displays the available players in the Play via submenu
       
   289      *
       
   290      * @param aMenuPane Menu pane to put the sub menu items
       
   291      */
       
   292     void AddPlayersNamesToMenuL( CEikMenuPane& aMenuPane );
       
   293 
       
   294     /**
       
   295      * Adds one player type to the Play via submenu
       
   296      *
       
   297      * @param aMenuPane menu pane to add player name to
       
   298      * @param aCommandId ID of the command
       
   299      * @param aPlayerManager player manager
       
   300      * @param aPlayerType type of the player
       
   301      * @param aMenuText optional menu text
       
   302      */
       
   303      void AddPlayerNameToMenuL( CEikMenuPane& aMenuPane,
       
   304                                 TInt aCommandId,
       
   305                                 MMPXPlayerManager& aPlayerManager,
       
   306                                 TMPXPlaybackPlayerType& aPlayerType,
       
   307                                 const TDesC& aMenuText = KNullDesC );
       
   308 
       
   309     /**
       
   310      * Retrieves the current player name and type
       
   311      */
       
   312     void GetCurrentPlayerDetails();
       
   313 
       
   314     /**
       
   315      * Selects a new player for audio playback
       
   316      *
       
   317      * @param aCommand Command Id to identify which player to use
       
   318      */
       
   319     void SelectNewPlayerL( TInt aCommand );
       
   320 
       
   321     /**
       
   322      * Copies selected file(s) to remote player
       
   323      */
       
   324     void CopySelectedItemsToRemoteL();
       
   325 
       
   326     /**
       
   327      * Handle call back from collectionframework for Copy to Remote command
       
   328      *
       
   329      * @param aMedia media
       
   330      * @param aComplete all selected medias have been found
       
   331      */
       
   332     void DoHandleCopyToRemoteL(
       
   333         const CMPXMedia& aMedia, TBool aComplete = ETrue );
       
   334 
       
   335 
       
   336     /**
       
   337      * Create and launch the search URL page to the Service
       
   338      * @param song name, artistname, album name
       
   339      */
       
   340     void DoFindInMusicShopL(const TDesC& aSongName,
       
   341                             const TDesC& aArtistName,
       
   342                             const TDesC& aAlbumName );
       
   343 
       
   344     /**
       
   345      * Parameter passed in from viewframework
       
   346      *
       
   347      * @param aParam Parameter pass in from viewframework.
       
   348      */
       
   349     void SetParamL( const TDesC* aParam );
       
   350 
       
   351     /**
       
   352      * Get media property for the current song
       
   353      */
       
   354     void DoGetSongMediaPropertyL();
       
   355 
       
   356     /**
       
   357      * Find playlists
       
   358      *
       
   359      * @return the number of playlist in the system
       
   360      */
       
   361     TInt FindPlaylistsL();
       
   362 
       
   363     /**
       
   364      * Save the changes to the playlist that is currently displaying
       
   365      */
       
   366     void SaveCurrentPlaylistL();
       
   367 
       
   368     /**
       
   369      * Handles rename operation complete
       
   370      */
       
   371     void HandleRenameOpCompleteL();
       
   372 
       
   373     /**
       
   374      * Checks if send option should be shown
       
   375      *
       
   376      * @return ETrue if send command should be hiden, EFalse if it should be shown
       
   377      */
       
   378     TBool SendOptionVisibilityL();
       
   379 
       
   380     /**
       
   381      * Checks if Set as ringtone option should be shown
       
   382      *
       
   383      * @return ETrue if the command should be hiden, EFalse if it should be shown
       
   384      */
       
   385     TBool SetAsRingToneOptionVisibilityL();
       
   386 
       
   387     /**
       
   388      * Checks if file details option should be shown
       
   389      *
       
   390      * @return ETrue if the command should be hiden, EFalse if it should be shown
       
   391      */
       
   392     TBool FileDetailsOptionVisibilityL();
       
   393 
       
   394     /**
       
   395      * Handle send command
       
   396      */
       
   397     void DoSendL();
       
   398    
       
   399    /**
       
   400      * Handle send command in TBone view
       
   401      */
       
   402     void DoSendTBoneListItemL( TMPXItemId aContainerId );
       
   403 
       
   404     /**
       
   405      * Handle send playlist command
       
   406      *
       
   407      * @param aItemId playlist id
       
   408      */
       
   409     void DoSendPlaylistL( TMPXItemId aItemId );
       
   410 
       
   411     /**
       
   412      * Handle call back from collectionframework for send command
       
   413      *
       
   414      * @param aMedia media
       
   415      */
       
   416     void DoHandleSendL( const CMPXMedia& aMedia );
       
   417 
       
   418     /**
       
   419      * Handle rename command
       
   420      */
       
   421     void DoHandleRenameL();
       
   422 
       
   423     /**
       
   424      * Prepares media object for selected items
       
   425      *
       
   426      * @param aMedia on return, populates the media object with a media array
       
   427      *        containing info for currently selected items used by playlist
       
   428      *        does not own this object
       
   429      */
       
   430     void PrepareMediaForSelectedItemsL( CMPXMedia& aMedia, TMPXGeneralCategory aContainerCategory, TMPXGeneralType aContainerType );
       
   431 
       
   432     /**
       
   433      * Populates media object with information needed for save to
       
   434      * existing playlist
       
   435      *
       
   436      * @param aMedia media object containing the entry
       
   437      * @param aCollectionId Id for collection containing the object
       
   438      * @return Media object needed for save to playlist operation
       
   439      */
       
   440     CMPXMedia* PopulateMediaLC( const CMPXMedia& aMedia, TMPXItemId aCollectionId );
       
   441 
       
   442     /**
       
   443      * Handle rename playlist command
       
   444      * @param aMedia media
       
   445      */
       
   446     void DoHandleRenamePlaylistL( const CMPXMedia& aMedia );
       
   447 
       
   448     /**
       
   449      * Set/clears the flags for item in database
       
   450      * @param aIndex index of the item in the list box
       
   451      * @param aMedia media object containing at least the following attribute:
       
   452      *        TMPXAttribute( KMPXMediaIdGeneral,EMPXMediaGeneralCollectionId )
       
   453      * @param aFlag flag to set/clear
       
   454      * @param aSet ETrue to set the flag, EFalse to clear the flag
       
   455      * @param aEnableInfoDialog ETrue to enable info dialog display, EFalse to disable
       
   456      */
       
   457     void UpdateDatabaseFlagL( TInt aIndex, const CMPXMedia& aMedia,
       
   458         TUint aFlag, TBool aSet, TBool aEnableInfoDialog = ETrue );
       
   459 
       
   460     /**
       
   461      * Get duration of current view
       
   462      */
       
   463     void GetDurationL();
       
   464 
       
   465     /**
       
   466      * Handles file check result
       
   467      *
       
   468      * @param aViewToActivate View to activate if the result is ok
       
   469      * @param aMedia Media object containing the information
       
   470      */
       
   471     void DoHandleFileCheckResultL( TUid aViewToActivate, const CMPXMedia& aMedia );
       
   472 
       
   473 #ifdef __ENABLE_MSK
       
   474     /**
       
   475      * Updates the middle softkey display to a label or icon depending on
       
   476      *  whether there are marked indices
       
   477      * @param aMskId middle softkey command id
       
   478      */
       
   479     void UpdateMiddleSoftKeyDisplayL( TInt aMskId );
       
   480 #endif // __ENABLE_MSK
       
   481 
       
   482     /**
       
   483      * Handles the completion of adding a playlist event.
       
   484      * @param aPlaylist, a media object representing the exported
       
   485      *        playlist. The content of this object is the same
       
   486      *        as what's supplied in AddPlaylistL, except that
       
   487      *        URI for the playlist file is added to the object
       
   488      *        upon successful processing of AddPlaylistL. Client
       
   489      *        should take over the ownership of this object. NULL
       
   490      *        if an error has occured while processing AddPlaylistL.
       
   491      * @param aError. the error code for AddPlaylistL processing
       
   492      *        error.
       
   493      */
       
   494     void HandleAddCompletedL( CMPXMedia* aPlaylist, TInt aError );
       
   495 
       
   496     /**
       
   497     * Handles the completion of setting a media event.
       
   498     * @param aMedia, a media object representing the updated media.
       
   499     * @param aError. the error code for SetL processing error.
       
   500     */
       
   501     void HandleSetCompletedL( CMPXMedia* aMedia, TInt aError );
       
   502 
       
   503     /**
       
   504      * Handle playback message
       
   505      *
       
   506      * @param aMessage playback message
       
   507      */
       
   508     void DoHandlePlaybackMessageL( const CMPXMessage& aMessage );
       
   509 
       
   510     /**
       
   511      * Handle collection message
       
   512      *
       
   513      * @param aMessage collection message
       
   514      */
       
   515     void DoHandleCollectionMessageL( const CMPXMessage& aMessage );
       
   516 
       
   517     /**
       
   518     * Calls to Re-open the collection view
       
   519     * @param aShowWaitDlg show the "opening" dialog or not
       
   520     */
       
   521     void DoIncrementalOpenL( TBool aShowWaitDlg = ETrue );
       
   522 
       
   523     /**
       
   524      * Start wait note for delayed action due to the items not ready
       
   525      * (incremental openL change)
       
   526      *
       
   527      * @param aCommand the action to be executed when the items become ready
       
   528      * @param aNote text for wait note
       
   529      * @param aSkipDisplay flag use to determine if waitnote should be displayed or not
       
   530      */
       
   531     void StartDelayedActionL( TInt aCommand, TDesC& aNote, TBool aSkipDisplay = EFalse );
       
   532 
       
   533 // from base class MProgressDialogCallback
       
   534 
       
   535     /**
       
   536      * From MProgressDialogCallback
       
   537      * Callback method
       
   538      * Get's called when a dialog is dismissed.
       
   539      *
       
   540      * @param aButtonId Button pressed when the dialog is dismissed
       
   541      */
       
   542     void DialogDismissedL( TInt aButtonId );
       
   543 
       
   544 // from base class MMPXCollectionObserver
       
   545 
       
   546     /**
       
   547      * From MMPXCollectionObserver
       
   548      * Handle collection message.
       
   549      *
       
   550      * @param aMessage Collection message
       
   551      * @param aErr system error code.
       
   552      */
       
   553     void HandleCollectionMessage(
       
   554         CMPXMessage* aMessage, TInt aError );
       
   555 
       
   556     /**
       
   557      *  From MMPXCollectionObserver
       
   558      *  Handles the collection entries being opened. Typically called
       
   559      *  when client has Open()'d a folder
       
   560      *
       
   561      *  @param aEntries collection entries opened
       
   562      *  @param aIndex focused entry
       
   563      *  @param aComplete ETrue no more entries. EFalse more entries
       
   564      *                   expected
       
   565      *  @param aError error code
       
   566      */
       
   567     void HandleOpenL(
       
   568         const CMPXMedia& aEntries,
       
   569         TInt aIndex,
       
   570         TBool aComplete,
       
   571         TInt aError );
       
   572 
       
   573     /**
       
   574      *  From MMPXCollectionObserver
       
   575      *  Handles the collection entries being opened. Typically called
       
   576      *  when client has Open()'d an item. Client typically responds by
       
   577      *  'playing' the item
       
   578      *
       
   579      *  @param aPlaylist collection path to item
       
   580      *  @param aError error code
       
   581      */
       
   582     void HandleOpenL(
       
   583         const CMPXCollectionPlaylist& aPlaylist,
       
   584         TInt aError );
       
   585 
       
   586     /**
       
   587      *  From MMPXCollectionObserver
       
   588      *  Handle media properties
       
   589      *
       
   590      *  @param aMedia media
       
   591      *  @param aError error code
       
   592      */
       
   593     void HandleCollectionMediaL(
       
   594         const CMPXMedia& aMedia,
       
   595         TInt aError );
       
   596 
       
   597     /**
       
   598      * From MMPXCollectionObserver
       
   599      */
       
   600     void HandleCommandComplete(CMPXCommand* aCommandResult,
       
   601                                TInt aError);
       
   602 
       
   603 // from base class MMPXCollectionHelperObserver
       
   604 
       
   605     /**
       
   606      * From MMPXCollectionHelperObserver
       
   607      * Callback function to signal that adding a file is complete
       
   608      *
       
   609      * @param aError, error of the operation
       
   610      */
       
   611     void HandleAddFileCompleteL( TInt aErr );
       
   612 
       
   613 // from base class MMPXCHelperObserver
       
   614 
       
   615     /**
       
   616      * From MMPXCHelperObserver
       
   617      * Handles the completion of any collection helper event.
       
   618      *
       
   619      * @param aOperation, operation completed
       
   620      * @param aErr. the error code
       
   621      * @param aArgument Argument returned from the operation
       
   622      */
       
   623     void HandleOperationCompleteL( TCHelperOperation aOperation,
       
   624                                    TInt aErr,
       
   625                                    void* aArgument );
       
   626 
       
   627 // from base class MMPXPlaybackObserver
       
   628 
       
   629     /**
       
   630      * From MMPXPlaybackObserver
       
   631      * Handle playback message
       
   632      *
       
   633      * @param aMessage playback message
       
   634      * @param aErr system error code.
       
   635      */
       
   636     void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
       
   637 
       
   638 // from base class MMPXPlaybackCallback
       
   639 
       
   640     /**
       
   641      * From MMPXPlaybackCallback
       
   642      * Handle playback property
       
   643      *
       
   644      * @param aProperty the property
       
   645      * @param aValue the value of the property
       
   646      * @param aError error code
       
   647      */
       
   648     void HandlePropertyL(
       
   649         TMPXPlaybackProperty aProperty,
       
   650         TInt aValue,
       
   651         TInt aError );
       
   652 
       
   653     /**
       
   654      * From MMPXPlaybackCallback
       
   655      * Method is called continously until aComplete=ETrue, signifying that
       
   656      * it is done and there will be no more callbacks
       
   657      * Only new items are passed each time
       
   658      *
       
   659      * @param aPlayer UID of the player
       
   660      * @param aSubPlayers a list of sub players
       
   661      * @param aComplete ETrue no more sub players. EFalse more subplayer
       
   662      *                  expected
       
   663      * @param aError error code
       
   664      */
       
   665     void HandleSubPlayerNamesL(
       
   666         TUid aPlayer,
       
   667         const MDesCArray* aSubPlayers,
       
   668         TBool aComplete,
       
   669         TInt aError );
       
   670 
       
   671     /**
       
   672      * From MMPXPlaybackCallback
       
   673      * Handle media properties
       
   674      *
       
   675      * @param aMedia media
       
   676      * @param aError error code
       
   677      */
       
   678     void HandleMediaL(
       
   679         const CMPXMedia& aMedia,
       
   680         TInt aError );
       
   681 
       
   682 // from base class CAknView
       
   683 
       
   684     /**
       
   685      * From CAknView
       
   686      * Returns views id.
       
   687      *
       
   688      * @return Views Uid
       
   689      */
       
   690     TUid Id() const;
       
   691 
       
   692     /**
       
   693      * From CAknView
       
   694      * Command handling function.
       
   695      *
       
   696      * @param aCommand Command which is handled
       
   697      */
       
   698     void HandleCommandL( TInt aCommand );
       
   699 
       
   700 	/**
       
   701 	 * From CAknView
       
   702 	 * Called when status pane layout has changed
       
   703 	 */
       
   704 	void HandleStatusPaneSizeChange();
       
   705 
       
   706     /**
       
   707      * From CAknView
       
   708      * Handles a view activation.
       
   709      *
       
   710      * @param aPrevViewId Specifies the view previously active.
       
   711      * @param aCustomMessageId Specifies the message type.
       
   712      * @param aCustomMessage The activation message.
       
   713      */
       
   714     void DoActivateL(
       
   715         const TVwsViewId& aPrevViewId,
       
   716         TUid aCustomMessageId,
       
   717         const TDesC8& aCustomMessage );
       
   718 
       
   719     /**
       
   720      * From CAknView
       
   721      * View deactivation function.
       
   722      */
       
   723     void DoDeactivate();
       
   724 
       
   725     /**
       
   726      * From CAknView
       
   727      * Foreground event handling function.
       
   728      *
       
   729      * @param aForeground Indicates the required focus state of the control.
       
   730      */
       
   731     void HandleForegroundEventL( TBool aForeground );
       
   732 
       
   733 // from base class MEikMenuObserver
       
   734 
       
   735     /**
       
   736      * From MEikMenuObserver
       
   737      * Dynamically initialises a menu pane.
       
   738      *
       
   739      * @param aResourceId The ID of the menu pane.
       
   740      * @param aMenuPane The menu pane itself.
       
   741      */
       
   742     void DynInitMenuPaneL(
       
   743         TInt aResourceId,
       
   744         CEikMenuPane* aMenuPane );
       
   745 
       
   746 // from MEikListBoxObserver
       
   747 
       
   748     /**
       
   749      * From MEikListBoxObserver
       
   750      * Handles listbox events.
       
   751      *
       
   752      * @param aListBox Listbox where the event occurred.
       
   753      * @param aEventType Event type.
       
   754      */
       
   755      void HandleListBoxEventL(
       
   756         CEikListBox* aListBox,
       
   757         TListBoxEvent aEventType );
       
   758 
       
   759 // from MEikCommandObserver
       
   760 
       
   761     /**
       
   762      * From MEikCommandObserver
       
   763      * Processes user commands.
       
   764      *
       
   765      * @param aCommandId ID of the command to respond to.
       
   766      */
       
   767     virtual void ProcessCommandL(TInt aCommandId);
       
   768 
       
   769 // from MMPXCollectionFindObserver
       
   770 
       
   771     /**
       
   772      * From MMPXCollectionFindObserver
       
   773      * Handle callback for "find" operation
       
   774      * @param aEntries, CMPXMedia to be returned
       
   775      * @param aComplete ETrue no more entries. EFalse more entries
       
   776      *                  expected
       
   777      * @param aError error code
       
   778      */
       
   779     virtual void HandleFindAllL(const CMPXMedia& aResults,
       
   780                                 TBool aComplete,TInt aError);
       
   781 
       
   782 // from MMPXViewActivationObserver
       
   783 
       
   784     /**
       
   785      * From MMPXViewActivationObserver
       
   786      * Handle view activation.
       
   787      *
       
   788      * @param aCurrentViewType Current view type Uid.
       
   789      * @param aPreviousViewType Previous view type Uid.
       
   790      */
       
   791     void HandleViewActivation(
       
   792         const TUid& aCurrentViewType,
       
   793         const TUid& aPreviousViewType );
       
   794     /**
       
   795      * @see MMPXViewActivationObserver
       
   796      */
       
   797     void HandleViewUpdate(
       
   798         TUid aViewUid,
       
   799         MMPXViewActivationObserver::TViewUpdateEvent aUpdateEvent,
       
   800         TBool aLoaded,
       
   801         TInt aData);
       
   802 
       
   803 // from MCoeViewActivationObserver
       
   804 
       
   805     /**
       
   806      * From MCoeViewActivationObserver
       
   807      * Handle view activation.
       
   808      *
       
   809      * @param aNewlyActivatedViewId newly activated view id.
       
   810      * @param aViewIdToBeDeactivated deactivated view id.
       
   811      */
       
   812     void HandleViewActivation(
       
   813         const TVwsViewId& aNewlyActivatedViewId,
       
   814         const TVwsViewId& aViewIdToBeDeactivated );
       
   815 
       
   816 // from MCoeViewDeactivationObserver
       
   817     /**
       
   818     * Handles view deactivation notification from view server
       
   819     */
       
   820     void HandleViewDeactivation(const TVwsViewId& aViewIdToBeDeactivated,
       
   821                                 const TVwsViewId& aNewlyActivatedViewId);
       
   822 
       
   823     void InitiateWaitDialogL();
       
   824     void FillAiwParametersL( CAiwGenericParamList& aParamList );
       
   825 
       
   826     void GetUint32Presentation( TUint32& aResult, const TDesC8& aBuf, TInt aOffset );
       
   827     /**
       
   828      * Launches Java Midlet Music Store
       
   829      *
       
   830      * @param aUid Uid of the Java app generated dynamically
       
   831      */
       
   832     void LaunchOperatorJavaMusicShopL(TUid aUid) ;
       
   833 
       
   834     /**
       
   835      * Launches Native Music Shop
       
   836      *
       
   837      * @param aUid Uid of the native app for music Shp
       
   838      */
       
   839  	void LaunchOperatorNativeMusicShopL();
       
   840  		/**
       
   841       * Launches Native URL Music Shop
       
   842       *
       
   843       * @param URl of the native app for music Shp
       
   844       */
       
   845  	void LaunchOperatorURLMusicShopL();
       
   846 
       
   847  	/*
       
   848  	 * Stores the current list box item index.
       
   849  	 */
       
   850  	void StoreListboxItemIndexL();
       
   851  	
       
   852  	void ShowAddedItemsDialogL();
       
   853 
       
   854  	/*
       
   855  	 * Internal function for registering to BackStepping service.
       
   856  	 */
       
   857  	void HandleBacksteppingActivation();
       
   858 
       
   859  	void ChangeCbaVisibility( TBool aVisible );
       
   860 
       
   861  	void UpdateCba();
       
   862 
       
   863 	TBool NowPlayingOptionVisibilityL();
       
   864     void HandleInitMusicMenuPaneL(CEikMenuPane* aMenuPane );
       
   865     void DynInitMenuPaneAlbumL(TInt aResourceId, CEikMenuPane* aMenuPane );
       
   866     void DynInitMenuPanePlaylistL(TInt aResourceId, CEikMenuPane* aMenuPane );
       
   867     void DynInitMenuPaneGenreL(TInt aResourceId, CEikMenuPane* aMenuPane );
       
   868     void DynInitMenuPaneSongsL(TInt aResourceId, CEikMenuPane* aMenuPane );
       
   869     void DynInitMenuPanePlaylistSongsL(TInt aResourceId, CEikMenuPane* aMenuPane );
       
   870 
       
   871     void OpenAllSongsL();
       
   872     void OpenArtistAlbumsL();
       
   873     void OpenPlaylistsL();
       
   874     void OpenGenreL();
       
   875     void OpenPodcastsL();
       
   876 
       
   877     /*
       
   878  	 * Display information about MusicPlayer version.
       
   879  	 */
       
   880      void  DisplayAboutDlgL() const;
       
   881 	/*
       
   882  	 * Internal functions to show the Educating user URI.
       
   883  	 */
       
   884     void EducatingUserDialog();
       
   885     TBool NeedToShowEducatingDialog(); 
       
   886     void LaunchEducatingURL();
       
   887     static TInt LinkCallback(TAny* aPtr);
       
   888 	
       
   889 	/*
       
   890  	 * Internal functions to Dim all options
       
   891  	 */
       
   892     void DimAllOptions( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   893 	
       
   894 private:    // Data
       
   895 
       
   896     MMPXCollectionUtility*      iCollectionUtility;
       
   897     CMPXCollectionViewHgContainer* iContainer;
       
   898     MMPXPlaybackUtility*        iPlaybackUtility;
       
   899     MMPXViewUtility*            iViewUtility;
       
   900     CMPXCommonUiHelper*         iCommonUiHelper;
       
   901     MMPXCollectionUiHelper*     iCollectionUiHelper;
       
   902     MMPXCollectionHelper*       iCollectionHelper;
       
   903     CMPXMedia*                  iUserPlaylists;
       
   904 
       
   905     CSendUi*                    iSendUi;
       
   906     HBufC*                      iTitle;
       
   907     HBufC*                      iDuration;
       
   908     HBufC*                      iOriginalTitle;
       
   909     HBufC*                      iOriginalDuration;
       
   910     HBufC*                      iNewName;
       
   911     CArrayFix<TInt>*            iBottomIndex;
       
   912 
       
   913     TBool                       iBackOneLevel;
       
   914     TBool                       iPossibleJump;
       
   915     TBool                       iIsGrabbed;
       
   916     TBool                       iIsEmbedded;
       
   917     TBool                       iAddingSong;
       
   918     TBool                       iIsDeleting;
       
   919     TBool                       iIsSavingReorderPlaylist;
       
   920     TBool                       iIsWaitNoteCanceled;
       
   921     TBool                       iInvalidFileExist;
       
   922     TBool                       iHandlingKeyEvent;
       
   923     TBool                       iAddingToNewPlaylist;
       
   924     TBool                       iExitOptionHidden;
       
   925     TBool                       iGoToMusicShopOptionHidden;
       
   926     TBool                       iIgnoreNextFocusChangedMessage;
       
   927     TBool                       iCollectionReady;  // for incremental open
       
   928     TBool                       iCollectionCacheReady; //cache ready
       
   929     
       
   930     TInt                        iCurrentPlaylistOp;
       
   931     TInt                        iNumSongAddedToPlaylist;
       
   932     TMPXItemId                  iPlaylistId;
       
   933     TInt                        iFirstIndexOnScreen;
       
   934     TInt                        iCurrentMediaLOp;   // current mediaL operation
       
   935     TInt                        iCurrentFindAllLOp; // current FindAllL operation
       
   936     TInt                        iLastDepth;
       
   937     TInt                        iPlayIndex;
       
   938     TInt                        iResourceOffset;       // must be freed
       
   939     TInt                        iSetMediaLCount;
       
   940 
       
   941     TInt                        iCurrentHighlightedIndex;
       
   942 
       
   943     TInt                        iCachedCommand; // for incremental open
       
   944     CListBoxView::CSelectionIndexArray* iCachedSelectionIndex;
       
   945 
       
   946     CEikButtonGroupContainer*       iCurrentCba;
       
   947 
       
   948     CAknQueryDialog*            iConfirmationDlg;
       
   949 
       
   950     const CArrayFix<TInt>*      iSelectionIndexCache; // not owned
       
   951 #ifdef __ENABLE_MSK
       
   952     TInt                            iCurrentMskId;
       
   953     TBool                           iShowContextMenu;
       
   954 #endif // __ENABLE_MSK
       
   955 
       
   956     MProfileEngine*             iProfileEngine;
       
   957 
       
   958     RArray<TUid> iPlayersList;
       
   959     CAiwServiceHandler* iServiceHandler;
       
   960     TInt iErrorAttachCopyMenu;
       
   961     TMPXPlaybackPlayerType iCurrentPlayerType;
       
   962     HBufC* iSubPlayerName;
       
   963 
       
   964     HBufC* iCurrentSelectedIndex;   // current selected item index
       
   965     TBool   iUsingNokiaService;
       
   966 
       
   967     CMPXCollectionOpenUtility* iIncrementalOpenUtil;
       
   968 
       
   969     TInt iUpCount;
       
   970     TInt iDownCount;
       
   971 
       
   972     CMediatorCommandInitiator* iCommandInitiator;
       
   973     TPtrC iItemTitle;
       
   974     TInt iWaitNoteId;
       
   975     TBool iCoverDisplay;
       
   976 
       
   977 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
       
   978     TBool iPodcast;
       
   979 #endif // __ENABLE_PODCAST_IN_MUSIC_MENU
       
   980 
       
   981 #ifdef BACKSTEPPING_INCLUDED
       
   982     MMPXBackSteppingUtility* iBackSteppingUtility;
       
   983     TBool iActivateBackStepping;
       
   984 #endif // BACKSTEPPING_INCLUDED
       
   985 
       
   986     TBool iUSBOnGoing;
       
   987     TBool iInAlbumArtDialog;
       
   988     TBool iDisablePodcasting;
       
   989     TProcessPriority iPriority;
       
   990     TBool iInSongDetails;
       
   991 
       
   992     TBool iUpnpFrameworkSupport;
       
   993     CMediaRecognizer* iMediaRecognizer;
       
   994     TInt iErrorAttachAssignMenu;
       
   995     TWaitNoteType iNoteType;
       
   996 
       
   997     // Music Store
       
   998     TInt iOperatorMusicStore;
       
   999     TUint32 iMusicStoreUID;
       
  1000 	TUint32 iOperatorNativeMusicStoreUID;
       
  1001     TUid iOperatorMusicStoreUID;
       
  1002     HBufC16* iOperatorMusicStoreName;
       
  1003     TInt iOperatorMusicStoreType;
       
  1004     TInt iMusicStoreWebPage;
       
  1005     HBufC16* iOperatorMusicStoreURI;
       
  1006     HBufC16* iEducateUserURI; 
       
  1007     TInt iEducatingPopupState ;       
       
  1008     TBool iPopuponRefresh; 
       
  1009 
       
  1010     // Wait note for delete
       
  1011     CAknWaitDialog*	iWaitDialog;
       
  1012     TBool iIsAddingToPlaylist;  // flag used to handle the return by adding songs incrementally
       
  1013     CUpnpCopyCommand* iUpnpCopyCommand;
       
  1014 
       
  1015     TBool iOpeningNote; // Waitnote is opening
       
  1016 	TBool iMarkedAll;
       
  1017 	TBool iFirstIncrementalBatch;
       
  1018     CMPXMedia *iStoredAlbum; // owned
       
  1019     CRepository *iRepository; //owned
       
  1020     
       
  1021     TBool                       iDialogDismissed;
       
  1022     HBufC*                      iTitleWait; // Owned
       
  1023     TBool                       iGoToNowPlaying;
       
  1024     };
       
  1025 
       
  1026 #endif  // C_CMPXCOLLECTIONVIEWHGIMP_H
       
  1027 
       
  1028 // End of File