File indexing completed on 2024-10-13 13:11:34

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-only
0003     SPDX-FileCopyrightText: 2003 Mike Pilone <mpilone@slac.com>
0004     SPDX-FileCopyrightText: 2003 Lubos Lunak <l.lunak@kde.org>
0005     SPDX-FileCopyrightText: 2009 Michael Jansen <kde@michael-jansen.biz>
0006  */
0007 
0008 #ifndef GESTURE_DRAWER_H
0009 #define GESTURE_DRAWER_H
0010 
0011 #include "triggers/gestures.h"
0012 
0013 #include <QFrame>
0014 
0015 #include <QEvent>
0016 #include <QPoint>
0017 #include <QSize>
0018 #include <QWidget>
0019 
0020 /**
0021  * This widget provides the service of drawing the processed point data of the
0022  * gesture.
0023  */
0024 
0025 class GestureDrawer : public QFrame
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     GestureDrawer(QWidget *parent, const char *name = nullptr);
0031     ~GestureDrawer() override;
0032 
0033     void setPointData(const KHotKeys::StrokePoints &data);
0034     KHotKeys::StrokePoints pointData() const;
0035 
0036     QSize sizeHint() const override
0037     {
0038         return QSize(30, 30);
0039     }
0040 
0041 protected:
0042     void paintEvent(QPaintEvent *ev) override;
0043 
0044 private:
0045     KHotKeys::StrokePoints _data;
0046 };
0047 
0048 #endif