| 1 | /* |
| 2 | * Bittorrent Client using Qt and libtorrent. |
| 3 | * Copyright (C) 2025 Mike Tzou (Chocobo1) |
| 4 | * Copyright (C) 2011 Vladimir Golovnev <[email protected]> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version 2 |
| 9 | * of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | * |
| 20 | * In addition, as a special exception, the copyright holders give permission to |
| 21 | * link this program with the OpenSSL project's "OpenSSL" library (or with |
| 22 | * modified versions of it that use the same license as the "OpenSSL" library), |
| 23 | * and distribute the linked executables. You must obey the GNU General Public |
| 24 | * License in all respects for all of the code used other than "OpenSSL". If you |
| 25 | * modify file(s), you may extend this exception to your version of the file(s), |
| 26 | * but you are not obligated to do so. If you do not wish to do so, delete this |
| 27 | * exception statement from your version. |
| 28 | */ |
| 29 | |
| 30 | #pragma once |
| 31 | |
| 32 | #include <QDBusUnixFileDescriptor> |
| 33 | #include <QObject> |
| 34 | |
| 35 | #include "inhibitor.h"cxx . . $ `<file>/src/gui/powermanagement/inhibitor.h`/ |
| 36 | |
| 37 | class QDBusInterfacecxx . . $ QDBusInterface#; |
| 38 | class QDBusPendingCallWatchercxx . . $ QDBusPendingCallWatcher#; |
| 39 | |
| 40 | class InhibitorDBuscxx . . $ InhibitorDBus# final : public QObjectcxx . . $ QObject#, public Inhibitorcxx . . $ Inhibitor# |
| 41 | { |
| 42 | Q_OBJECTcxx . . $ InhibitorDBus#qt_staticMetaObjectContent. |
| 43 | Q_DISABLE_COPY_MOVEcxx . . $ InhibitorDBus#`operator=`(854022c593a9982a).(InhibitorDBus) |
| 44 | |
| 45 | public: |
| 46 | InhibitorDBuscxx . . $ InhibitorDBus#InhibitorDBus(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent = nullptr); |
| 47 | |
| 48 | bool requestBusycxx . . $ InhibitorDBus#requestBusy(c9857a73d68e59ba).() override; |
| 49 | bool requestIdlecxx . . $ InhibitorDBus#requestIdle(c9857a73d68e59ba).() override; |
| 50 | |
| 51 | private slotscxx . . $ `<external>/4830994369567095248/qtmetamacros.h:42:14`!: |
| 52 | void onAsyncReplycxx . . $ InhibitorDBus#onAsyncReply(d27dd7c217027f21).(QDBusPendingCallWatchercxx . . $ QDBusPendingCallWatcher# *call); |
| 53 | |
| 54 | private: |
| 55 | enum Statecxx . . $ InhibitorDBus#State# |
| 56 | { |
| 57 | Errorcxx . . $ InhibitorDBus#Error., |
| 58 | Idlecxx . . $ InhibitorDBus#Idle., |
| 59 | RequestBusycxx . . $ InhibitorDBus#RequestBusy., |
| 60 | Busycxx . . $ InhibitorDBus#Busy., |
| 61 | RequestIdlecxx . . $ InhibitorDBus#RequestIdle. |
| 62 | }; |
| 63 | |
| 64 | enum class ManagerTypecxx . . $ InhibitorDBus#ManagerType# |
| 65 | { |
| 66 | Freedesktopcxx . . $ InhibitorDBus#ManagerType#Freedesktop., // https://www.freedesktop.org/wiki/Specifications/power-management-spec/ |
| 67 | Gnomecxx . . $ InhibitorDBus#ManagerType#Gnome., // https://github.com/GNOME/gnome-settings-daemon/blob/master/gnome-settings-daemon/org.gnome.SessionManager.xml |
| 68 | Systemdcxx . . $ InhibitorDBus#ManagerType#Systemd. // https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html |
| 69 | }; |
| 70 | |
| 71 | QDBusInterfacecxx . . $ QDBusInterface# *m_busInterfacecxx . . $ InhibitorDBus#m_busInterface. = nullptr; |
| 72 | ManagerTypecxx . . $ InhibitorDBus#ManagerType# m_managercxx . . $ InhibitorDBus#m_manager. = ManagerTypecxx . . $ InhibitorDBus#ManagerType#::Gnomecxx . . $ InhibitorDBus#ManagerType#Gnome.; |
| 73 | |
| 74 | enum Statecxx . . $ InhibitorDBus#State# m_statecxx . . $ InhibitorDBus#m_state. = Errorcxx . . $ InhibitorDBus#Error.; |
| 75 | enum Statecxx . . $ InhibitorDBus#State# m_intendedStatecxx . . $ InhibitorDBus#m_intendedState. = Idlecxx . . $ InhibitorDBus#Idle.; |
| 76 | uintcxx . . $ uint# m_cookiecxx . . $ InhibitorDBus#m_cookie. = 0; |
| 77 | QDBusUnixFileDescriptorcxx . . $ QDBusUnixFileDescriptor# m_fdcxx . . $ InhibitorDBus#m_fd.; |
| 78 | }; |