1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef ABSTRACTFORMWINDOWCURSOR_H
5#define ABSTRACTFORMWINDOWCURSOR_H
6
7#include <QtDesigner/sdk_global.h>
8
9QT_BEGIN_NAMESPACE
10
11class QDesignerFormWindowInterface;
12class QWidget;
13class QVariant;
14class QString;
15
16class QDESIGNER_SDK_EXPORT QDesignerFormWindowCursorInterface
17{
18public:
19 Q_DISABLE_COPY_MOVE(QDesignerFormWindowCursorInterface)
20
21 enum MoveOperation
22 {
23 NoMove,
24
25 Start,
26 End,
27 Next,
28 Prev,
29 Left,
30 Right,
31 Up,
32 Down
33 };
34
35 enum MoveMode
36 {
37 MoveAnchor,
38 KeepAnchor
39 };
40
41 QDesignerFormWindowCursorInterface() = default;
42 virtual ~QDesignerFormWindowCursorInterface() = default;
43
44 virtual QDesignerFormWindowInterface *formWindow() const = 0;
45
46 virtual bool movePosition(MoveOperation op, MoveMode mode = MoveAnchor) = 0;
47
48 virtual int position() const = 0;
49 virtual void setPosition(int pos, MoveMode mode = MoveAnchor) = 0;
50
51 virtual QWidget *current() const = 0;
52
53 virtual int widgetCount() const = 0;
54 virtual QWidget *widget(int index) const = 0;
55
56 virtual bool hasSelection() const = 0;
57 virtual int selectedWidgetCount() const = 0;
58 virtual QWidget *selectedWidget(int index) const = 0;
59
60 virtual void setProperty(const QString &name, const QVariant &value) = 0;
61 virtual void setWidgetProperty(QWidget *widget, const QString &name, const QVariant &value) = 0;
62 virtual void resetWidgetProperty(QWidget *widget, const QString &name) = 0;
63
64 bool isWidgetSelected(QWidget *widget) const;
65};
66
67QT_END_NAMESPACE
68
69#endif // ABSTRACTFORMWINDOWCURSOR_H
70

source code of qttools/src/designer/src/lib/sdk/abstractformwindowcursor.h