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