utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/inc/mpnowplayingbackend.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/inc/mpnowplayingbackend.h Fri Mar 19 09:28:13 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: mpnowplayingbackend stub for testing MpNowPlayingWidget
+*
+*/
+
+#ifndef MPNOWPLAYINGBACKEND_H
+#define MPNOWPLAYINGBACKEND_H
+
+//includes
+#include <QObject>
+#include <QMetaType>
+
+enum SimplifiedPlayerState {
+ NotPlaying, //When there is no source
+ Playing, //When it is playing
+ Paused //When is not in Playing State
+};
+
+// Register so type can be used in signal and slot connection
+Q_DECLARE_METATYPE(SimplifiedPlayerState)
+
+
+class MpNowPlayingBackEnd : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ // Test utility functions
+ static int getUpdateCounter();
+ static void resetUpdateCounter();
+ static int getPlayPauseCounter();
+ static void resetPlayPauseCounter();
+ void triggerStateUpdate(SimplifiedPlayerState state);
+ void triggerTitleChanged(const QString &text);
+ void triggerArtistChanged(const QString &text);
+
+ // Stub functions
+ explicit MpNowPlayingBackEnd(long int playerId=0);
+ virtual ~MpNowPlayingBackEnd();
+
+signals:
+ void stateUpdate(SimplifiedPlayerState state);
+ void titleChanged(const QString &text);
+ void artistChanged(const QString &text);
+
+public slots:
+ void update();
+ void playPause();
+
+};
+
+#endif // MPNOWPLAYINGBACKEND_H