musichomescreen_multiview/musicplayeractionhandlerplugin/inc/musicplayeractionhandler.h
branchRCL_3
changeset 53 3de6c4cf6b67
equal deleted inserted replaced
52:14979e23cb5e 53:3de6c4cf6b67
       
     1 /*
       
     2 * Copyright (c) 2008-2008 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:  Music Player Action Handler Plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_MUSICPLAYERACTIONHANDLER_H
       
    20 #define C_MUSICPLAYERACTIONHANDLER_H
       
    21 
       
    22 #include <ahplugin.h>
       
    23 #include <mpxplaybackcommanddefs.h>
       
    24 
       
    25 // FORWARD DECLARATION
       
    26 class CLiwMap;
       
    27 class TLiwVariant;
       
    28 class MMPXPlaybackUtility;
       
    29 
       
    30 /**
       
    31  *  Music Player Action Handler Plugin.
       
    32  *  Class extends the CAHPlugin in order to be used as a plugin for
       
    33  *  action handler.
       
    34  *  @since S60 S60 v5.0
       
    35  */
       
    36 NONSHARABLE_CLASS( CMusicPlayerActionHandler ) : public CAHPlugin
       
    37     {
       
    38 public:
       
    39 
       
    40     /**
       
    41      * Standard Symbian 2 phase constructor
       
    42      */
       
    43     static CMusicPlayerActionHandler* NewL();
       
    44 
       
    45     /**
       
    46      * Standard Symbian 2 phase constructor
       
    47      */
       
    48     static CMusicPlayerActionHandler* NewLC();
       
    49 
       
    50     /**
       
    51      * Standard C++ destructor.
       
    52      */
       
    53     ~CMusicPlayerActionHandler();
       
    54 
       
    55 // from base class CAHPlugin
       
    56 
       
    57     /**
       
    58      * From CAHPlugin
       
    59      * This is called by the AH to execute an action 
       
    60      * @param aMap an action object to be executed
       
    61      * @return Error code
       
    62      */
       
    63     TInt ExecuteActionL( const CLiwMap* aMap );
       
    64 
       
    65 private:
       
    66     /**
       
    67      * Standard Symbian 2nd phase constructor.
       
    68      */
       
    69     void ConstructL();
       
    70 
       
    71     /**
       
    72      * Executes Playback command on the current player.
       
    73      * @param aMap an action object to be executed
       
    74      * @return status code
       
    75      */
       
    76     TInt ExecutePlaybackCommandL( const CLiwMap* aMap );
       
    77 
       
    78     /**
       
    79      * Sends a message to Music Player.
       
    80      * @param aMap an action object to be executed
       
    81      * @return status code
       
    82      */
       
    83     TInt ExecuteMessageToMusicPlayerL( const CLiwMap* aMap );
       
    84 
       
    85     /**
       
    86      * goes to now-playing view
       
    87      * @return status code
       
    88      */
       
    89     TInt GoToNowPlayingL();
       
    90     
       
    91     /**
       
    92      * goes to The last Played song.
       
    93      * @param aMinimized indicates if app should be in the background.
       
    94      * @return status code
       
    95      */
       
    96     TInt GoToLastPlayedL(TBool aMinimazed);
       
    97     
       
    98     /**
       
    99      * goes to library/collection view
       
   100      * @return status code
       
   101      */
       
   102     TInt GoToMusicLibraryL();
       
   103     
       
   104     /**
       
   105      * goes to Album & Artist view
       
   106      * @return status code
       
   107      */
       
   108     TInt GoToAlbumViewL();
       
   109     
       
   110     /**
       
   111      * Gets a descriptor from the map.
       
   112      * @param aMap containing the data.
       
   113      * @param aString where the data is extracted to.
       
   114      * @param aMapName element of the map that is to be extracted.
       
   115      * @return status code
       
   116      */
       
   117     TInt ExtractDesL( const CLiwMap* aMap, RBuf& aString,
       
   118             const TDesC8& aMapName );
       
   119 
       
   120     /**
       
   121      * Gets a variant from the map.
       
   122      * @param aMap containing the data.
       
   123      * @param aVariant where the data is extracted to.
       
   124      * @param aMapName element of the map that is to be extracted.
       
   125      * @return status code
       
   126      */
       
   127     TInt ExtractVariantL( const CLiwMap* aMap, TLiwVariant& aVariant,
       
   128             const TDesC8& aMapName );
       
   129 
       
   130     /**
       
   131      *  Sets the playback command.
       
   132      *  @param aCommand commandType.
       
   133      */
       
   134     void SetPlaybackCommandL( TMPXPlaybackCommand aCommand );
       
   135     
       
   136     /**
       
   137      *  Calls transition effect. 
       
   138      *  To be called before bringing an already running application to foreground.
       
   139      *  @param aNext TUid of the application to transition to.
       
   140      */
       
   141     void BeginFullScreenTransEffect( const TUid& aNext );
       
   142 private: // data
       
   143 
       
   144     /**
       
   145      * The playback utility where playback operations are performed.
       
   146      * Own.
       
   147      */
       
   148     MMPXPlaybackUtility* iPlaybackUtility;
       
   149     };
       
   150 
       
   151 #endif /* C_MUSICPLAYERACTIONHANDLER_H */
       
   152 
       
   153 //  End of File