File indexing completed on 2025-01-26 05:06:20
0001 /* 0002 SPDX-FileCopyrightText: 2015 Eike Hein <hein@kde.org> 0003 SPDX-FileCopyrightText: 2015 Marco Martin <notmart@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef EventGenerator_H 0009 #define EventGenerator_H 0010 0011 #include <QObject> 0012 0013 class QQuickItem; 0014 0015 class EventGenerator : public QObject 0016 { 0017 Q_OBJECT 0018 0019 public: 0020 enum MouseEvent { 0021 MouseButtonPress, 0022 MouseButtonRelease, 0023 MouseMove, 0024 }; 0025 Q_ENUM(MouseEvent) 0026 0027 EventGenerator(QObject *parent = nullptr); 0028 ~EventGenerator() override; 0029 0030 /** 0031 * Send a mouse event of @type to the given @item 0032 */ 0033 Q_INVOKABLE void 0034 sendMouseEvent(QQuickItem *item, EventGenerator::MouseEvent type, int x, int y, int button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers); 0035 }; 0036 0037 #endif