source: trunk/tools/designer/src/lib/sdk/abstractformwindow.h@ 846

Last change on this file since 846 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 6.2 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the Qt Designer of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef ABSTRACTFORMWINDOW_H
43#define ABSTRACTFORMWINDOW_H
44
45#include <QtDesigner/sdk_global.h>
46
47#include <QtGui/QWidget>
48
49QT_BEGIN_HEADER
50
51QT_BEGIN_NAMESPACE
52
53class QDesignerFormEditorInterface;
54class QDesignerFormWindowCursorInterface;
55class QDesignerFormWindowToolInterface;
56class DomUI;
57class QUndoStack;
58class QDir;
59
60class QDESIGNER_SDK_EXPORT QDesignerFormWindowInterface: public QWidget
61{
62 Q_OBJECT
63public:
64 enum FeatureFlag
65 {
66 EditFeature = 0x01,
67 GridFeature = 0x02,
68 TabOrderFeature = 0x04,
69 DefaultFeature = EditFeature | GridFeature
70 };
71 Q_DECLARE_FLAGS(Feature, FeatureFlag)
72
73public:
74 QDesignerFormWindowInterface(QWidget *parent = 0, Qt::WindowFlags flags = 0);
75 virtual ~QDesignerFormWindowInterface();
76
77 virtual QString fileName() const = 0;
78 virtual QDir absoluteDir() const = 0;
79
80 virtual QString contents() const = 0;
81 virtual void setContents(QIODevice *dev) = 0;
82
83 virtual Feature features() const = 0;
84 virtual bool hasFeature(Feature f) const = 0;
85
86 virtual QString author() const = 0;
87 virtual void setAuthor(const QString &author) = 0;
88
89 virtual QString comment() const = 0;
90 virtual void setComment(const QString &comment) = 0;
91
92 virtual void layoutDefault(int *margin, int *spacing) = 0;
93 virtual void setLayoutDefault(int margin, int spacing) = 0;
94
95 virtual void layoutFunction(QString *margin, QString *spacing) = 0;
96 virtual void setLayoutFunction(const QString &margin, const QString &spacing) = 0;
97
98 virtual QString pixmapFunction() const = 0;
99 virtual void setPixmapFunction(const QString &pixmapFunction) = 0;
100
101 virtual QString exportMacro() const = 0;
102 virtual void setExportMacro(const QString &exportMacro) = 0;
103
104 virtual QStringList includeHints() const = 0;
105 virtual void setIncludeHints(const QStringList &includeHints) = 0;
106
107 virtual QDesignerFormEditorInterface *core() const;
108 virtual QDesignerFormWindowCursorInterface *cursor() const = 0;
109
110 virtual int toolCount() const = 0;
111
112 virtual int currentTool() const = 0;
113 virtual void setCurrentTool(int index) = 0;
114
115 virtual QDesignerFormWindowToolInterface *tool(int index) const = 0;
116 virtual void registerTool(QDesignerFormWindowToolInterface *tool) = 0;
117
118 virtual QPoint grid() const = 0;
119
120 virtual QWidget *mainContainer() const = 0;
121 virtual void setMainContainer(QWidget *mainContainer) = 0;
122
123 virtual bool isManaged(QWidget *widget) const = 0;
124
125 virtual bool isDirty() const = 0;
126
127 static QDesignerFormWindowInterface *findFormWindow(QWidget *w);
128 static QDesignerFormWindowInterface *findFormWindow(QObject *obj);
129
130 virtual QUndoStack *commandHistory() const = 0;
131 virtual void beginCommand(const QString &description) = 0;
132 virtual void endCommand() = 0;
133
134 virtual void simplifySelection(QList<QWidget*> *widgets) const = 0;
135
136 // notifications
137 virtual void emitSelectionChanged() = 0;
138
139 virtual QStringList resourceFiles() const = 0;
140 virtual void addResourceFile(const QString &path) = 0;
141 virtual void removeResourceFile(const QString &path) = 0;
142
143 virtual void ensureUniqueObjectName(QObject *object) = 0;
144
145public Q_SLOTS:
146 virtual void manageWidget(QWidget *widget) = 0;
147 virtual void unmanageWidget(QWidget *widget) = 0;
148
149 virtual void setFeatures(Feature f) = 0;
150 virtual void setDirty(bool dirty) = 0;
151 virtual void clearSelection(bool changePropertyDisplay = true) = 0;
152 virtual void selectWidget(QWidget *w, bool select = true) = 0;
153 virtual void setGrid(const QPoint &grid) = 0;
154 virtual void setFileName(const QString &fileName) = 0;
155 virtual void setContents(const QString &contents) = 0;
156
157 virtual void editWidgets() = 0;
158
159Q_SIGNALS:
160 void mainContainerChanged(QWidget *mainContainer);
161 void toolChanged(int toolIndex);
162 void fileNameChanged(const QString &fileName);
163 void featureChanged(Feature f);
164 void selectionChanged();
165 void geometryChanged();
166
167 void resourceFilesChanged();
168
169 void widgetManaged(QWidget *widget);
170 void widgetUnmanaged(QWidget *widget);
171 void aboutToUnmanageWidget(QWidget *widget);
172 void activated(QWidget *widget);
173
174 void changed();
175 void widgetRemoved(QWidget *w);
176 void objectRemoved(QObject *o);
177};
178
179QT_END_NAMESPACE
180
181QT_END_HEADER
182
183#endif // ABSTRACTFORMWINDOW_H
Note: See TracBrowser for help on using the repository browser.