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 ABSTRACTFORMWINDOWMANAGER_H
30#define ABSTRACTFORMWINDOWMANAGER_H
31
32#include <QtDesigner/sdk_global.h>
33#include <QtDesigner/abstractformwindow.h>
34
35#include <QtCore/qobject.h>
36#include <QtCore/qscopedpointer.h>
37
38QT_BEGIN_NAMESPACE
39
40class QDesignerFormEditorInterface;
41class QDesignerDnDItemInterface;
42
43class QWidget;
44class QPixmap;
45class QAction;
46class QActionGroup;
47
48class QDESIGNER_SDK_EXPORT QDesignerFormWindowManagerInterface: public QObject
49{
50 Q_OBJECT
51public:
52 explicit QDesignerFormWindowManagerInterface(QObject *parent = nullptr);
53 virtual ~QDesignerFormWindowManagerInterface();
54
55 enum Action
56 {
57 CutAction = 100,
58 CopyAction,
59 PasteAction,
60 DeleteAction,
61 SelectAllAction,
62
63 LowerAction = 200,
64 RaiseAction,
65
66 UndoAction = 300,
67 RedoAction,
68
69 HorizontalLayoutAction = 400,
70 VerticalLayoutAction,
71 SplitHorizontalAction,
72 SplitVerticalAction,
73 GridLayoutAction,
74 FormLayoutAction,
75 BreakLayoutAction,
76 AdjustSizeAction,
77 SimplifyLayoutAction,
78
79 DefaultPreviewAction = 500,
80
81 FormWindowSettingsDialogAction = 600
82 };
83
84 enum ActionGroup
85 {
86 StyledPreviewActionGroup = 100
87 };
88
89 virtual QAction *action(Action action) const = 0;
90 virtual QActionGroup *actionGroup(ActionGroup actionGroup) const = 0;
91
92 QAction *actionCut() const;
93 QAction *actionCopy() const;
94 QAction *actionPaste() const;
95 QAction *actionDelete() const;
96 QAction *actionSelectAll() const;
97 QAction *actionLower() const;
98 QAction *actionRaise() const;
99 QAction *actionUndo() const;
100 QAction *actionRedo() const;
101
102 QAction *actionHorizontalLayout() const;
103 QAction *actionVerticalLayout() const;
104 QAction *actionSplitHorizontal() const;
105 QAction *actionSplitVertical() const;
106 QAction *actionGridLayout() const;
107 QAction *actionFormLayout() const;
108 QAction *actionBreakLayout() const;
109 QAction *actionAdjustSize() const;
110 QAction *actionSimplifyLayout() const;
111
112 virtual QDesignerFormWindowInterface *activeFormWindow() const = 0;
113
114 virtual int formWindowCount() const = 0;
115 virtual QDesignerFormWindowInterface *formWindow(int index) const = 0;
116
117 virtual QDesignerFormWindowInterface *createFormWindow(QWidget *parentWidget = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()) = 0;
118
119 virtual QDesignerFormEditorInterface *core() const = 0;
120
121 virtual void dragItems(const QList<QDesignerDnDItemInterface*> &item_list) = 0;
122
123 virtual QPixmap createPreviewPixmap() const = 0;
124
125Q_SIGNALS:
126 void formWindowAdded(QDesignerFormWindowInterface *formWindow);
127 void formWindowRemoved(QDesignerFormWindowInterface *formWindow);
128 void activeFormWindowChanged(QDesignerFormWindowInterface *formWindow);
129 void formWindowSettingsChanged(QDesignerFormWindowInterface *fw);
130
131public Q_SLOTS:
132 virtual void addFormWindow(QDesignerFormWindowInterface *formWindow) = 0;
133 virtual void removeFormWindow(QDesignerFormWindowInterface *formWindow) = 0;
134 virtual void setActiveFormWindow(QDesignerFormWindowInterface *formWindow) = 0;
135 virtual void showPreview() = 0;
136 virtual void closeAllPreviews() = 0;
137 virtual void showPluginDialog() = 0;
138
139private:
140 QScopedPointer<int> d;
141};
142
143QT_END_NAMESPACE
144
145#endif // ABSTRACTFORMWINDOWMANAGER_H
146