]> cloud.milkyroute.net Git - dolphin.git/blob - src/kitemviews/private/kitemlistrubberband.h
Output of licensedigger + manual cleanup afterwards.
[dolphin.git] / src / kitemviews / private / kitemlistrubberband.h
1 /*
2 * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #ifndef KITEMLISTRUBBERBAND_H
8 #define KITEMLISTRUBBERBAND_H
9
10 #include "dolphin_export.h"
11
12 #include <QObject>
13 #include <QPointF>
14
15 /**
16 * @brief Manages the rubberband when selecting items.
17 */
18 class DOLPHIN_EXPORT KItemListRubberBand : public QObject
19 {
20 Q_OBJECT
21
22 public:
23 explicit KItemListRubberBand(QObject* parent = nullptr);
24 ~KItemListRubberBand() override;
25
26 void setStartPosition(const QPointF& pos);
27 QPointF startPosition() const;
28
29 void setEndPosition(const QPointF& pos);
30 QPointF endPosition() const;
31
32 void setActive(bool active);
33 bool isActive() const;
34
35 signals:
36 void activationChanged(bool active);
37 void startPositionChanged(const QPointF& current, const QPointF& previous);
38 void endPositionChanged(const QPointF& current, const QPointF& previous);
39
40 private:
41 bool m_active;
42 QPointF m_startPos;
43 QPointF m_endPos;
44 };
45
46 #endif
47
48