mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackplugin.h
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     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:  Playback plugin interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMPXPLAYBACKPLUGIN_H
       
    20 #define CMPXPLAYBACKPLUGIN_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <ecom/ecom.h>
       
    24 #include <mpxplaybackframeworkdefs.h>
       
    25 #include <mpxattribute.h>
       
    26 #include <mpxattributespecs.h>
       
    27 #include <mpxcommand.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 
       
    31 class MMPXPlaybackPluginObserver;
       
    32 
       
    33 // CONSTANTS
       
    34 const TUid KMPXPlaybackInterfaceUid={0x101FFC05};
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  Interface to play media.
       
    40 *
       
    41 *  @lib mpxcommon.lib
       
    42 */
       
    43 NONSHARABLE_CLASS(CMPXPlaybackPlugin): public CBase
       
    44     {
       
    45 
       
    46 public: // Constructors and destructor
       
    47 
       
    48     /**
       
    49     * Two-phased constructor.
       
    50     *
       
    51     * @since S60 3.2.3
       
    52     * @param aUid uid of interface implementation
       
    53     * @param aObs observer
       
    54     * @return object of constructed
       
    55     */
       
    56     inline static CMPXPlaybackPlugin* NewL(TUid aUid,
       
    57                                       MMPXPlaybackPluginObserver& aObs);
       
    58 
       
    59     /**
       
    60     * Two-phased constructor.
       
    61     *
       
    62     * @since S60 3.2.3
       
    63     * @param aUid uid of interface implementation
       
    64     * @return object of constructed
       
    65     */
       
    66     inline static CMPXPlaybackPlugin* NewL(TUid aUid);
       
    67 
       
    68     /**
       
    69     * Destructor.
       
    70     *
       
    71     * @since S60 3.2.3
       
    72     */
       
    73     inline virtual ~CMPXPlaybackPlugin();
       
    74 
       
    75 public:
       
    76 
       
    77     /**
       
    78      * Implementation uid of plugin.
       
    79      *
       
    80      * @since S60 3.2.3
       
    81      */
       
    82     inline const TUid& Uid();
       
    83 
       
    84     /**
       
    85     * Set observer.
       
    86     *
       
    87     * @since S60 3.2.3
       
    88     * @param aObs observer
       
    89     */
       
    90     virtual inline void SetObserver(MMPXPlaybackPluginObserver& aObs);
       
    91 
       
    92     /**
       
    93     * Initializes a song for playback.
       
    94     *
       
    95     * @since S60 3.2.3
       
    96     * @param aSong the song path
       
    97     */
       
    98     virtual void InitialiseL(const TDesC& aSong)=0;
       
    99 
       
   100     /**
       
   101     * Initializes a song for playback.
       
   102     *
       
   103     * @since S60 3.2.3
       
   104     * @param aFile file handle of a song
       
   105     */
       
   106     virtual void InitialiseL(RFile& aSong)=0;
       
   107 
       
   108     /** 
       
   109     * Executes a command on the selected song.
       
   110     *
       
   111     * @since S60 3.2.3
       
   112     * @param aCmd a command
       
   113     * @param aData data (optional)
       
   114     * @deprecated Use method CMPXPlaybackPlugin::CommandL(
       
   115     *     CMPXCommand& aCmd) instead.
       
   116     */
       
   117     virtual void CommandL(TMPXPlaybackCommand aCmd, TInt aData=0)=0;
       
   118 
       
   119     /**
       
   120      * Executes a command.
       
   121      *
       
   122      * @since S60 3.2.3
       
   123      * @param aCmd a command
       
   124      */
       
   125      virtual void CommandL(CMPXCommand& /*aCmd*/)
       
   126          {/*Note: All clients need to implement this */}
       
   127 
       
   128     /**
       
   129     * Sets a property of the plugin.
       
   130     *
       
   131     * @since S60 3.2.3
       
   132     * @param aProperty a playback property
       
   133     * @param aValue the value of the property
       
   134     */
       
   135     virtual void SetL(TMPXPlaybackProperty aProperty, TInt aValue)=0;
       
   136 
       
   137     /** 
       
   138      * Gets a property of the plugin (async).
       
   139      *
       
   140      * Plugin has to implement either ValueL or PropertyL. But the plugin can not
       
   141      * implement both of the functions. Otherwise, there will be circular function call.
       
   142      *
       
   143      * @since S60 3.2.3
       
   144      * @param aProperty a property
       
   145      * @deprecated Use method CMPXPlaybackPlugin::PropertyL(
       
   146      *        TMPXPlaybackProperty aProperty) instead.
       
   147      * Note: please call PropertyL in the downloadproxy plugin.
       
   148      */
       
   149     virtual void ValueL(TMPXPlaybackProperty aProperty) const
       
   150          {
       
   151          // Call the propertyL of the plugin which does not implement the ValueL
       
   152          PropertyL(aProperty);
       
   153          }
       
   154 
       
   155      /**
       
   156       * Gets a property of the plugin (async).
       
   157       * Result will be called back in HandleProperty.
       
   158       *
       
   159       * @since S60 3.2.3
       
   160       * @param aProperty a property
       
   161       */
       
   162     virtual void PropertyL(TMPXPlaybackProperty aProperty) const
       
   163          {
       
   164          //Note: change into pure virtual when all plugins implement the api
       
   165          //Default map to ValueL of the plugin which does not implement the PropertyL
       
   166          ValueL(aProperty);
       
   167          }
       
   168 
       
   169     /**
       
   170     * Gets a list of sub players.
       
   171     *
       
   172     * @since S60 3.2.3
       
   173     * @return a list of names of sub players
       
   174     */
       
   175     virtual void SubPlayerNamesL()=0;
       
   176 
       
   177     /**
       
   178     * Select a sub player.
       
   179     *
       
   180     * @since S60 3.2.3
       
   181     * @param aIndex index to the sub player
       
   182     */
       
   183     virtual void SelectSubPlayerL(TInt aIndex)=0;
       
   184 
       
   185     /**
       
   186     * Returns current sub player name.
       
   187     *
       
   188     * @since S60 3.2.3
       
   189     * @return friendly name of the current the sub player
       
   190     */
       
   191     virtual const TDesC& SubPlayerName()=0;
       
   192 
       
   193     /**
       
   194     * Current sub player index.
       
   195     *
       
   196     * @since S60 3.2.3
       
   197     * @return index to the sub player
       
   198     */
       
   199     virtual TInt SubPlayerIndex() const=0;
       
   200 
       
   201     /**
       
   202     * Implement the version with CMPXAttributeSpecs instead.
       
   203     * This will be removed in a future release.
       
   204     *
       
   205     * Extended properties of the current file (async).
       
   206     *
       
   207     * @since S60 3.2.3
       
   208     * @param aAttrs attributes requested
       
   209     * @deprecated Use method CMPXPlaybackPlugin::MediaL(
       
   210     *       const TArray<TMPXAttribute>& aAttrs,
       
   211     *       CMPXAttributeSpecs* aSpecs ) instead.
       
   212     */
       
   213     virtual void MediaL(const TArray<TMPXAttribute>& aAttrs)=0;
       
   214 
       
   215     /**
       
   216     * Should make this pure virtual in the future when
       
   217     * the previous API is removed and all client has implement
       
   218     * this API.
       
   219     *
       
   220     * Extended properties of the current file (async).
       
   221     *
       
   222     * @since S60 3.2.3
       
   223     * @param aAttrs attributes requested
       
   224     * @param aSpecs attribute spec, ownership not passed
       
   225     */
       
   226     virtual void MediaL(
       
   227         const TArray<TMPXAttribute>& aAttrs,
       
   228         CMPXAttributeSpecs* /*aSpecs*/ )
       
   229         {
       
   230         MediaL( aAttrs );
       
   231         };
       
   232 
       
   233     /**
       
   234     * Cancel outstanding request.
       
   235     *
       
   236     * @since S60 3.2.3
       
   237     */
       
   238     virtual void CancelRequest()=0;
       
   239 
       
   240 protected:
       
   241     MMPXPlaybackPluginObserver*  iObs; // Not owned
       
   242 
       
   243 private: // Data
       
   244 
       
   245     // identifies the actual plugin instance
       
   246     TUid iDtorKey;
       
   247     TUid iUid; //Implementation uid of the plugin
       
   248     };
       
   249 
       
   250 #include "mpxplaybackplugin.inl"
       
   251 
       
   252 #endif      // CMPXPLAYBACKPLUGIN_H
       
   253 
       
   254