Libplasma

edgeeventforwarder.h
1/*
2 SPDX-FileCopyrightText: 2023 David Edmundson <davidedmundson@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#pragma once
7
8#include <QMargins>
9#include <QObject>
10#include <memory>
11
12#include <plasmaquick/plasmaquick_export.h>
13
14class QWindow;
15
16class EdgeEventForwarderPrivate;
17
18namespace PlasmaQuick
19{
20
21/**
22 * @brief The EdgeEventForwarder class
23 * This class forwards edge events to be replayed within the given margin
24 * This is useful if children do not touch the edge of a window, but want to get input events
25 */
26class PLASMAQUICK_EXPORT EdgeEventForwarder : public QObject
27{
28 Q_OBJECT
29public:
30 /**
31 * @brief EdgeEventForwarder constructor
32 * @param window The window to intercept and filter
33 * The event forwarder is parented to the window
34 */
37
38 /**
39 * @brief setMargins sets the margins to use for the event forwarding
40 */
41 void setMargins(const QMargins &margins);
42 QMargins margins();
43
44 /**
45 * @brief setActiveEdges sets which margins should be active for edge forwarding
46 * typically this should match edges touching a screen edge
47 */
48 void setActiveEdges(Qt::Edges edges);
49 Qt::Edges activeEdges();
50
51 bool eventFilter(QObject *watched, QEvent *event) override;
52
53private:
54 std::unique_ptr<EdgeEventForwarderPrivate> d;
55};
56
57}
The EdgeEventForwarder class This class forwards edge events to be replayed within the given margin T...
The EdgeEventForwarder class This class forwards edge events to be replayed within the given margin T...
Definition action.h:20
typedef Edges
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:52:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.