Sayonara Player
Loading...
Searching...
No Matches
DBusSessionManager.h
1/* DBusSessionManager.h */
2/*
3 * Copyright (C) 2011-2024 Michael Lugmair
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef SAYONARA_PLAYER_DBUSSESSIONMANAGER_H
22#define SAYONARA_PLAYER_DBUSSESSIONMANAGER_H
23
24#include "Components/PlayManager/PlayManager.h"
25#include "DBus/SessionManager.h"
26#include "Utils/Pimpl.h"
27
28#include <QObject>
29
30class PlayManager;
31
32namespace Dbus
33{
34 class SessionManager :
35 public QObject
36 {
37 Q_OBJECT
38 PIMPL(SessionManager)
39
40 public:
41 SessionManager(PlayManager* playManager);
42 ~SessionManager() noexcept override;
43
44 SessionManager(const SessionManager& other) = delete;
45 SessionManager(SessionManager&& other) = delete;
46 SessionManager& operator=(const SessionManager& other) = delete;
47 SessionManager& operator=(SessionManager&& other) = delete;
48
49 [[nodiscard]] bool canInhibit() const;
50
51 private slots:
52 void playstateChanged(PlayState playState);
53 void inhibitSettingChanged();
54
55 private: // NOLINT(readability-redundant-access-specifiers)
56 void inhibit();
57 void uninhibit();
58 };
59}
60
61#endif //SAYONARA_PLAYER_DBUSSESSIONMANAGER_H
Definition PlayManager.h:34