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{
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 */
36 ~EdgeEventForwarder() override;
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}
void setActiveEdges(Qt::Edges edges)
setActiveEdges sets which margins should be active for edge forwarding typically this should match ed...
void setMargins(const QMargins &margins)
setMargins sets the margins to use for the event forwarding
EdgeEventForwarder(QWindow *parent)
EdgeEventForwarder constructor.
The EdgeEventForwarder class This class forwards edge events to be replayed within the given margin T...
Definition action.h:20
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
virtual bool event(QEvent *e)
QObject * parent() const const
typedef Edges
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:48:23 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.