Debian Codegraph @

tests/service-mocks/media-player-mpris-mock/MediaPlayerMprisMock.h

raw symbols SCIP
1 /*
2 * Copyright 2015 Canonical Ltd.
3 * Copyright 2021 Robert Tari
4 *
5 * This program is free software: you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 3, as published
7 * by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranties of
11 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12 * PURPOSE. See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authors:
18 * Xavi Garcia <[email protected]>
19 * Robert Tari <[email protected]>
20 */
21 #pragma once
22
23 #include <QDBusContext>
24 #include <QDBusObjectPath>
25 #include <QObject>
26
27 #include "DBusPropertiesNotifier.h"
28
29 namespace ayatana
30 {
31
32 namespace indicators
33 {
34
35 namespace testing
36 {
37
38 class MediaPlayerMprisMock : public QObject, protected QDBusContext
39 {
40 Q_OBJECT
41 Q_PROPERTY(bool CanPlay READ canPlay WRITE setCanPlay)
42 Q_PROPERTY(bool CanPause READ canPause WRITE setCanPause)
43 Q_PROPERTY(bool CanGoNext READ canGoNext WRITE setCanGoNext)
44 Q_PROPERTY(bool CanGoPrevious READ canGoPrevious WRITE setCanGoPrevious)
45 Q_PROPERTY(QString DesktopEntry READ desktopEntry WRITE setDesktopEntry)
46
47 public Q_SLOTS:
48 bool canPlay() const;
49 void setCanPlay(bool canPlay);
50
51 bool canPause() const;
52 void setCanPause(bool canPause);
53
54 bool canGoNext() const;
55 void setCanGoNext(bool canGoNext);
56
57 bool canGoPrevious() const;
58 void setCanGoPrevious(bool canGoPrevious);
59
60 QString desktopEntry() const;
61 void setDesktopEntry(QString const &destopEntry);
62
63 public:
64 MediaPlayerMprisMock(QString const &playerName, QObject* parent);
65 virtual ~MediaPlayerMprisMock();
66
67 private:
68 bool can_play_;
69 bool can_pause_;
70 bool can_gonext_;
71 bool can_goprevious_;
72 DBusPropertiesNotifier notifier_;
73 QString player_name_;
74 };
75
76 } // namespace testing
77
78 } // namespace indicators
79
80 } // namespace ayatana