File indexing completed on 2025-01-05 03:59:45

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2013-09-13
0007  * Description : rubber item for Canvas
0008  *
0009  * SPDX-FileCopyrightText: 2013-2014 by Yiou Wang <geow812 at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_RUBBER_ITEM_H
0016 #define DIGIKAM_RUBBER_ITEM_H
0017 
0018 // Qt includes
0019 
0020 #include <QFlags>
0021 
0022 // Local includes
0023 
0024 #include "canvas.h"
0025 #include "imagepreviewitem.h"
0026 #include "regionframeitem.h"
0027 #include "digikam_export.h"
0028 
0029 class QWidget;
0030 
0031 namespace Digikam
0032 {
0033 
0034 class DIGIKAM_EXPORT RubberItem : public RegionFrameItem
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039 
0040     explicit RubberItem(ImagePreviewItem* const item);
0041     ~RubberItem() override;
0042 
0043     void setCanvas(Canvas* const canvas);
0044 
0045 protected:
0046 
0047     void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
0048     void mouseMoveEvent(QGraphicsSceneMouseEvent* event)    override;
0049 
0050 private:
0051 
0052     class Private;
0053     Private* const d;
0054 };
0055 
0056 } // namespace Digikam
0057 
0058 #endif // DIGIKAM_RUBBER_ITEM_H