1 /* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date        : 2013-09-13
7 * Description : rubber item for Canvas
8 *
9 * Copyright (C) 2013-2014 by Yiou Wang <geow812 at gmail dot com>
10 *
11 * This program is free software; you can redistribute it
12 * and/or modify it under the terms of the GNU General
13 * Public License as published by the Free Software Foundation;
14 * either version 2, or (at your option)
15 * any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 * GNU General Public License for more details.
21 *
22 * ============================================================ */
23 
24 #ifndef DIGIKAM_RUBBER_ITEM_H
25 #define DIGIKAM_RUBBER_ITEM_H
26 
27 // Qt includes
28 
29 #include <QFlags>
30 
31 // Local includes
32 
33 #include "canvas.h"
34 #include "imagepreviewitem.h"
35 #include "regionframeitem.h"
36 #include "digikam_export.h"
37 
38 class QWidget;
39 
40 namespace Digikam
41 {
42 
43 class DIGIKAM_EXPORT RubberItem : public RegionFrameItem
44 {
45     Q_OBJECT
46 
47 public:
48 
49     explicit RubberItem(ImagePreviewItem* const item);
50     ~RubberItem() override;
51 
52     void setCanvas(Canvas* const canvas);
53 
54 protected:
55 
56     void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
57     void mouseMoveEvent(QGraphicsSceneMouseEvent* event)    override;
58 
59 private:
60 
61     class Private;
62     Private* const d;
63 };
64 
65 } // namespace Digikam
66 
67 #endif // DIGIKAM_RUBBER_ITEM_H
68