File indexing completed on 2024-11-03 03:46:06

0001 /*
0002  * Copyright 1999 by Martin R. Jones <mjones@kde.org>
0003  *
0004  * This program is free software; you can redistribute it and/or modify
0005  * it under the terms of the GNU General Public License as published by
0006  * the Free Software Foundation; either version 2 of the License, or
0007  * (at your option) any later version.
0008  *
0009  * This program is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  * GNU General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU General Public License
0015  * along with this program; if not, write to the Free Software
0016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0017  */
0018 #ifndef AMORWIDGET_H
0019 #define AMORWIDGET_H
0020 
0021 #include <QWidget>
0022 
0023 class QPixmap;
0024 
0025 
0026 class AmorWidget : public QWidget
0027 {
0028     Q_OBJECT
0029 
0030     public:
0031         AmorWidget();
0032 
0033         void setPixmap(const QPixmap *pixmap);
0034 
0035     Q_SIGNALS:
0036         void mouseClicked(const QPoint &pos);
0037         void dragged(const QPoint &delta, bool release);
0038 
0039     protected:
0040         void paintEvent(QPaintEvent *event) override;
0041         void mousePressEvent(QMouseEvent *event) override;
0042         void mouseMoveEvent(QMouseEvent *event) override;
0043         void mouseReleaseEvent(QMouseEvent *event) override;
0044 
0045     protected:
0046         const QPixmap *m_pixmap;
0047         QPoint m_clickPos;
0048         bool m_dragging;
0049 };
0050 
0051 
0052 #endif
0053 
0054 // kate: word-wrap off; encoding utf-8; indent-width 4; tab-width 4; line-numbers on; mixed-indent off; remove-trailing-space-save on; replace-tabs-save on; replace-tabs on; space-indent on;
0055 // vim:set spell et sw=4 ts=4 nowrap cino=l1,cs,U1: