1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the designer application of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
29
#ifndef QDESIGNER_WORKBENCH_H
30
#define QDESIGNER_WORKBENCH_H
32
#include <QtCore/QObject>
33
#include <QtCore/QPointer>
34
#include <QtCore/QHash>
35
#include <QtCore/QList>
36
#include <QtCore/QRect>
39
class QDesignerActions;
40
class QDesignerToolWindow;
41
class QDesignerFormWindow;
42
class QDesignerIntegration;
54
class QDesignerFormEditorInterface;
55
class QDesignerFormWindowInterface;
56
class QDesignerFormWindowManagerInterface;
58
class QDesignerWorkbench: public QObject
71
virtual ~QDesignerWorkbench();
75
QDesignerFormEditorInterface *core() const;
77
QDesignerToolWindow *findToolWindow(QWidget *widget) const;
78
QDesignerFormWindow *findFormWindow(QWidget *widget) const;
80
QDesignerFormWindow *createFormWindow();
82
int toolWindowCount() const;
83
QDesignerToolWindow *toolWindow(int index) const;
85
int formWindowCount() const;
86
QDesignerFormWindow *formWindow(int index) const;
88
QDesignerActions *actionManager() const;
90
QActionGroup *modeActionGroup() const;
92
QRect availableGeometry() const;
93
int marginHint() const;
95
void saveSettings() const;
97
bool readInForm(const QString &fileName) const;
98
bool writeOutForm(QDesignerFormWindowInterface *formWindow, const QString &fileName) const;
99
bool saveForm(QDesignerFormWindowInterface *fw);
101
void closeAllToolWindows();
104
void modeChanged(UIMode mode);
108
void addToolWindow(QDesignerToolWindow *toolWindow);
109
void addFormWindow(QDesignerFormWindow *formWindow);
110
void removeToolWindow(QDesignerToolWindow *toolWindow);
111
void removeFormWindow(QDesignerFormWindow *formWindow);
112
void setUIMode(UIMode mode);
113
void setUseBigIcons(bool superSizeMe);
115
// ### private slots:
116
void switchToNeutralMode();
117
void switchToDockedMode();
118
void switchToTopLevelMode();
120
void initializeCorePlugins();
124
void activateWorkspaceChildWindow(QWidget *widget);
125
void updateWindowMenu(QDesignerFormWindowInterface *fw);
126
void formWindowActionTriggered(QAction *a);
128
void adjustFormPositions();
131
QWidget *magicalParent() const;
132
Qt::WindowFlags magicalWindowFlags(const QWidget *widgetForFlags) const;
133
QDockWidget *magicalDockWidget(QWidget *widget) const;
135
QDesignerFormWindowManagerInterface *formWindowManager() const;
136
void changeBringToFrontVisiblity(bool visible);
137
void changeToolBarIconSize(bool big);
141
QDesignerFormEditorInterface *m_core;
142
QDesignerIntegration *m_integration;
144
QDesignerActions *m_actionManager;
145
QActionGroup *m_toolActions;
146
QActionGroup *m_windowActions;
155
QMenuBar *m_globalMenuBar;
156
QToolBar *m_toolToolBar;
157
QToolBar *m_formToolBar;
158
QToolBar *m_editToolBar;
162
QList<QDesignerToolWindow*> m_toolWindows;
163
QList<QDesignerFormWindow*> m_formWindows;
165
QWorkspace *m_workspace;
166
QHash<QWidget*, bool> m_visibilities;
167
QHash<QWidget*, QRect> m_geometries;
169
class ToolWindowExtra {};
170
class FormWindowExtra {};
172
QHash<QDesignerToolWindow*, ToolWindowExtra> m_toolWindowExtras;
173
QHash<QDesignerFormWindow*, FormWindowExtra> m_formWindowExtras;
177
#endif // QDESIGNER_WORKBENCH_H