summaryrefslogtreecommitdiffstats
path: root/tools/designer/interfaces/designerinterface.h
blob: e0f5952b1144be5bbdff7783aed2a3820ff9715c (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
 /**********************************************************************
** Copyright (C) 2000-2008 Trolltech ASA.  All rights reserved.
**
** This file is part of TQt Designer.
**
** This file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the files LICENSE.GPL2
** and LICENSE.GPL3 included in the packaging of this file.
** Alternatively you may (at your option) use any later version
** of the GNU General Public License if such license has been
** publicly approved by Trolltech ASA (or its successors, if any)
** and the KDE Free TQt Foundation.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/.
** If you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** Licensees holding valid TQt Commercial licenses may use this file in
** accordance with the TQt Commercial License Agreement provided with
** the Software.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
** herein.
**
**********************************************************************/

#ifndef DESIGNERINTERFACE_H
#define DESIGNERINTERFACE_H

//
//  W A R N I N G  --  PRIVATE INTERFACES
//  --------------------------------------
//
// This file and the interfaces declared in the file are not
// public. It exists for internal purpose. This header file and
// interfaces may change from version to version (even binary
// incompatible) without notice, or even be removed.
//
// We mean it.
//
//

#include <private/qcom_p.h>
#include <ntqptrlist.h>
#include <ntqstring.h>
#include <ntqmap.h>
#include <ntqstringlist.h>
#include <ntqwidgetlist.h>
#include <ntqobjectlist.h>

struct DesignerProject;
struct DesignerDatabase;
struct DesignerFormWindow;
struct DesignerDock;
struct DesignerOutputDock;
struct DesignerOutput;
struct DesignerOutputError;
struct DesignerPixmapCollection;
struct DesignerSourceFile;

class TQDockWindow;
class TQWidget;
class TQObject;
class TQAction;
class TQIconSet;
class TQSqlDatabase;

// {0e661da-f45c-4830-af47-03ec53eb1633}
#ifndef IID_Designer
#define IID_Designer TQUuid( 0xa0e661da, 0xf45c, 0x4830, 0xaf, 0x47, 0x3, 0xec, 0x53, 0xeb, 0x16, 0x33 )
#endif

/*! These are the interfaces implemented by the TQt Designer which should
  be used by plugins to access and use functionality of the TQt Designer.
*/

struct DesignerInterface : public TQUnknownInterface
{
    virtual DesignerProject *currentProject() const = 0;
    virtual DesignerFormWindow *currentForm() const = 0;
    virtual DesignerSourceFile *currentSourceFile() const = 0;
    virtual TQPtrList<DesignerProject> projectList() const = 0;
    virtual void showStatusMessage( const TQString &, int ms = 0 ) const = 0;
    virtual DesignerDock *createDock() const = 0;
    virtual DesignerOutputDock *outputDock() const = 0;
    virtual void setModified( bool b, TQWidget *window ) = 0;
    virtual void updateFunctionList() = 0;

    virtual void onProjectChange( TQObject *receiver, const char *slot ) = 0;
    virtual void onFormChange( TQObject *receiver, const char *slot ) = 0;

    virtual bool singleProjectMode() const = 0;
    virtual void showError( TQWidget *widget, int line, const TQString &message ) = 0;
    virtual void runFinished() = 0;
    virtual void showStackFrame( TQWidget *w, int line ) = 0;
    virtual void showDebugStep( TQWidget *w, int line ) = 0;
    virtual void runProjectPrecondition() = 0;
    virtual void runProjectPostcondition( TQObjectList *l ) = 0;

    };

struct DesignerProject
{
    virtual TQPtrList<DesignerFormWindow> formList() const = 0;
    virtual TQStringList formNames() const = 0;
    virtual TQString formFileName( const TQString &form ) const = 0;
    virtual void addForm( DesignerFormWindow * ) = 0;
    virtual void removeForm( DesignerFormWindow * ) = 0;
    virtual TQString fileName() const = 0;
    virtual void setFileName( const TQString & ) = 0;
    virtual TQString projectName() const = 0;
    virtual void setProjectName( const TQString & ) = 0;
    virtual TQString databaseFile() const = 0;
    virtual void setDatabaseFile( const TQString & ) = 0;
    virtual void setupDatabases() const = 0;
    virtual TQPtrList<DesignerDatabase> databaseConnections() const = 0;
    virtual void addDatabase( DesignerDatabase * ) = 0;
    virtual void removeDatabase( DesignerDatabase * ) = 0;
    virtual void save() const = 0;
    virtual void setLanguage( const TQString & ) = 0;
    virtual TQString language() const = 0;
    virtual void setCustomSetting( const TQString &key, const TQString &value ) = 0;
    virtual TQString customSetting( const TQString &key ) const = 0;
    virtual DesignerPixmapCollection *pixmapCollection() const = 0;
    virtual void breakPoints( TQMap<TQString, TQValueList<uint> > &bps ) const = 0;
    virtual TQString breakPointCondition( TQObject *o, int line ) const = 0;
    virtual void setBreakPointCondition( TQObject *o, int line, const TQString &condition ) = 0;
    virtual void clearAllBreakpoints() const = 0;
    virtual void setIncludePath( const TQString &platform, const TQString &path ) = 0;
    virtual void setLibs( const TQString &platform, const TQString &path ) = 0;
    virtual void setDefines( const TQString &platform, const TQString &path ) = 0;
    virtual void setConfig( const TQString &platform, const TQString &config ) = 0;
    virtual void setTemplate( const TQString &t ) = 0;
    virtual TQString config( const TQString &platform ) const = 0;
    virtual TQString libs( const TQString &platform ) const = 0;
    virtual TQString defines( const TQString &platform ) const = 0;
    virtual TQString includePath( const TQString &platform ) const = 0;
    virtual TQString templte() const = 0;
    virtual bool isGenericObject( TQObject *o ) const = 0;

};

struct DesignerDatabase
{
    virtual TQString name() const = 0;
    virtual void setName( const TQString & ) = 0;
    virtual TQString driver() const = 0;
    virtual void setDriver( const TQString & ) = 0;
    virtual TQString database() const = 0;
    virtual void setDatabase( const TQString & ) = 0;
    virtual TQString userName() const = 0;
    virtual void setUserName( const TQString & ) = 0;
    virtual TQString password() const = 0;
    virtual void setPassword( const TQString & ) = 0;
    virtual TQString hostName() const = 0;
    virtual void setHostName( const TQString & ) = 0;
    virtual TQStringList tables() const = 0;
    virtual void setTables( const TQStringList & ) = 0;
    virtual TQMap<TQString, TQStringList> fields() const = 0;
    virtual void setFields( const TQMap<TQString, TQStringList> & ) = 0;
    virtual void open( bool suppressDialog = FALSE ) const = 0;
    virtual void close() const = 0;
    virtual TQSqlDatabase* connection() = 0;

};

struct DesignerPixmapCollection
{
    virtual void addPixmap( const TQPixmap &p, const TQString &name, bool force ) = 0;
    virtual TQPixmap pixmap( const TQString &name ) const = 0;
};

struct DesignerFormWindow
{
    virtual TQString name() const = 0;
    virtual void setName( const TQString &n ) = 0;
    virtual TQString fileName() const = 0;
    virtual void setFileName( const TQString & ) = 0;
    virtual void save() const = 0;
    virtual bool isModified() const = 0;
    virtual void insertWidget( TQWidget * ) = 0;
    virtual void removeWidget( TQWidget * ) = 0;
    virtual TQWidget *create( const char *className, TQWidget *parent, const char *name ) = 0;
    virtual TQWidgetList widgets() const = 0;
    virtual void undo() = 0;
    virtual void redo() = 0;
    virtual void cut() = 0;
    virtual void copy() = 0;
    virtual void paste() = 0;
    virtual void adjustSize() = 0;
    virtual void editConnections() = 0;
    virtual void checkAccels() = 0;
    virtual void layoutH() = 0;
    virtual void layoutV() = 0;
    virtual void layoutHSplit() = 0;
    virtual void layoutVSplit() = 0;
    virtual void layoutG() = 0;
    virtual void layoutHContainer( TQWidget* w ) = 0;
    virtual void layoutVContainer( TQWidget* w ) = 0;
    virtual void layoutGContainer( TQWidget* w ) = 0;
    virtual void breakLayout() = 0;
    virtual void selectWidget( TQWidget * w ) = 0;
    virtual void selectAll() = 0;
    virtual void clearSelection() = 0;
    virtual bool isWidgetSelected( TQWidget * ) const = 0;
    virtual TQWidgetList selectedWidgets() const = 0;
    virtual TQWidget *currentWidget() const = 0;
    virtual TQWidget *form() const = 0;
    virtual void setCurrentWidget( TQWidget * ) = 0;
    virtual TQPtrList<TQAction> actionList() const = 0;
    virtual TQAction *createAction( const TQString& text, const TQIconSet& icon, const TQString& menuText, int accel,
				   TQObject* parent, const char* name = 0, bool toggle = FALSE ) = 0;
    virtual void addAction( TQAction * ) = 0;
    virtual void removeAction( TQAction * ) = 0;
    virtual void preview() const = 0;
    virtual void addFunction( const TQCString &slot, const TQString &specifier, const TQString &access,
			     const TQString &type, const TQString &language, const TQString &returnType ) = 0;
    virtual void addConnection( TQObject *sender, const char *signal, TQObject *receiver, const char *slot ) = 0;
    virtual void setProperty( TQObject *o, const char *property, const TQVariant &value ) = 0;
    virtual TQVariant property( TQObject *o, const char *property ) const = 0;
    virtual void setPropertyChanged( TQObject *o, const char *property, bool changed ) = 0;
    virtual bool isPropertyChanged( TQObject *o, const char *property ) const = 0;
    virtual void setColumnFields( TQObject *o, const TQMap<TQString, TQString> & ) = 0;
    virtual TQStringList implementationIncludes() const = 0;
    virtual TQStringList declarationIncludes() const = 0;
    virtual void setImplementationIncludes( const TQStringList &lst ) = 0;
    virtual void setDeclarationIncludes( const TQStringList &lst ) = 0;
    virtual TQStringList forwardDeclarations() const = 0;
    virtual void setForwardDeclarations( const TQStringList &lst ) = 0;
    virtual TQStringList signalList() const = 0;
    virtual void setSignalList( const TQStringList &lst ) = 0;
    virtual void addMenu( const TQString &text, const TQString &name ) = 0;
    virtual void addMenuAction( const TQString &menu, TQAction *a ) = 0;
    virtual void addMenuSeparator( const TQString &menu ) = 0;
    virtual void addToolBar( const TQString &text, const TQString &name ) = 0;
    virtual void addToolBarAction( const TQString &tb, TQAction *a ) = 0;
    virtual void addToolBarSeparator( const TQString &tb ) = 0;

    virtual void onModificationChange( TQObject *receiver, const char *slot ) = 0;
};

struct DesignerSourceFile
{
    virtual TQString fileName() const = 0;
};

struct DesignerDock
{
    virtual TQDockWindow *dockWindow() const = 0;
};

struct DesignerOutputDock
{
    virtual TQWidget *addView( const TQString &pageName ) = 0;
    virtual void appendDebug( const TQString & ) = 0;
    virtual void clearDebug() = 0;
    virtual void appendError( const TQString &, int ) = 0;
    virtual void clearError() = 0;
};

#endif