mpviewplugins/mpplaybackviewplugin/tsrc/unittest_mpplaybackview/stub/inc/mpplaybackdata.h
changeset 48 af3740e3753f
equal deleted inserted replaced
42:79c49924ae23 48:af3740e3753f
       
     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: mpplaybackdata stub for testing mpplaybackview
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPPLAYBACKDATA_H
       
    19 #define MPPLAYBACKDATA_H
       
    20 
       
    21 //includes
       
    22 #include <QObject>
       
    23 #include <QMetaType>
       
    24 
       
    25 
       
    26 class MpPlaybackData : public QObject
       
    27 {
       
    28     Q_OBJECT
       
    29 
       
    30 public:
       
    31 
       
    32 const QString& uri() const;
       
    33 
       
    34 
       
    35 
       
    36     enum SimplifiedState {
       
    37         NotPlaying,
       
    38         Playing,
       
    39         Paused,
       
    40         Stopped
       
    41     };
       
    42     // Test utility functions
       
    43     static int getUpdateCounter();
       
    44     static void resetUpdateCounter();
       
    45     void triggerStateUpdate(SimplifiedState state);
       
    46     void triggerLabelsChanged(const QString &title, const QString &artist);
       
    47     void setPlaybackState(MpPlaybackData::SimplifiedState state);
       
    48     void setUri( QString uri );
       
    49 
       
    50     // Stub functions
       
    51     explicit MpPlaybackData();
       
    52     virtual ~MpPlaybackData();
       
    53 
       
    54 
       
    55 signals:
       
    56     void playbackStateChanged();
       
    57     void playbackInfoChanged();
       
    58 
       
    59 public:
       
    60     const QString& title() const;
       
    61     const QString& artist() const;
       
    62     MpPlaybackData::SimplifiedState playbackState() const;
       
    63 
       
    64 public:
       
    65     QString                  mArtist;
       
    66     QString                  mTitle;
       
    67     SimplifiedState          mPlaybackState;
       
    68     QString                  mUri;
       
    69 
       
    70 };
       
    71 
       
    72 #endif  // MPPLAYBACKDATA_H