utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingbackend/stub/inc/mpxplaybackutility.h
changeset 43 0f32e550d9d8
parent 38 b93f525c9244
child 45 612c4815aebe
equal deleted inserted replaced
38:b93f525c9244 43:0f32e550d9d8
     1 /*
       
     2 * Copyright (c) 2009 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: mpxplaybackutility stub for testing MpNowPlayingBackEnd
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MMPXPLAYBACKUTILITY_H
       
    20 #define MMPXPLAYBACKUTILITY_H
       
    21 
       
    22 #include <mpxplaybackframeworkdefs.h>
       
    23 #include <mpxcommonframeworkdefs.h>
       
    24 #include <mpxplaybackmessage.h>
       
    25 #include <badesca.h>
       
    26 #include <mpxattribute.h>
       
    27 #include <mpxcommand.h>
       
    28 #include <mpxattributespecs.h>
       
    29 
       
    30 class MMPXPlaybackObserver;
       
    31 class MMPXPlaybackCallback;
       
    32 
       
    33 class MMPXSource
       
    34     {
       
    35 public:
       
    36 
       
    37     // Test utility functions
       
    38     MMPXSource();
       
    39     virtual ~MMPXSource();
       
    40     static void setMediaLeave(bool leave);
       
    41     static int getMediaCounter();
       
    42     static void resetMediaCounter();
       
    43     void sendHandleMediaL(bool title, bool uri, bool artist);
       
    44     void setObserver(MMPXPlaybackCallback* obs);
       
    45 
       
    46     // Stub functions
       
    47     void MediaL(const TArray<TMPXAttribute>& aAttrs, MMPXPlaybackCallback& aCallback);
       
    48 
       
    49 public:
       
    50 
       
    51     MMPXPlaybackCallback*   iObserver;
       
    52 
       
    53     };
       
    54 
       
    55 class MMPXPlaybackUtility
       
    56     {
       
    57 public:
       
    58 
       
    59     // Test utility functions
       
    60     MMPXPlaybackUtility();
       
    61     virtual ~MMPXPlaybackUtility();
       
    62     static void setUtilityLeave(bool leave);
       
    63     static void setAddObserverLeave(bool leave);
       
    64     static void setRemoveObserverLeave(bool leave);
       
    65     static void setCommandLeave(bool leave);
       
    66     static void setStateLeave(bool leave);
       
    67     static int getCloseCounter();
       
    68     static void resetCloseCounter();
       
    69     static int getRemoveObserverCounter();
       
    70     static void resetRemoveObserverCounter();
       
    71     static void setSource(bool exist);
       
    72     static void setState(TMPXPlaybackState state);
       
    73     static TMPXPlaybackState getState();
       
    74     void sendHandlePlaybackMessage(TMPXPlaybackMessage::TEvent event);
       
    75 
       
    76     // Stub functions
       
    77     static MMPXPlaybackUtility* UtilityL(const TUid& aModeId = KPbModeDefault);
       
    78     void AddObserverL(MMPXPlaybackObserver& aObs);
       
    79     void RemoveObserverL(MMPXPlaybackObserver& aObs);
       
    80     void Close();
       
    81     void CommandL(TMPXPlaybackCommand aCmd, TInt aData=0);
       
    82     TMPXPlaybackState StateL() const;
       
    83     MMPXSource* Source();
       
    84 
       
    85 public:
       
    86 
       
    87     MMPXPlaybackObserver*   iObserver;
       
    88     MMPXSource              iSource;    // concrete source object
       
    89 
       
    90     };
       
    91 
       
    92 #endif      // MMPXPLAYBACKUTILITY_H
       
    93 
       
    94 // End of File