File indexing completed on 2024-04-21 04:56:50

0001 /**
0002  * SPDX-FileCopyrightText: 2018 Albert Vaca Cintora <albertvaka@gmail.com>
0003  * SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
0004  *
0005  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006  */
0007 
0008 #pragma once
0009 
0010 #include "abstractremoteinput.h"
0011 #include "generated/systeminterfaces/remotedesktop.h"
0012 #include <QDBusObjectPath>
0013 
0014 class FakeInput;
0015 
0016 class RemoteDesktopSession : public QObject
0017 {
0018     Q_OBJECT
0019 public:
0020     RemoteDesktopSession();
0021     void createSession();
0022     bool isValid() const
0023     {
0024         return m_connecting || !m_xdpPath.path().isEmpty();
0025     }
0026     OrgFreedesktopPortalRemoteDesktopInterface *const iface;
0027     QDBusObjectPath m_xdpPath;
0028     bool m_connecting = false;
0029 
0030 private Q_SLOTS:
0031     void handleXdpSessionCreated(uint code, const QVariantMap &results);
0032     void handleXdpSessionConfigured(uint code, const QVariantMap &results);
0033     void handleXdpSessionStarted(uint code, const QVariantMap &results);
0034     void handleXdpSessionFinished(uint code, const QVariantMap &results);
0035 
0036 private:
0037 };
0038 
0039 class WaylandRemoteInput : public AbstractRemoteInput
0040 {
0041     Q_OBJECT
0042 
0043 public:
0044     explicit WaylandRemoteInput(QObject *parent);
0045 
0046     bool handlePacket(const NetworkPacket &np) override;
0047     bool hasKeyboardSupport() override
0048     {
0049         return true;
0050     }
0051 };