File indexing completed on 2024-05-19 16:35:32
0001 /* 0002 SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #pragma once 0008 0009 #include "kwin_export.h" 0010 0011 #include <QObject> 0012 #include <QVector> 0013 #include <functional> 0014 #include <memory> 0015 #include <optional> 0016 0017 struct wl_resource; 0018 0019 namespace KWaylandServer 0020 { 0021 class Display; 0022 class SurfaceInterface; 0023 class SeatInterface; 0024 class ClientConnection; 0025 0026 class XdgActivationV1InterfacePrivate; 0027 0028 class KWIN_EXPORT XdgActivationV1Interface : public QObject 0029 { 0030 Q_OBJECT 0031 Q_DISABLE_COPY(XdgActivationV1Interface) 0032 public: 0033 explicit XdgActivationV1Interface(Display *display, QObject *parent = nullptr); 0034 ~XdgActivationV1Interface() override; 0035 0036 using CreatorFunction = std::function<QString(ClientConnection *client, SurfaceInterface *surface, uint serial, SeatInterface *seat, const QString &appId)>; 0037 0038 /// Provide the @p creator function that will be used to create a token given its parameters 0039 void setActivationTokenCreator(const CreatorFunction &creator); 0040 0041 Q_SIGNALS: 0042 /// Notifies about the @p surface being activated using @p token. 0043 void activateRequested(SurfaceInterface *surface, const QString &token); 0044 0045 private: 0046 friend class XdgActivationV1InterfacePrivate; 0047 XdgActivationV1Interface(XdgActivationV1Interface *parent); 0048 std::unique_ptr<XdgActivationV1InterfacePrivate> d; 0049 }; 0050 0051 }