1
/**********************************************************************
2
** Copyright (C) 2000 Trolltech AS. All rights reserved.
4
** This file is part of Qt Designer.
6
** This file may be distributed and/or modified under the terms of the
7
** GNU General Public License version 2 as published by the Free Software
8
** Foundation and appearing in the file LICENSE.GPL included in the
9
** packaging of this file.
11
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
12
** licenses may use this file in accordance with the Qt Commercial License
13
** Agreement provided with the Software.
15
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18
** See http://www.trolltech.com/gpl/ for GPL licensing information.
19
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
20
** information about Qt Commercial License Agreements.
22
** Contact info@trolltech.com if any conditions of this licensing are
25
**********************************************************************/
27
#ifndef METADATABASE_H
28
#define METADATABASE_H
32
#include <qstringlist.h>
35
#include <qsizepolicy.h>
37
#include <qwidgetlist.h>
40
#include "pixmapchooser.h"
41
#include "../interfaces/languageinterface.h"
45
struct LanguageInterface;
52
QObject *sender, *receiver;
53
QCString signal, slot;
54
bool operator==( const Connection &c ) const {
55
return sender == c.sender && receiver == c.receiver &&
56
signal == c.signal && slot == c.slot ;
68
bool operator==( const Function &f ) const {
69
return ( returnType == f.returnType &&
70
function == f.function &&
71
specifier == f.specifier &&
74
language == f.language
83
bool operator==( const Property &p ) const {
84
return property == p.property &&
92
CustomWidget( const CustomWidget &w );
93
~CustomWidget() { delete pixmap; } // inlined to work around 2.7.2.3 bug
94
bool operator==( const CustomWidget &w ) const;
95
CustomWidget &operator=( const CustomWidget &w );
97
bool hasSignal( const QCString &signal ) const;
98
bool hasSlot( const QCString &slot ) const;
99
bool hasProperty( const QCString &prop ) const;
101
enum IncludePolicy { Global, Local };
104
IncludePolicy includePolicy;
106
QSizePolicy sizePolicy;
108
QValueList<QCString> lstSignals;
109
QValueList<Function> lstSlots;
110
QValueList<Property> lstProperties;
117
Include() : header(), location(), implDecl( "in implementation" ) {}
120
bool operator==( const Include &i ) const {
121
return header == i.header && location == i.location;
130
bool operator==( const Variable &v ) const {
131
return varName == v.varName &&
132
varAccess == v.varAccess;
138
MetaInfo() : classNameChanged( FALSE ) { }
140
bool classNameChanged;
146
static void clearDataBase();
148
static void addEntry( QObject *o );
149
static void removeEntry( QObject *o );
150
static void setPropertyChanged( QObject *o, const QString &property, bool changed );
151
static bool isPropertyChanged( QObject *o, const QString &property );
152
static void setPropertyComment( QObject *o, const QString &property, const QString &comment );
153
static QString propertyComment( QObject *o, const QString &property );
154
static QStringList changedProperties( QObject *o );
156
static void setFakeProperty( QObject *o, const QString &property, const QVariant& value );
157
static QVariant fakeProperty( QObject * o, const QString &property );
158
static QMap<QString,QVariant>* fakeProperties( QObject* o );
160
static void setSpacing( QObject *o, int spacing );
161
static int spacing( QObject *o );
162
static void setMargin( QObject *o, int margin );
163
static int margin( QObject *o );
165
static void setResizeMode( QObject *o, const QString &mode );
166
static QString resizeMode( QObject *o );
168
static void addConnection( QObject *o, QObject *sender, const QCString &signal,
169
QObject *receiver, const QCString &slot, bool addCode = TRUE );
170
static void removeConnection( QObject *o, QObject *sender, const QCString &signal,
171
QObject *receiver, const QCString &slot );
172
static bool hasConnection( QObject *o, QObject *sender, const QCString &signal,
173
QObject *receiver, const QCString &slot );
174
static void setupConnections( QObject *o, const QValueList<LanguageInterface::Connection> &conns );
175
static QValueList<Connection> connections( QObject *o );
176
static QValueList<Connection> connections( QObject *o, QObject *sender, QObject *receiver );
177
static QValueList<Connection> connections( QObject *o, QObject *object );
178
static void doConnections( QObject *o );
180
static void addFunction( QObject *o, const QCString &function, const QString &specifier,
181
const QString &access, const QString &type, const QString &language,
182
const QString &returnType );
183
static void removeFunction( QObject *o, const QCString &function, const QString &specifier,
184
const QString &access, const QString &type, const QString &language,
185
const QString &returnType );
186
static void removeFunction( QObject *o, const QString &function );
187
static QValueList<Function> functionList( QObject *o, bool onlyFunctions = FALSE );
188
static QValueList<Function> slotList( QObject *o );
189
static bool isSlotUsed( QObject *o, const QCString &slot );
190
static bool hasFunction( QObject *o, const QCString &function, bool onlyCustom = FALSE );
191
static bool hasSlot( QObject *o, const QCString &slot, bool onlyCustom = FALSE );
192
static void changeFunction( QObject *o, const QString &function, const QString &newName,
193
const QString &returnType );
194
static void changeFunctionAttributes( QObject *o, const QString &oldName, const QString &newName,
195
const QString &specifier, const QString &access,
196
const QString &type, const QString &language,
197
const QString &returnType );
198
static QString languageOfFunction( QObject *o, const QCString &function );
199
static void setFunctionList( QObject *o, const QValueList<Function> &functionList );
202
static bool addCustomWidget( CustomWidget *w );
203
static void removeCustomWidget( CustomWidget *w );
204
static QPtrList<CustomWidget> *customWidgets();
205
static CustomWidget *customWidget( int id );
206
static bool isWidgetNameUsed( CustomWidget *w );
207
static bool hasCustomWidget( const QString &className );
209
static void setTabOrder( QWidget *w, const QWidgetList &order );
210
static QWidgetList tabOrder( QWidget *w );
212
static void setIncludes( QObject *o, const QValueList<Include> &incs );
213
static QValueList<Include> includes( QObject *o );
215
static void setForwards( QObject *o, const QStringList &fwds );
216
static QStringList forwards( QObject *o );
218
static void setVariables( QObject *o, const QValueList<Variable> &vars );
219
static void addVariable( QObject *o, const QString &name, const QString &access );
220
static void removeVariable( QObject *o, const QString &name );
221
static QValueList<Variable> variables( QObject *o );
222
static bool hasVariable( QObject *o, const QString &name );
223
static QString extractVariableName( const QString &name );
225
static void setSignalList( QObject *o, const QStringList &sigs );
226
static QStringList signalList( QObject *o );
228
static void setMetaInfo( QObject *o, MetaInfo mi );
229
static MetaInfo metaInfo( QObject *o );
231
static void setCursor( QWidget *w, const QCursor &c );
232
static QCursor cursor( QWidget *w );
234
static void setPixmapArgument( QObject *o, int pixmap, const QString &arg );
235
static QString pixmapArgument( QObject *o, int pixmap );
236
static void clearPixmapArguments( QObject *o );
238
static void setPixmapKey( QObject *o, int pixmap, const QString &arg );
239
static QString pixmapKey( QObject *o, int pixmap );
240
static void clearPixmapKeys( QObject *o );
242
static void setColumnFields( QObject *o, const QMap<QString, QString> &columnFields );
243
static QMap<QString, QString> columnFields( QObject *o );
245
static void setEditor( const QStringList &langs );
246
static bool hasEditor( const QString &lang );
248
static void setupInterfaceManagers( const QString &plugDir );
249
static QStringList languages();
251
static LanguageInterface *languageInterface( const QString &lang );
253
static QString normalizeFunction( const QString &f );
255
static void clear( QObject *o );
257
static void setBreakPoints( QObject *o, const QValueList<uint> &l );
258
static void setBreakPointCondition( QObject *o, int line, const QString &condition );
259
static QValueList<uint> breakPoints( QObject *o );
260
static QString breakPointCondition( QObject *o, int line );
262
static void setExportMacro( QObject *o, const QString ¯o );
263
static QString exportMacro( QObject *o );
265
static bool hasObject( QObject *o );