1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Designer of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29#ifndef ABSTRACTFORMWINDOWCURSOR_H
30#define ABSTRACTFORMWINDOWCURSOR_H
31
32#include <QtDesigner/sdk_global.h>
33
34QT_BEGIN_NAMESPACE
35
36class QDesignerFormWindowInterface;
37class QWidget;
38class QVariant;
39class QString;
40
41class QDESIGNER_SDK_EXPORT QDesignerFormWindowCursorInterface
42{
43public:
44 enum MoveOperation
45 {
46 NoMove,
47
48 Start,
49 End,
50 Next,
51 Prev,
52 Left,
53 Right,
54 Up,
55 Down
56 };
57
58 enum MoveMode
59 {
60 MoveAnchor,
61 KeepAnchor
62 };
63
64public:
65 virtual ~QDesignerFormWindowCursorInterface() {}
66
67 virtual QDesignerFormWindowInterface *formWindow() const = 0;
68
69 virtual bool movePosition(MoveOperation op, MoveMode mode = MoveAnchor) = 0;
70
71 virtual int position() const = 0;
72 virtual void setPosition(int pos, MoveMode mode = MoveAnchor) = 0;
73
74 virtual QWidget *current() const = 0;
75
76 virtual int widgetCount() const = 0;
77 virtual QWidget *widget(int index) const = 0;
78
79 virtual bool hasSelection() const = 0;
80 virtual int selectedWidgetCount() const = 0;
81 virtual QWidget *selectedWidget(int index) const = 0;
82
83 virtual void setProperty(const QString &name, const QVariant &value) = 0;
84 virtual void setWidgetProperty(QWidget *widget, const QString &name, const QVariant &value) = 0;
85 virtual void resetWidgetProperty(QWidget *widget, const QString &name) = 0;
86
87 bool isWidgetSelected(QWidget *widget) const;
88};
89
90QT_END_NAMESPACE
91
92#endif // ABSTRACTFORMWINDOWCURSOR_H
93