~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to tools/designer/src/lib/sdk/abstractformeditor.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
**
 
5
** This file is part of the designer application of the Qt Toolkit.
 
6
**
 
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.
 
10
**
 
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.
 
15
**
 
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.
 
20
**
 
21
** Contact info@trolltech.com if any conditions of this licensing are
 
22
** not clear to you.
 
23
**
 
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.
 
26
**
 
27
****************************************************************************/
 
28
 
 
29
#include "abstractformeditor.h"
 
30
 
 
31
#include <QtDesigner/abstractformwindow.h>
 
32
#include <QtDesigner/abstractformwindowmanager.h>
 
33
#include <QtDesigner/abstractimagecollection.h>
 
34
#include <QtDesigner/abstractmetadatabase.h>
 
35
#include <QtDesigner/abstractwidgetbox.h>
 
36
#include <QtDesigner/abstractwidgetfactory.h>
 
37
#include <QtDesigner/abstractpropertyeditor.h>
 
38
#include <QtDesigner/abstractwidgetdatabase.h>
 
39
#include <QtDesigner/abstractobjectinspector.h>
 
40
#include <QtDesigner/qextensionmanager.h>
 
41
#include <QtDesigner/abstracticoncache.h>
 
42
 
 
43
class PluginManager;
 
44
 
 
45
/*!
 
46
    \class QDesignerFormEditorInterface
 
47
    \brief The QDesignerFormEditorInterface class provides an interface that is used to
 
48
    control \QD's form editor component.
 
49
    \inmodule QtDesigner
 
50
*/
 
51
 
 
52
/*!
 
53
    Constructs a form editor interface with the given \a parent.*/
 
54
QDesignerFormEditorInterface::QDesignerFormEditorInterface(QObject *parent)
 
55
    : QObject(parent),
 
56
      m_topLevel(0),
 
57
      m_widgetBox(0),
 
58
      m_propertyEditor(0),
 
59
      m_formWindowManager(0),
 
60
      m_extensionManager(0),
 
61
      m_metaDataBase(0),
 
62
      m_widgetDataBase(0),
 
63
      m_widgetFactory(0),
 
64
      m_objectInspector(0)
 
65
{
 
66
}
 
67
 
 
68
/*!
 
69
    Destroys the interface to the form editor.*/
 
70
QDesignerFormEditorInterface::~QDesignerFormEditorInterface()
 
71
{
 
72
}
 
73
 
 
74
/*!
 
75
    Returns an interface to \QD's widget box.*/
 
76
QDesignerWidgetBoxInterface *QDesignerFormEditorInterface::widgetBox() const
 
77
{ return m_widgetBox; }
 
78
 
 
79
/*!
 
80
    Sets the widget box used by the form editor to the specified \a widgetBox.*/
 
81
void QDesignerFormEditorInterface::setWidgetBox(QDesignerWidgetBoxInterface *widgetBox)
 
82
{ m_widgetBox = widgetBox; }
 
83
 
 
84
/*!
 
85
    Returns an interface to the property editor used by the form editor.*/
 
86
QDesignerPropertyEditorInterface *QDesignerFormEditorInterface::propertyEditor() const
 
87
{ return m_propertyEditor; }
 
88
 
 
89
/*!
 
90
Sets the property editor used by the form editor to the specified \a propertyEditor.*/
 
91
void QDesignerFormEditorInterface::setPropertyEditor(QDesignerPropertyEditorInterface *propertyEditor)
 
92
{ m_propertyEditor = propertyEditor; }
 
93
 
 
94
/*!
 
95
    Returns the top-level widget used by the form editor.*/
 
96
QWidget *QDesignerFormEditorInterface::topLevel() const
 
97
{ return m_topLevel; }
 
98
 
 
99
/*!
 
100
    \internal
 
101
*/
 
102
void QDesignerFormEditorInterface::setTopLevel(QWidget *topLevel)
 
103
{ m_topLevel = topLevel; }
 
104
 
 
105
/*!
 
106
    Returns the interface used to control the form window manager.*/
 
107
QDesignerFormWindowManagerInterface *QDesignerFormEditorInterface::formWindowManager() const
 
108
{ return m_formWindowManager; }
 
109
 
 
110
/*!
 
111
    \internal
 
112
*/
 
113
void QDesignerFormEditorInterface::setFormManager(QDesignerFormWindowManagerInterface *formWindowManager)
 
114
{ m_formWindowManager = formWindowManager; }
 
115
 
 
116
/*!
 
117
    Returns the extension manager used by the form editor.*/
 
118
QExtensionManager *QDesignerFormEditorInterface::extensionManager() const
 
119
{ return m_extensionManager; }
 
120
 
 
121
/*!
 
122
    \internal
 
123
*/
 
124
void QDesignerFormEditorInterface::setExtensionManager(QExtensionManager *extensionManager)
 
125
{ m_extensionManager = extensionManager; }
 
126
 
 
127
/*!
 
128
    Returns an interface to the meta database used by the form editor.*/
 
129
QDesignerMetaDataBaseInterface *QDesignerFormEditorInterface::metaDataBase() const
 
130
{ return m_metaDataBase; }
 
131
 
 
132
/*!
 
133
    \internal
 
134
*/
 
135
void QDesignerFormEditorInterface::setMetaDataBase(QDesignerMetaDataBaseInterface *metaDataBase)
 
136
{ m_metaDataBase = metaDataBase; }
 
137
 
 
138
/*!
 
139
    Returns an interface to the widget database used by the form editor.*/
 
140
QDesignerWidgetDataBaseInterface *QDesignerFormEditorInterface::widgetDataBase() const
 
141
{ return m_widgetDataBase; }
 
142
 
 
143
/*!
 
144
    \internal
 
145
*/
 
146
void QDesignerFormEditorInterface::setWidgetDataBase(QDesignerWidgetDataBaseInterface *widgetDataBase)
 
147
{ m_widgetDataBase = widgetDataBase; }
 
148
 
 
149
/*!
 
150
    Returns an interface to the widget factory used by the form editor to create widgets
 
151
    for the form.*/
 
152
QDesignerWidgetFactoryInterface *QDesignerFormEditorInterface::widgetFactory() const
 
153
{ return m_widgetFactory; }
 
154
 
 
155
/*!
 
156
    \internal
 
157
*/
 
158
void QDesignerFormEditorInterface::setWidgetFactory(QDesignerWidgetFactoryInterface *widgetFactory)
 
159
{ m_widgetFactory = widgetFactory; }
 
160
 
 
161
/*!
 
162
    Returns an interface to the object inspector used by the form editor.*/
 
163
QDesignerObjectInspectorInterface *QDesignerFormEditorInterface::objectInspector() const
 
164
{ return m_objectInspector; }
 
165
 
 
166
/*!
 
167
    Sets the object inspector used by the form editor to the specified \a objectInspector.*/
 
168
void QDesignerFormEditorInterface::setObjectInspector(QDesignerObjectInspectorInterface *objectInspector)
 
169
{ m_objectInspector = objectInspector; }
 
170
 
 
171
/*!
 
172
    Returns an interface to the icon cache used by the form editor to manage icons.*/
 
173
QDesignerIconCacheInterface *QDesignerFormEditorInterface::iconCache() const
 
174
{ return m_iconCache; }
 
175
 
 
176
/*!
 
177
    \internal
 
178
*/
 
179
void QDesignerFormEditorInterface::setIconCache(QDesignerIconCacheInterface *cache)
 
180
{ m_iconCache = cache; }
 
181
 
 
182
/*!
 
183
    Returns the plugin manager used by the form editor.*/
 
184
PluginManager *QDesignerFormEditorInterface::pluginManager() const
 
185
{ return m_pluginManager; }
 
186
 
 
187
/*!
 
188
Sets the plugin manager used by the form editor to the specified \a pluginManager.*/
 
189
void QDesignerFormEditorInterface::setPluginManager(PluginManager *pluginManager)
 
190
{ m_pluginManager = pluginManager; }
 
191
 
 
192
/*!
 
193
    Returns the path to the resources used by the form editor.*/
 
194
QString QDesignerFormEditorInterface::resourceLocation() const
 
195
{
 
196
#ifdef Q_WS_MAC
 
197
    return QLatin1String(":/trolltech/formeditor/images/mac");
 
198
#else
 
199
    return QLatin1String(":/trolltech/formeditor/images/win");
 
200
#endif
 
201
}