~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to kdevdesigner/designer/designerappiface.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 /**********************************************************************
 
2
** Copyright (C) 2000-2001 Trolltech AS.  All rights reserved.
 
3
**
 
4
** This file is part of Qt Designer.
 
5
**
 
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.
 
10
**
 
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.
 
14
**
 
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.
 
17
**
 
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.
 
21
**
 
22
** Contact info@trolltech.com if any conditions of this licensing are
 
23
** not clear to you.
 
24
**
 
25
**********************************************************************/
 
26
 
 
27
#ifndef DESIGNERAPPIFACE_H
 
28
#define DESIGNERAPPIFACE_H
 
29
 
 
30
#include "../interfaces/designerinterface.h"
 
31
#include "project.h"
 
32
 
 
33
class FormWindow;
 
34
class MainWindow;
 
35
class Project;
 
36
class OutputWindow;
 
37
class SourceFile;
 
38
 
 
39
class DesignerInterfaceImpl : public DesignerInterface
 
40
{
 
41
public:
 
42
    DesignerInterfaceImpl( MainWindow *mw );
 
43
 
 
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();
 
53
 
 
54
    void onProjectChange( QObject *receiver, const char *slot );
 
55
    void onFormChange( QObject *receiver, const char *slot );
 
56
 
 
57
    bool singleProjectMode() const;
 
58
    void showError( QWidget *widget, int line, const QString &message );
 
59
    void runFinished();
 
60
    void showStackFrame( QWidget *w, int line );
 
61
    void showDebugStep( QWidget *w, int line );
 
62
    void runProjectPrecondition();
 
63
    void runProjectPostcondition( QObjectList *l );
 
64
 
 
65
 
 
66
    QRESULT queryInterface( const QUuid &uuid, QUnknownInterface** iface );
 
67
    Q_REFCOUNT
 
68
 
 
69
private:
 
70
    MainWindow *mainWindow;
 
71
 
 
72
};
 
73
 
 
74
class DesignerProjectImpl: public DesignerProject
 
75
{
 
76
public:
 
77
    DesignerProjectImpl( Project *pr );
 
78
 
 
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 * );
 
94
    void save() const;
 
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;
 
115
 
 
116
private:
 
117
    Project *project;
 
118
 
 
119
};
 
120
 
 
121
#ifndef QT_NO_SQL
 
122
class QSqlDatabase;
 
123
 
 
124
class DesignerDatabaseImpl: public DesignerDatabase
 
125
{
 
126
public:
 
127
    DesignerDatabaseImpl( DatabaseConnection *d );
 
128
 
 
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;
 
146
    void close() const;
 
147
    QSqlDatabase* connection();
 
148
private:
 
149
    DatabaseConnection *db;
 
150
 
 
151
};
 
152
#endif
 
153
 
 
154
class DesignerPixmapCollectionImpl : public DesignerPixmapCollection
 
155
{
 
156
public:
 
157
    DesignerPixmapCollectionImpl( PixmapCollection *coll );
 
158
    void addPixmap( const QPixmap &p, const QString &name, bool force );
 
159
    QPixmap pixmap( const QString &name ) const;
 
160
 
 
161
private:
 
162
    PixmapCollection *pixCollection;
 
163
 
 
164
};
 
165
 
 
166
class DesignerFormWindowImpl: public DesignerFormWindow
 
167
{
 
168
public:
 
169
    DesignerFormWindowImpl( FormWindow *fw );
 
170
 
 
171
    QString name() const;
 
172
    void setName( const QString &n );
 
173
    QString fileName() const;
 
174
    void setFileName( const QString & );
 
175
    void save() const;
 
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;
 
181
    void undo();
 
182
    void redo();
 
183
    void cut();
 
184
    void copy();
 
185
    void paste();
 
186
    void adjustSize();
 
187
    void editConnections();
 
188
    void checkAccels();
 
189
    void layoutH();
 
190
    void layoutV();
 
191
    void layoutHSplit();
 
192
    void layoutVSplit();
 
193
    void layoutG();
 
194
    void layoutHContainer( QWidget* w );
 
195
    void layoutVContainer( QWidget* w );
 
196
    void layoutGContainer( QWidget* w );
 
197
    void breakLayout();
 
198
    void selectWidget( QWidget * );
 
199
    void selectAll();
 
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 );
 
234
 
 
235
    void onModificationChange( QObject *receiver, const char *slot );
 
236
 
 
237
private:
 
238
    FormWindow *formWindow;
 
239
 
 
240
};
 
241
 
 
242
class DesignerDockImpl: public DesignerDock
 
243
{
 
244
public:
 
245
    DesignerDockImpl();
 
246
 
 
247
    QDockWindow *dockWindow() const;
 
248
};
 
249
 
 
250
class DesignerOutputDockImpl: public DesignerOutputDock
 
251
{
 
252
public:
 
253
    DesignerOutputDockImpl( OutputWindow *ow );
 
254
 
 
255
    QWidget *addView( const QString &pageName );
 
256
    void appendDebug( const QString & );
 
257
    void clearDebug();
 
258
    void appendError( const QString &, int );
 
259
    void clearError();
 
260
 
 
261
private:
 
262
    OutputWindow *outWin;
 
263
 
 
264
};
 
265
 
 
266
class DesignerSourceFileImpl : public DesignerSourceFile
 
267
{
 
268
public:
 
269
    DesignerSourceFileImpl( SourceFile *e );
 
270
    QString fileName() const;
 
271
 
 
272
private:
 
273
    SourceFile *ed;
 
274
 
 
275
};
 
276
 
 
277
#endif