1
/**********************************************************************
2
** Copyright (C) 2000-2001 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 DESIGNERAPPIFACE_H
28
#define DESIGNERAPPIFACE_H
30
#include "../interfaces/designerinterface.h"
39
class DesignerInterfaceImpl : public DesignerInterface
42
DesignerInterfaceImpl( MainWindow *mw );
44
DesignerProject *currentProject() const;
45
DesignerFormWindow *currentForm() const;
46
DesignerSourceFile *currentSourceFile() const;
47
QPtrList<DesignerProject> projectList() const;
48
void showStatusMessage( const QString &, int ms = 0 ) const;
49
DesignerDock *createDock() const;
50
DesignerOutputDock *outputDock() const;
51
void setModified( bool b, QWidget *window );
52
void updateFunctionList();
54
void onProjectChange( QObject *receiver, const char *slot );
55
void onFormChange( QObject *receiver, const char *slot );
57
bool singleProjectMode() const;
58
void showError( QWidget *widget, int line, const QString &message );
60
void showStackFrame( QWidget *w, int line );
61
void showDebugStep( QWidget *w, int line );
62
void runProjectPrecondition();
63
void runProjectPostcondition( QObjectList *l );
66
QRESULT queryInterface( const QUuid &uuid, QUnknownInterface** iface );
70
MainWindow *mainWindow;
74
class DesignerProjectImpl: public DesignerProject
77
DesignerProjectImpl( Project *pr );
79
QPtrList<DesignerFormWindow> formList() const;
80
QStringList formNames() const;
81
QString formFileName( const QString &form ) const;
82
void addForm( DesignerFormWindow * );
83
void removeForm( DesignerFormWindow * );
84
QString fileName() const;
85
void setFileName( const QString & );
86
QString projectName() const;
87
void setProjectName( const QString & );
88
QString databaseFile() const;
89
void setDatabaseFile( const QString & );
90
void setupDatabases() const;
91
QPtrList<DesignerDatabase> databaseConnections() const;
92
void addDatabase( DesignerDatabase * );
93
void removeDatabase( DesignerDatabase * );
95
void setLanguage( const QString & );
96
QString language() const;
97
void setCustomSetting( const QString &key, const QString &value );
98
QString customSetting( const QString &key ) const;
99
DesignerPixmapCollection *pixmapCollection() const;
100
void breakPoints( QMap<QString, QValueList<uint> > &bps ) const;
101
QString breakPointCondition( QObject *o, int line ) const;
102
void setBreakPointCondition( QObject *o, int line, const QString &condition );
103
void clearAllBreakpoints() const;
104
void setIncludePath( const QString &platform, const QString &path );
105
void setLibs( const QString &platform, const QString &path );
106
void setDefines( const QString &platform, const QString &path );
107
void setConfig( const QString &platform, const QString &config );
108
void setTemplate( const QString &t );
109
QString config( const QString &platform ) const;
110
QString libs( const QString &platform ) const;
111
QString defines( const QString &platform ) const;
112
QString includePath( const QString &platform ) const;
113
QString templte() const;
114
bool isGenericObject( QObject *o ) const;
124
class DesignerDatabaseImpl: public DesignerDatabase
127
DesignerDatabaseImpl( DatabaseConnection *d );
129
QString name() const;
130
void setName( const QString & );
131
QString driver() const;
132
void setDriver( const QString & );
133
QString database() const;
134
void setDatabase( const QString & );
135
QString userName() const;
136
void setUserName( const QString & );
137
QString password() const;
138
void setPassword( const QString & );
139
QString hostName() const;
140
void setHostName( const QString & );
141
QStringList tables() const;
142
void setTables( const QStringList & );
143
QMap<QString, QStringList> fields() const;
144
void setFields( const QMap<QString, QStringList> & );
145
void open( bool suppressDialog = TRUE ) const;
147
QSqlDatabase* connection();
149
DatabaseConnection *db;
154
class DesignerPixmapCollectionImpl : public DesignerPixmapCollection
157
DesignerPixmapCollectionImpl( PixmapCollection *coll );
158
void addPixmap( const QPixmap &p, const QString &name, bool force );
159
QPixmap pixmap( const QString &name ) const;
162
PixmapCollection *pixCollection;
166
class DesignerFormWindowImpl: public DesignerFormWindow
169
DesignerFormWindowImpl( FormWindow *fw );
171
QString name() const;
172
void setName( const QString &n );
173
QString fileName() const;
174
void setFileName( const QString & );
176
bool isModified() const;
177
void insertWidget( QWidget * );
178
QWidget *create( const char *className, QWidget *parent, const char *name );
179
void removeWidget( QWidget * );
180
QWidgetList widgets() const;
187
void editConnections();
194
void layoutHContainer( QWidget* w );
195
void layoutVContainer( QWidget* w );
196
void layoutGContainer( QWidget* w );
198
void selectWidget( QWidget * );
200
void clearSelection();
201
bool isWidgetSelected( QWidget * ) const;
202
QWidgetList selectedWidgets() const;
203
QWidget *currentWidget() const;
204
QWidget *form() const;
205
void setCurrentWidget( QWidget * );
206
QPtrList<QAction> actionList() const;
207
QAction *createAction( const QString& text, const QIconSet& icon, const QString& menuText, int accel,
208
QObject* parent, const char* name = 0, bool toggle = FALSE );
209
void addAction( QAction * );
210
void removeAction( QAction * );
211
void preview() const;
212
void addFunction( const QCString &function, const QString& specifier, const QString &access,
213
const QString &type, const QString &language, const QString &returnType );
214
void addConnection( QObject *sender, const char *signal, QObject *receiver, const char *slot );
215
void setProperty( QObject *o, const char *property, const QVariant &value );
216
QVariant property( QObject *o, const char *property ) const;
217
void setPropertyChanged( QObject *o, const char *property, bool changed );
218
bool isPropertyChanged( QObject *o, const char *property ) const;
219
void setColumnFields( QObject *o, const QMap<QString, QString> & );
220
QStringList implementationIncludes() const;
221
QStringList declarationIncludes() const;
222
void setImplementationIncludes( const QStringList &lst );
223
void setDeclarationIncludes( const QStringList &lst );
224
QStringList forwardDeclarations() const;
225
void setForwardDeclarations( const QStringList &lst );
226
QStringList signalList() const;
227
void setSignalList( const QStringList &lst );
228
void addMenu( const QString &text, const QString &name );
229
void addMenuAction( const QString &menu, QAction *a );
230
void addMenuSeparator( const QString &menu );
231
void addToolBar( const QString &text, const QString &name );
232
void addToolBarAction( const QString &tb, QAction *a );
233
void addToolBarSeparator( const QString &tb );
235
void onModificationChange( QObject *receiver, const char *slot );
238
FormWindow *formWindow;
242
class DesignerDockImpl: public DesignerDock
247
QDockWindow *dockWindow() const;
250
class DesignerOutputDockImpl: public DesignerOutputDock
253
DesignerOutputDockImpl( OutputWindow *ow );
255
QWidget *addView( const QString &pageName );
256
void appendDebug( const QString & );
258
void appendError( const QString &, int );
262
OutputWindow *outWin;
266
class DesignerSourceFileImpl : public DesignerSourceFile
269
DesignerSourceFileImpl( SourceFile *e );
270
QString fileName() const;