summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/designerappiface.h
blob: a9eace1683ab793a50042704c6861e72858013d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
 /**********************************************************************
** Copyright (C) 2000-2001 Trolltech AS.  All rights reserved.
**
** This file is part of Qt Designer.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
**   information about Qt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/

#ifndef DESIGNERAPPIFACE_H
#define DESIGNERAPPIFACE_H

#include "../interfaces/designerinterface.h"
#include "project.h"

class FormWindow;
class MainWindow;
class Project;
class OutputWindow;
class SourceFile;

class DesignerInterfaceImpl : public DesignerInterface
{
public:
    DesignerInterfaceImpl( MainWindow *mw );

    DesignerProject *currentProject() const;
    DesignerFormWindow *currentForm() const;
    DesignerSourceFile *currentSourceFile() const;
    QPtrList<DesignerProject> projectList() const;
    void showStatusMessage( const QString &, int ms = 0 ) const;
    DesignerDock *createDock() const;
    DesignerOutputDock *outputDock() const;
    void setModified( bool b, QWidget *window );
    void updateFunctionList();

    void onProjectChange( QObject *receiver, const char *slot );
    void onFormChange( QObject *receiver, const char *slot );

    bool singleProjectMode() const;
    void showError( QWidget *widget, int line, const QString &message );
    void runFinished();
    void showStackFrame( QWidget *w, int line );
    void showDebugStep( QWidget *w, int line );
    void runProjectPrecondition();
    void runProjectPostcondition( QObjectList *l );


    QRESULT queryInterface( const QUuid &uuid, QUnknownInterface** iface );
    Q_REFCOUNT

private:
    MainWindow *mainWindow;

};

class DesignerProjectImpl: public DesignerProject
{
public:
    DesignerProjectImpl( Project *pr );

    QPtrList<DesignerFormWindow> formList() const;
    QStringList formNames() const;
    QString formFileName( const QString &form ) const;
    void addForm( DesignerFormWindow * );
    void removeForm( DesignerFormWindow * );
    QString fileName() const;
    void setFileName( const QString & );
    QString projectName() const;
    void setProjectName( const QString & );
    QString databaseFile() const;
    void setDatabaseFile( const QString & );
    void setupDatabases() const;
    QPtrList<DesignerDatabase> databaseConnections() const;
    void addDatabase( DesignerDatabase * );
    void removeDatabase( DesignerDatabase * );
    void save() const;
    void setLanguage( const QString & );
    QString language() const;
    void setCustomSetting( const QString &key, const QString &value );
    QString customSetting( const QString &key ) const;
    DesignerPixmapCollection *pixmapCollection() const;
    void breakPoints( QMap<QString, QValueList<uint> > &bps ) const;
    QString breakPointCondition( QObject *o, int line ) const;
    void setBreakPointCondition( QObject *o, int line, const QString &condition );
    void clearAllBreakpoints() const;
    void setIncludePath( const QString &platform, const QString &path );
    void setLibs( const QString &platform, const QString &path );
    void setDefines( const QString &platform, const QString &path );
    void setConfig( const QString &platform, const QString &config );
    void setTemplate( const QString &t );
    QString config( const QString &platform ) const;
    QString libs( const QString &platform ) const;
    QString defines( const QString &platform ) const;
    QString includePath( const QString &platform ) const;
    QString templte() const;
    bool isGenericObject( QObject *o ) const;

private:
    Project *project;

};

#ifndef QT_NO_SQL
class QSqlDatabase;

class DesignerDatabaseImpl: public DesignerDatabase
{
public:
    DesignerDatabaseImpl( DatabaseConnection *d );

    QString name() const;
    void setName( const QString & );
    QString driver() const;
    void setDriver( const QString & );
    QString database() const;
    void setDatabase( const QString & );
    QString userName() const;
    void setUserName( const QString & );
    QString password() const;
    void setPassword( const QString & );
    QString hostName() const;
    void setHostName( const QString & );
    QStringList tables() const;
    void setTables( const QStringList & );
    QMap<QString, QStringList> fields() const;
    void setFields( const QMap<QString, QStringList> & );
    void open( bool suppressDialog = TRUE ) const;
    void close() const;
    QSqlDatabase* connection();
private:
    DatabaseConnection *db;

};
#endif

class DesignerPixmapCollectionImpl : public DesignerPixmapCollection
{
public:
    DesignerPixmapCollectionImpl( PixmapCollection *coll );
    void addPixmap( const QPixmap &p, const QString &name, bool force );
    QPixmap pixmap( const QString &name ) const;

private:
    PixmapCollection *pixCollection;

};

class DesignerFormWindowImpl: public DesignerFormWindow
{
public:
    DesignerFormWindowImpl( FormWindow *fw );

    QString name() const;
    void setName( const QString &n );
    QString fileName() const;
    void setFileName( const QString & );
    void save() const;
    bool isModified() const;
    void insertWidget( QWidget * );
    QWidget *create( const char *className, QWidget *parent, const char *name );
    void removeWidget( QWidget * );
    QWidgetList widgets() const;
    void undo();
    void redo();
    void cut();
    void copy();
    void paste();
    void adjustSize();
    void editConnections();
    void checkAccels();
    void layoutH();
    void layoutV();
    void layoutHSplit();
    void layoutVSplit();
    void layoutG();
    void layoutHContainer( QWidget* w );
    void layoutVContainer( QWidget* w );
    void layoutGContainer( QWidget* w );
    void breakLayout();
    void selectWidget( QWidget * );
    void selectAll();
    void clearSelection();
    bool isWidgetSelected( QWidget * ) const;
    QWidgetList selectedWidgets() const;
    QWidget *currentWidget() const;
    QWidget *form() const;
    void setCurrentWidget( QWidget * );
    QPtrList<QAction> actionList() const;
    QAction *createAction( const QString& text, const QIconSet& icon, const QString& menuText, int accel,
			   QObject* parent, const char* name = 0, bool toggle = FALSE );
    void addAction( QAction * );
    void removeAction( QAction * );
    void preview() const;
    void addFunction( const QCString &function, const QString& specifier, const QString &access,
		      const QString &type, const QString &language, const QString &returnType );
    void addConnection( QObject *sender, const char *signal, QObject *receiver, const char *slot );
    void setProperty( QObject *o, const char *property, const QVariant &value );
    QVariant property( QObject *o, const char *property ) const;
    void setPropertyChanged( QObject *o, const char *property, bool changed );
    bool isPropertyChanged( QObject *o, const char *property ) const;
    void setColumnFields( QObject *o, const QMap<QString, QString> & );
    QStringList implementationIncludes() const;
    QStringList declarationIncludes() const;
    void setImplementationIncludes( const QStringList &lst );
    void setDeclarationIncludes( const QStringList &lst );
    QStringList forwardDeclarations() const;
    void setForwardDeclarations( const QStringList &lst );
    QStringList signalList() const;
    void setSignalList( const QStringList &lst );
    void addMenu( const QString &text, const QString &name );
    void addMenuAction( const QString &menu, QAction *a );
    void addMenuSeparator( const QString &menu );
    void addToolBar( const QString &text, const QString &name );
    void addToolBarAction( const QString &tb, QAction *a );
    void addToolBarSeparator( const QString &tb );

    void onModificationChange( QObject *receiver, const char *slot );

private:
    FormWindow *formWindow;

};

class DesignerDockImpl: public DesignerDock
{
public:
    DesignerDockImpl();

    QDockWindow *dockWindow() const;
};

class DesignerOutputDockImpl: public DesignerOutputDock
{
public:
    DesignerOutputDockImpl( OutputWindow *ow );

    QWidget *addView( const QString &pageName );
    void appendDebug( const QString & );
    void clearDebug();
    void appendError( const QString &, int );
    void clearError();

private:
    OutputWindow *outWin;

};

class DesignerSourceFileImpl : public DesignerSourceFile
{
public:
    DesignerSourceFileImpl( SourceFile *e );
    QString fileName() const;

private:
    SourceFile *ed;

};

#endif