| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** Contact: Qt Software Information ([email protected])
|
|---|
| 5 | **
|
|---|
| 6 | ** This file is part of the Qt Designer of the Qt Toolkit.
|
|---|
| 7 | **
|
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 9 | ** Commercial Usage
|
|---|
| 10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 11 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 13 | ** a written agreement between you and Nokia.
|
|---|
| 14 | **
|
|---|
| 15 | ** GNU Lesser General Public License Usage
|
|---|
| 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 17 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 19 | ** packaging of this file. Please review the following information to
|
|---|
| 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 22 | **
|
|---|
| 23 | ** In addition, as a special exception, Nokia gives you certain
|
|---|
| 24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 26 | ** 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 are unsure which license is appropriate for your use, please
|
|---|
| 37 | ** contact the sales department 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 |
|
|---|
| 49 | QT_BEGIN_HEADER
|
|---|
| 50 |
|
|---|
| 51 | QT_BEGIN_NAMESPACE
|
|---|
| 52 |
|
|---|
| 53 | class QDesignerFormEditorInterface;
|
|---|
| 54 | class QDesignerFormWindowCursorInterface;
|
|---|
| 55 | class QDesignerFormWindowToolInterface;
|
|---|
| 56 | class DomUI;
|
|---|
| 57 | class QUndoStack;
|
|---|
| 58 | class QDir;
|
|---|
| 59 |
|
|---|
| 60 | class QDESIGNER_SDK_EXPORT QDesignerFormWindowInterface: public QWidget
|
|---|
| 61 | {
|
|---|
| 62 | Q_OBJECT
|
|---|
| 63 | public:
|
|---|
| 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 |
|
|---|
| 73 | public:
|
|---|
| 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 |
|
|---|
| 145 | public 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 |
|
|---|
| 159 | Q_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 |
|
|---|
| 179 | QT_END_NAMESPACE
|
|---|
| 180 |
|
|---|
| 181 | QT_END_HEADER
|
|---|
| 182 |
|
|---|
| 183 | #endif // ABSTRACTFORMWINDOW_H
|
|---|