KSane

selectionitem.h
1/*
2 * SPDX-FileCopyrightText: 2008 Kare Sars <kare dot sars at iki dot fi>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6#ifndef SELECTIONITEM_H
7#define SELECTIONITEM_H
8
9#include <QGraphicsPixmapItem>
10#include <QPainter>
11
12namespace KSaneIface
13{
14
15/**
16 * Selection QGraphicsItem for the image viewer.
17 */
19{
20public:
21 typedef enum {
22 None,
23 Top,
24 TopRight,
25 Right,
26 BottomRight,
27 Bottom,
28 BottomLeft,
29 Left,
30 TopLeft,
31 Move,
32 AddRemove
33 } Intersects;
34
35 explicit SelectionItem(const QRectF &rect);
36 ~SelectionItem() override;
37
38 void setMaxRight(qreal maxRight);
39 void setMaxBottom(qreal maxBottom);
40 void setSaved(bool isSaved);
41
42 Intersects intersects(const QPointF &point);
43
44 void saveZoom(qreal zoom);
45
46 void setRect(const QRectF &rect);
47 QPointF fixTranslation( QPointF dp);
48 QRectF rect();
49
50 qreal devicePixelRatio() const;
51 void setDevicePixelRatio(qreal dpr);
52
53 void setAddButtonEnabled(bool enabled);
54
55public:
56 // Graphics Item methods
57 QRectF boundingRect() const override;
58 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
59
60private:
61 struct Private;
62 Private *const d;
63};
64
65} // NameSpace KSaneIface
66
67#endif
68
Selection QGraphicsItem for the image viewer.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 12:00:24 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.