File indexing completed on 2024-02-25 17:31:02

0001 /*
0002  * SPDX-FileCopyrightText: 2018 Red Hat Inc
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  *
0006  * SPDX-FileCopyrightText: 2018 Jan Grulich <jgrulich@redhat.com>
0007  */
0008 
0009 #ifndef XDG_DESKTOP_PORTAL_KDE_REMOTEDESKTOP_H
0010 #define XDG_DESKTOP_PORTAL_KDE_REMOTEDESKTOP_H
0011 
0012 #include <QDBusAbstractAdaptor>
0013 #include <QDBusObjectPath>
0014 
0015 class RemoteDesktopPortal : public QDBusAbstractAdaptor
0016 {
0017     Q_OBJECT
0018     Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.RemoteDesktop")
0019     Q_PROPERTY(uint version READ version CONSTANT)
0020     Q_PROPERTY(uint AvailableDeviceTypes READ AvailableDeviceTypes CONSTANT)
0021 public:
0022     explicit RemoteDesktopPortal(QObject *parent);
0023     ~RemoteDesktopPortal() override;
0024 
0025     enum DeviceType {
0026         None = 0x0,
0027         Keyboard = 0x1,
0028         Pointer = 0x2,
0029         TouchScreen = 0x4,
0030         All = (Keyboard | Pointer | TouchScreen),
0031     };
0032     Q_DECLARE_FLAGS(DeviceTypes, DeviceType)
0033 
0034     uint version() const
0035     {
0036         return 1;
0037     }
0038     uint AvailableDeviceTypes() const
0039     {
0040         return All;
0041     };
0042 
0043 public Q_SLOTS:
0044     uint CreateSession(const QDBusObjectPath &handle,
0045                        const QDBusObjectPath &session_handle,
0046                        const QString &app_id,
0047                        const QVariantMap &options,
0048                        QVariantMap &results);
0049 
0050     uint SelectDevices(const QDBusObjectPath &handle,
0051                        const QDBusObjectPath &session_handle,
0052                        const QString &app_id,
0053                        const QVariantMap &options,
0054                        QVariantMap &results);
0055 
0056     uint Start(const QDBusObjectPath &handle,
0057                const QDBusObjectPath &session_handle,
0058                const QString &app_id,
0059                const QString &parent_window,
0060                const QVariantMap &options,
0061                QVariantMap &results);
0062 
0063     void NotifyPointerMotion(const QDBusObjectPath &session_handle, const QVariantMap &options, double dx, double dy);
0064 
0065     void NotifyPointerMotionAbsolute(const QDBusObjectPath &session_handle, const QVariantMap &options, uint stream, double x, double y);
0066 
0067     void NotifyPointerButton(const QDBusObjectPath &session_handle, const QVariantMap &options, int button, uint state);
0068 
0069     void NotifyPointerAxis(const QDBusObjectPath &session_handle, const QVariantMap &options, double dx, double dy);
0070 
0071     void NotifyPointerAxisDiscrete(const QDBusObjectPath &session_handle, const QVariantMap &options, uint axis, int steps);
0072 
0073     void NotifyKeyboardKeycode(const QDBusObjectPath &session_handle, const QVariantMap &options, int keycode, uint state);
0074 
0075     void NotifyKeyboardKeysym(const QDBusObjectPath &session_handle, const QVariantMap &options, int keysym, uint state);
0076 
0077     void NotifyTouchDown(const QDBusObjectPath &session_handle, const QVariantMap &options, uint stream, uint slot, int x, int y);
0078 
0079     void NotifyTouchMotion(const QDBusObjectPath &session_handle, const QVariantMap &options, uint stream, uint slot, int x, int y);
0080 
0081     void NotifyTouchUp(const QDBusObjectPath &session_handle, const QVariantMap &options, uint slot);
0082 };
0083 Q_DECLARE_OPERATORS_FOR_FLAGS(RemoteDesktopPortal::DeviceTypes)
0084 
0085 #endif // XDG_DESKTOP_PORTAL_KDE_REMOTEDESKTOP_H