mmappfw_plat/mpx_playback_common_definition_api/inc/mpxplaybackobserver.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 observer
       
    15 *
       
    16 */
       
    17 
       
    18  
       
    19 
       
    20 #ifndef MMPXPLAYBACKOBSERVER_H
       
    21 #define MMPXPLAYBACKOBSERVER_H
       
    22 
       
    23 #include <bamdesca.h>
       
    24 #include <mpxmessage2.h>
       
    25 #include <mpxcommand.h>
       
    26 #include<mpxplaybackframeworkdefs.h>
       
    27 
       
    28 class TMPXPlaybackMessage;
       
    29 class CMPXMedia;
       
    30 
       
    31 /**
       
    32 *  Interface for receiving events.
       
    33 *
       
    34 *  @lib mpxcommon.lib
       
    35 */ 
       
    36 NONSHARABLE_CLASS(MMPXPlaybackObserver)
       
    37     {
       
    38 public: 
       
    39     /**  
       
    40      *  Handle playback message.
       
    41      *
       
    42      *  @since S60 3.2.3
       
    43      *  @param aMsg playback message
       
    44      *  @deprecated Use method MMPXPlaybackObserver::HandlePlaybackMessage
       
    45      *       (CMPXMessage* aMsg, TInt aErr) instead. 
       
    46      *        Because if system error happens, e.g. KErrNoMemory, aMsg object
       
    47      *        can not be created. 
       
    48      *  NOTE: only one of HandlePlaybackMessage callback can be implemented.
       
    49      */
       
    50     virtual void HandlePlaybackMessage(const CMPXMessage& /*aMsg*/)
       
    51          {
       
    52          }
       
    53     
       
    54     /**
       
    55     *  Handle playback message.
       
    56     *  Note: only one of HandlePlaybackMessage callback can be implemented.
       
    57     *  Note: change into pure virtual when all clients updated.
       
    58     *
       
    59     *  @since S60 3.2.3
       
    60     *  @param aMsg playback message, ownership not transferred. 
       
    61     *         Please check aMsg is not NULL before using it. If aErr is not 
       
    62     *         KErrNone, plugin might still call back with more info in the aMsg.
       
    63     *  @param aErr system error code.
       
    64     */
       
    65     virtual void HandlePlaybackMessage(CMPXMessage* aMsg, TInt /*aErr*/)
       
    66         {// Note: change into pure virtual when all clients updated.
       
    67         // Temp solution, aMsg will be a dummy object if aErr.
       
    68         
       
    69         // TO BE REMOVED when above HandlePlaybackMessage is removed.
       
    70         HandlePlaybackMessage(*aMsg);
       
    71         }
       
    72     };
       
    73 
       
    74 /**
       
    75 *  Interface for receiving property values asynchronously.
       
    76 *
       
    77 *  @lib mpxcommon.lib
       
    78 */
       
    79 NONSHARABLE_CLASS(MMPXPlaybackCallback)
       
    80     {
       
    81 public:
       
    82 
       
    83     /**
       
    84     *  Handle playback property.
       
    85     *
       
    86     *  @since S60 3.2.3
       
    87     *  @param aProperty the property
       
    88     *  @param aValue the value of the property
       
    89     *  @param aError error code
       
    90     */
       
    91     virtual void HandlePropertyL(TMPXPlaybackProperty aProperty,
       
    92                                  TInt aValue, 
       
    93                                  TInt aError) = 0;
       
    94     
       
    95     /**
       
    96     *  Method is called continously until aComplete=ETrue, signifying that 
       
    97     *  it is done and there will be no more callbacks.
       
    98     *  Only new items are passed each time.
       
    99     *
       
   100     *  @since S60 3.2.3
       
   101     *  @param aPlayer UID of the subplayer
       
   102     *  @param aSubPlayers a list of sub players
       
   103     *  @param aComplete ETrue no more sub players. EFalse more subplayer
       
   104     *                   expected
       
   105     *  @param aError error code
       
   106     */
       
   107     virtual void HandleSubPlayerNamesL(TUid aPlayer, 
       
   108                                        const MDesCArray* aSubPlayers,
       
   109                                        TBool aComplete,
       
   110                                        TInt aError) = 0;
       
   111     
       
   112     /**
       
   113     *  Call back of media request.
       
   114     *
       
   115     *  @since S60 3.2.3
       
   116     *  @param aMedia media 
       
   117     *  @param aError error code    
       
   118     */
       
   119     virtual void HandleMediaL(const CMPXMedia& aProperties,
       
   120                               TInt aError) = 0;
       
   121     
       
   122     /**
       
   123      *  Handle completion of a asynchronous command.
       
   124      *  Note: All clients should implement this callback.
       
   125      *
       
   126      *  @since S60 3.2.3
       
   127      *  @param aCommandResult result of the command, NULL if error
       
   128      *  @param aError error code    
       
   129      */
       
   130     virtual void HandlePlaybackCommandComplete(CMPXCommand* /*aCommandResult*/, 
       
   131                                                TInt /*aError*/) {}
       
   132     
       
   133     };
       
   134     
       
   135 #endif // MMPXPLAYBACKOBSERVER_H