tools/designer/src/lib/sdk/abstractformwindow.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the Qt Designer of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ****************************************************************************/
00023 
00024 #ifndef ABSTRACTFORMWINDOW_H
00025 #define ABSTRACTFORMWINDOW_H
00026 
00027 #include <QtDesigner/sdk_global.h>
00028 
00029 #include <QtGui/QWidget>
00030 
00031 QT_BEGIN_HEADER
00032 
00033 class QDesignerFormEditorInterface;
00034 class QDesignerFormWindowCursorInterface;
00035 class QDesignerFormWindowToolInterface;
00036 class DomUI;
00037 class QUndoStack;
00038 class QDir;
00039 
00040 class QDESIGNER_SDK_EXPORT QDesignerFormWindowInterface: public QWidget
00041 {
00042     Q_OBJECT
00043 public:
00044     enum FeatureFlag
00045     {
00046         EditFeature = 0x01,
00047         GridFeature = 0x02,
00048         TabOrderFeature = 0x04,
00049         DefaultFeature = EditFeature | GridFeature
00050     };
00051     Q_DECLARE_FLAGS(Feature, FeatureFlag)
00052 
00053 public:
00054     QDesignerFormWindowInterface(QWidget *parent = 0, Qt::WindowFlags flags = 0);
00055     virtual ~QDesignerFormWindowInterface();
00056 
00057     virtual QString fileName() const = 0;
00058     virtual QDir absoluteDir() const = 0;
00059 
00060     virtual QString contents() const = 0;
00061     virtual void setContents(QIODevice *dev) = 0;
00062 
00063     virtual Feature features() const = 0;
00064     virtual bool hasFeature(Feature f) const = 0;
00065 
00066     virtual QString author() const = 0;
00067     virtual void setAuthor(const QString &author) = 0;
00068 
00069     virtual QString comment() const = 0;
00070     virtual void setComment(const QString &comment) = 0;
00071 
00072     virtual void layoutDefault(int *margin, int *spacing) = 0;
00073     virtual void setLayoutDefault(int margin, int spacing) = 0;
00074 
00075     virtual void layoutFunction(QString *margin, QString *spacing) = 0;
00076     virtual void setLayoutFunction(const QString &margin, const QString &spacing) = 0;
00077 
00078     virtual QString pixmapFunction() const = 0;
00079     virtual void setPixmapFunction(const QString &pixmapFunction) = 0;
00080 
00081     virtual QString exportMacro() const = 0;
00082     virtual void setExportMacro(const QString &exportMacro) = 0;
00083 
00084     virtual QStringList includeHints() const = 0;
00085     virtual void setIncludeHints(const QStringList &includeHints) = 0;
00086 
00087     virtual QDesignerFormEditorInterface *core() const;
00088     virtual QDesignerFormWindowCursorInterface *cursor() const = 0;
00089 
00090     virtual int toolCount() const = 0;
00091 
00092     virtual int currentTool() const = 0;
00093     virtual void setCurrentTool(int index) = 0;
00094 
00095     virtual QDesignerFormWindowToolInterface *tool(int index) const = 0;
00096     virtual void registerTool(QDesignerFormWindowToolInterface *tool) = 0;
00097 
00098     virtual QPoint grid() const = 0;
00099 
00100     virtual QWidget *mainContainer() const = 0;
00101     virtual void setMainContainer(QWidget *mainContainer) = 0;
00102 
00103     virtual bool isManaged(QWidget *widget) const = 0;
00104 
00105     virtual bool isDirty() const = 0;
00106 
00107     static QDesignerFormWindowInterface *findFormWindow(QWidget *w);
00108 
00109     virtual QUndoStack *commandHistory() const = 0;
00110     virtual void beginCommand(const QString &description) = 0;
00111     virtual void endCommand() = 0;
00112 
00113     virtual void simplifySelection(QList<QWidget*> *widgets) const = 0;
00114 
00115     // notifications
00116     virtual void emitSelectionChanged() = 0;
00117 
00118     virtual QStringList resourceFiles() const = 0;
00119     virtual void addResourceFile(const QString &path) = 0;
00120     virtual void removeResourceFile(const QString &path) = 0;
00121 
00122     virtual void ensureUniqueObjectName(QObject *object) = 0;
00123 
00124 public Q_SLOTS:
00125     virtual void manageWidget(QWidget *widget) = 0;
00126     virtual void unmanageWidget(QWidget *widget) = 0;
00127 
00128     virtual void setFeatures(Feature f) = 0;
00129     virtual void setDirty(bool dirty) = 0;
00130     virtual void clearSelection(bool changePropertyDisplay = true) = 0;
00131     virtual void selectWidget(QWidget *w, bool select = true) = 0;
00132     virtual void setGrid(const QPoint &grid) = 0;
00133     virtual void setFileName(const QString &fileName) = 0;
00134     virtual void setContents(const QString &contents) = 0;
00135 
00136     virtual void editWidgets() = 0;
00137 
00138 Q_SIGNALS:
00139     void mainContainerChanged(QWidget *mainContainer);
00140     void toolChanged(int toolIndex);
00141     void fileNameChanged(const QString &fileName);
00142     void featureChanged(Feature f);
00143     void selectionChanged();
00144     void geometryChanged();
00145 
00146     void resourceFilesChanged();
00147 
00148     void widgetManaged(QWidget *widget);
00149     void widgetUnmanaged(QWidget *widget);
00150     void aboutToUnmanageWidget(QWidget *widget);
00151     void activated(QWidget *widget);
00152 
00153     void changed();
00154     void widgetRemoved(QWidget *w);
00155 };
00156 
00157 QT_END_HEADER
00158 
00159 #endif // ABSTRACTFORMWINDOW_H

Generated on Thu Mar 15 12:01:23 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1