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

« back to all changes in this revision

Viewing changes to kdevdesigner/designer/kdevdesigner_part.cpp

  • 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) 2004 by Alexander Dymo                                  *
 
3
 *   cloudtemple@mksat.net                                                 *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 *   This program is distributed in the hope that it will be useful,       *
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
13
 *   GNU General Public License for more details.                          *
 
14
 *                                                                         *
 
15
 *   You should have received a copy of the GNU General Public License     *
 
16
 *   along with this program; if not, write to the                         *
 
17
 *   Free Software Foundation, Inc.,                                       *
 
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
19
 ***************************************************************************/
 
20
 
 
21
#include "kdevdesigner_part.h"
 
22
 
 
23
#include <kinstance.h>
 
24
#include <kaction.h>
 
25
#include <kactionclasses.h>
 
26
#include <kstdaction.h>
 
27
#include <kfiledialog.h>
 
28
#include <kdebug.h>
 
29
#include <klocale.h>
 
30
#include <kiconloader.h>
 
31
 
 
32
#include <qfile.h>
 
33
#include <qtextstream.h>
 
34
#include <qtoolbar.h>
 
35
#include <qmenubar.h>
 
36
#include <qptrlist.h>
 
37
#include <qstatusbar.h>
 
38
 
 
39
#include "mainwindow.h"
 
40
#include "designeraction.h"
 
41
#include "formwindow.h"
 
42
 
 
43
KDevDesignerPart::KDevDesignerPart( QWidget *parentWidget, const char *// widgetName
 
44
                                    ,
 
45
                                  QObject *parent, const char *name, const QStringList &args )
 
46
    : KInterfaceDesigner::Designer(parent, name)
 
47
{
 
48
    setInstance( KDevDesignerPartFactory::instance() );
 
49
 
 
50
    m_widget = new MainWindow( this, true );
 
51
    m_widget->reparent(parentWidget, QPoint(0,0));
 
52
    setupDesignerWindow();
 
53
 
 
54
    setWidget(m_widget);
 
55
 
 
56
    setupActions();
 
57
    if (args.contains("in shell"))
 
58
        setXMLFile("kdevdesigner_part_sh.rc");
 
59
    else
 
60
        setXMLFile("kdevdesigner_part.rc");
 
61
 
 
62
    setReadWrite(true);
 
63
    setModified(false);
 
64
 
 
65
    connect(m_widget, SIGNAL(formModified(bool )), this, SLOT(formModified(bool)));
 
66
}
 
67
 
 
68
void KDevDesignerPart::setupDesignerWindow()
 
69
{
 
70
    m_widget->menuBar()->hide();
 
71
    m_widget->layoutToolBar->hide();
 
72
    m_widget->projectToolBar->hide();
 
73
    m_widget->toolsToolBar->hide();
 
74
    m_widget->statusBar()->hide();
 
75
}
 
76
 
 
77
static QIconSet createPartIconSet( const QString &name )
 
78
{
 
79
    QIconSet ic( BarIcon( "" + name, KDevDesignerPartFactory::instance() ) );
 
80
    QString prefix = "designer_";
 
81
    int right = name.length() - prefix.length();
 
82
    ic.setPixmap( BarIcon( prefix + "d_" + name.right( right ), KDevDesignerPartFactory::instance() ),
 
83
                  QIconSet::Small, QIconSet::Disabled );
 
84
    return ic;
 
85
}
 
86
 
 
87
void KDevDesignerPart::setupActions( )
 
88
{
 
89
    KAction *action;
 
90
    action = KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
 
91
    action = KStdAction::open(this, SLOT(fileOpen()), actionCollection());
 
92
    action = KStdAction::close(this, SLOT(fileClose()), actionCollection());
 
93
    stateSync(action, m_widget->actionFileClose);
 
94
    action = KStdAction::save(this, SLOT(save()), actionCollection());
 
95
    stateSync(action, m_widget->actionFileSave);
 
96
    action = KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
 
97
    stateSync(action, m_widget->actionFileSaveAs);
 
98
    action = new KAction(i18n("Save Al&l"), 0, this, SLOT(fileSaveAs()), actionCollection(), "file_saveall");
 
99
    stateSync(action, m_widget->actionFileSaveAll);
 
100
    new KAction(i18n("Create &Template..."), 0, this, SLOT(fileCreateTemplate()), actionCollection(), "file_createtemplate");
 
101
 
 
102
    action = KStdAction::undo(this, SLOT(editUndo()), actionCollection());
 
103
    stateSync(action, m_widget->actionEditUndo);
 
104
    action = KStdAction::redo(this, SLOT(editRedo()), actionCollection());
 
105
    stateSync(action, m_widget->actionEditRedo);
 
106
    action = KStdAction::cut(this, SLOT(editCut()), actionCollection());
 
107
    stateSync(action, m_widget->actionEditCut);
 
108
    action = KStdAction::copy(this, SLOT(editCopy()), actionCollection());
 
109
    stateSync(action, m_widget->actionEditCopy);
 
110
    action = KStdAction::paste(this, SLOT(editPaste()), actionCollection());
 
111
    stateSync(action, m_widget->actionEditPaste);
 
112
    action = new KAction(i18n("&Delete"), Key_Delete, this, SLOT(editDelete()), actionCollection(), "edit_delete");
 
113
    stateSync(action, m_widget->actionEditDelete);
 
114
    action = KStdAction::selectAll(this, SLOT(editSelectAll()), actionCollection());
 
115
    stateSync(action, m_widget->actionEditSelectAll);
 
116
    action = new KAction(i18n("Chec&k Accelerators"), ALT + Key_R, this, SLOT(editAccels()), actionCollection(), "edit_accels");
 
117
    stateSync(action, m_widget->actionEditAccels);
 
118
    action = new KAction(i18n("S&lots..."), createPartIconSet("designer_editslots.png"), 0, this, SLOT(editFunctions()), actionCollection(), "edit_functions");
 
119
    stateSync(action, m_widget->actionEditFunctions);
 
120
    action = new KAction(i18n("Co&nnections..."), createPartIconSet("designer_connecttool.png"), 0, this, SLOT(editConnections()), actionCollection(), "edit_connections");
 
121
    stateSync(action, m_widget->actionEditConnections);
 
122
    action = new KAction(i18n("&Form Settings..."), 0, this, SLOT(editFormSettings()), actionCollection(), "edit_formsettings");
 
123
    stateSync(action, m_widget->actionEditFormSettings);
 
124
 
 
125
    action = new KAction(i18n("&Add File..."), 0, this, SLOT(projectAddFile()), actionCollection(), "project_addfile");
 
126
    stateSync(action, m_widget->actionProjectAddFile);
 
127
    action = new KAction(i18n("&Image Collection..."), 0, this, SLOT(projectImageCollection()), actionCollection(), "project_imagecollection");
 
128
    stateSync(action, m_widget->actionEditPixmapCollection);
 
129
    action = new KAction(i18n("&Database Connections..."), 0, this, SLOT(projectDatabaseCollections()), actionCollection(), "project_databasecollections");
 
130
    stateSync(action, m_widget->actionEditDatabaseConnections);
 
131
    action = new KAction(i18n("&Designer Project Settings..."), 0, this, SLOT(projectSettings()), actionCollection(), "project_settings");
 
132
    stateSync(action, m_widget->actionEditProjectSettings);
 
133
 
 
134
    KRadioAction *toggle;
 
135
    toggle = new KRadioAction(i18n("&Pointer"), createPartIconSet("designer_pointer.png"), Key_F2, actionCollection(), "tools_pointer");
 
136
    setupToolsAction(toggle, m_widget->actionPointerTool);
 
137
    pointerAction = toggle;
 
138
    toggle = new KRadioAction(i18n("&Connect Signal/Slots"), createPartIconSet("designer_connecttool.png"), Key_F3, actionCollection(), "tools_connect");
 
139
    setupToolsAction(toggle, m_widget->actionConnectTool);
 
140
    toggle = new KRadioAction(i18n("Tab &Order"), createPartIconSet("designer_ordertool.png"), Key_F4, actionCollection(), "tools_taborder");
 
141
    setupToolsAction(toggle, m_widget->actionOrderTool);
 
142
    toggle = new KRadioAction(i18n("Set &Buddy"), createPartIconSet("designer_setbuddy.png"), Key_F12, actionCollection(), "tools_setbuddy");
 
143
    setupToolsAction(toggle, m_widget->actionBuddyTool);
 
144
    new KAction(i18n("Configure Toolbox..."), 0, this, SLOT(toolsConfigureToolbox()), actionCollection(), "tools_toolbox");
 
145
    new KAction(i18n("Edit &Custom Widgets..."), 0, this, SLOT(toolsEditCustomWidgets()), actionCollection(), "tools_editcustomwidgets");
 
146
 
 
147
    action = new KAction(i18n("Adjust &Size"), createPartIconSet("designer_adjustsize.png"), CTRL + Key_J, this, SLOT(layoutAdjustSize()), actionCollection(), "layout_adjustsize");
 
148
    stateSync(action, m_widget->actionEditAdjustSize);
 
149
    action = new KAction(i18n("Lay Out &Horizontally"), createPartIconSet("designer_edithlayout.png"), CTRL + Key_H, this, SLOT(layoutHLayout()), actionCollection(), "layout_h");
 
150
    stateSync(action, m_widget->actionEditHLayout);
 
151
    action = new KAction(i18n("Lay Out &Vertically"), createPartIconSet("designer_editvlayout.png"), CTRL + Key_V, this, SLOT(layoutVLayout()), actionCollection(), "layout_v");
 
152
    stateSync(action, m_widget->actionEditVLayout);
 
153
    action = new KAction(i18n("Lay Out in &Grid"), createPartIconSet("designer_editgrid.png"), CTRL + Key_G, this, SLOT(layoutGridLayout()), actionCollection(), "layout_grid");
 
154
    stateSync(action, m_widget->actionEditGridLayout);
 
155
    action = new KAction(i18n("Lay Out Horizontally (in S&plitter)"), createPartIconSet("designer_editvlayoutsplit.png"), 0, this, SLOT(layoutSplitHLayout()), actionCollection(), "layout_splith");
 
156
    stateSync(action, m_widget->actionEditSplitHorizontal);
 
157
    action = new KAction(i18n("Lay Out Vertically (in Sp&litter)"), createPartIconSet("designer_edithlayoutsplit.png"), 0, this, SLOT(layoutSplitVLayout()), actionCollection(), "layout_splitv");
 
158
    stateSync(action, m_widget->actionEditSplitVertical);
 
159
    action = new KAction(i18n("&Break Layout"), createPartIconSet("designer_editbreaklayout.png"), CTRL + Key_B, this, SLOT(layoutBreak()), actionCollection(), "layout_break");
 
160
    stateSync(action, m_widget->actionEditBreakLayout);
 
161
    toggle = new KRadioAction(i18n("Add Spacer"), createPartIconSet("designer_spacer.png"), 0, actionCollection(), "layout_spacer");
 
162
    setupToolsAction(toggle, m_widget->actionInsertSpacer);
 
163
 
 
164
    action = new KAction(i18n("Preview &Form"), CTRL + Key_T, this, SLOT(windowPreview()), actionCollection(), "window_preview");
 
165
    stateSync(action, m_widget->actionPreview);
 
166
    action = new KAction(i18n("Ne&xt Form"), CTRL + Key_F6, this, SLOT(windowNext()), actionCollection(), "window_next");
 
167
    stateSync(action, m_widget->actionWindowNext);
 
168
    action = new KAction(i18n("Pre&vious Form"), CTRL + SHIFT + Key_F6, this, SLOT(windowPrev()), actionCollection(), "window_prev");
 
169
    stateSync(action, m_widget->actionWindowPrevious);
 
170
 
 
171
    action = KStdAction::preferences(this, SLOT(editPreferences()), actionCollection());
 
172
    action->setText(i18n("Configure &KDevDesigner..."));
 
173
    stateSync(action, m_widget->actionEditPreferences);
 
174
}
 
175
 
 
176
KDevDesignerPart::~KDevDesignerPart()
 
177
{
 
178
}
 
179
 
 
180
void KDevDesignerPart::setReadWrite(bool rw)
 
181
{
 
182
    ReadWritePart::setReadWrite(rw);
 
183
}
 
184
 
 
185
void KDevDesignerPart::setModified(bool modified)
 
186
{
 
187
/*    KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save));
 
188
    if (!save)
 
189
        return;
 
190
    if (modified)
 
191
        save->setEnabled(true);
 
192
    else
 
193
        save->setEnabled(false);*/
 
194
 
 
195
    ReadWritePart::setModified(modified);
 
196
}
 
197
 
 
198
bool KDevDesignerPart::openFile()
 
199
{
 
200
    m_widget->fileOpen("", "", m_file);
 
201
    return true;
 
202
}
 
203
 
 
204
bool KDevDesignerPart::saveFile()
 
205
{
 
206
    if (isReadWrite() == false)
 
207
        return false;
 
208
    m_widget->actionFileSaveAll->activate();
 
209
    return true;
 
210
}
 
211
 
 
212
void KDevDesignerPart::stateSync( KAction * kaction, QAction * qaction )
 
213
{
 
214
    if (!qaction)
 
215
        return;
 
216
    kaction->setEnabled(qaction->isEnabled());
 
217
    DesignerAction *ac = dynamic_cast<DesignerAction*>(qaction);
 
218
    if (!ac)
 
219
        return;
 
220
    connect(ac, SIGNAL(actionEnabled(bool )), kaction, SLOT(setEnabled(bool )));
 
221
}
 
222
 
 
223
void KDevDesignerPart::setupToolsAction( KRadioAction * toggle, QAction * action )
 
224
{
 
225
    if (!action)
 
226
        return;
 
227
 
 
228
    toggle->setGroup("tools");
 
229
    toggle->setExclusiveGroup("tools");
 
230
    connect(action, SIGNAL(toggled(bool )), this, SLOT(setToggleActionChecked(bool )));
 
231
    connect(toggle, SIGNAL(toggled(bool)), this, SLOT(setToggleActionOn(bool)));
 
232
    toggle->setChecked(action->isOn());
 
233
    m_actionMap[action] = toggle;
 
234
    m_actionMap2[toggle] = action;
 
235
}
 
236
 
 
237
 
 
238
// It's usually safe to leave the factory code alone.. with the
 
239
// notable exception of the KAboutData data
 
240
#include <kaboutdata.h>
 
241
#include <klocale.h>
 
242
 
 
243
KInstance*  KDevDesignerPartFactory::s_instance = 0L;
 
244
KAboutData* KDevDesignerPartFactory::s_about = 0L;
 
245
 
 
246
KDevDesignerPartFactory::KDevDesignerPartFactory()
 
247
    : KParts::Factory()
 
248
{
 
249
}
 
250
 
 
251
KDevDesignerPartFactory::~KDevDesignerPartFactory()
 
252
{
 
253
    delete s_instance;
 
254
    delete s_about;
 
255
 
 
256
    s_instance = 0L;
 
257
}
 
258
 
 
259
KParts::Part* KDevDesignerPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
 
260
                                                        QObject *parent, const char *name,
 
261
                                                        const char *classname, const QStringList &args )
 
262
{
 
263
    // Create an instance of our Part
 
264
    KDevDesignerPart* obj = new KDevDesignerPart( parentWidget, widgetName, parent, name, args );
 
265
 
 
266
    // See if we are to be read-write or not
 
267
    if (QCString(classname) == "KParts::ReadOnlyPart")
 
268
        obj->setReadWrite(false);
 
269
 
 
270
    return obj;
 
271
}
 
272
 
 
273
KInstance* KDevDesignerPartFactory::instance()
 
274
{
 
275
    if( !s_instance )
 
276
    {
 
277
        s_about = new KAboutData("kdevdesignerpart", I18N_NOOP("KDevDesignerPart"), "0.1");
 
278
        s_about->addAuthor("Alexander Dymo", 0, "cloudtemple@mksat.net");
 
279
        s_about->addAuthor("Trolltech AS", 0, "info@trolltech.com");
 
280
        s_instance = new KInstance(s_about);
 
281
    }
 
282
    return s_instance;
 
283
}
 
284
 
 
285
extern "C"
 
286
{
 
287
    void* init_libkdevdesignerpart()
 
288
    {
 
289
        return new KDevDesignerPartFactory;
 
290
    }
 
291
}
 
292
 
 
293
//actions
 
294
 
 
295
void KDevDesignerPart::fileNew( )
 
296
{
 
297
    if (!m_widget->actionNewFile)
 
298
    {
 
299
        qWarning("wrong m_widget->actionNewFile");
 
300
        return;
 
301
    }
 
302
    m_widget->actionNewFile->activate();
 
303
}
 
304
 
 
305
void KDevDesignerPart::fileOpen()
 
306
{
 
307
    m_widget->fileOpen();
 
308
}
 
309
 
 
310
void KDevDesignerPart::fileSaveAs()
 
311
{
 
312
    m_widget->actionFileSaveAs->activate();
 
313
}
 
314
 
 
315
void KDevDesignerPart::fileClose( )
 
316
{
 
317
    m_widget->actionFileClose->activate();
 
318
}
 
319
 
 
320
void KDevDesignerPart::fileCreateTemplate( )
 
321
{
 
322
    m_widget->fileCreateTemplate();
 
323
}
 
324
 
 
325
void KDevDesignerPart::editUndo( )
 
326
{
 
327
    m_widget->actionEditUndo->activate();
 
328
}
 
329
 
 
330
void KDevDesignerPart::editRedo( )
 
331
{
 
332
    m_widget->actionEditRedo->activate();
 
333
}
 
334
 
 
335
void KDevDesignerPart::editCut( )
 
336
{
 
337
    m_widget->actionEditCut->activate();
 
338
}
 
339
 
 
340
void KDevDesignerPart::editPaste( )
 
341
{
 
342
    m_widget->actionEditPaste->activate();
 
343
}
 
344
 
 
345
void KDevDesignerPart::editCopy( )
 
346
{
 
347
    m_widget->actionEditCopy->activate();
 
348
}
 
349
 
 
350
void KDevDesignerPart::editDelete( )
 
351
{
 
352
    m_widget->actionEditDelete->activate();
 
353
}
 
354
 
 
355
void KDevDesignerPart::editSelectAll( )
 
356
{
 
357
    m_widget->actionEditSelectAll->activate();
 
358
}
 
359
 
 
360
void KDevDesignerPart::editAccels( )
 
361
{
 
362
    m_widget->actionEditAccels->activate();
 
363
}
 
364
 
 
365
void KDevDesignerPart::editFunctions( )
 
366
{
 
367
    m_widget->actionEditFunctions->activate();
 
368
}
 
369
 
 
370
void KDevDesignerPart::editConnections( )
 
371
{
 
372
    m_widget->actionEditConnections->activate();
 
373
}
 
374
 
 
375
void KDevDesignerPart::editFormSettings( )
 
376
{
 
377
    m_widget->actionEditFormSettings->activate();
 
378
}
 
379
 
 
380
void KDevDesignerPart::editPreferences( )
 
381
{
 
382
    m_widget->actionEditPreferences->activate();
 
383
}
 
384
 
 
385
void KDevDesignerPart::projectAddFile( )
 
386
{
 
387
    m_widget->actionProjectAddFile->activate();
 
388
}
 
389
 
 
390
void KDevDesignerPart::projectImageCollection( )
 
391
{
 
392
    m_widget->actionEditPixmapCollection->activate();
 
393
}
 
394
 
 
395
void KDevDesignerPart::projectDatabaseCollections( )
 
396
{
 
397
    m_widget->actionEditDatabaseConnections->activate();
 
398
}
 
399
 
 
400
void KDevDesignerPart::projectSettings( )
 
401
{
 
402
    m_widget->actionEditProjectSettings->activate();
 
403
}
 
404
 
 
405
void KDevDesignerPart::toolsConfigureToolbox( )
 
406
{
 
407
    m_widget->toolsConfigure();
 
408
}
 
409
 
 
410
void KDevDesignerPart::layoutAdjustSize( )
 
411
{
 
412
    m_widget->actionEditAdjustSize->activate();
 
413
}
 
414
 
 
415
void KDevDesignerPart::layoutHLayout( )
 
416
{
 
417
    m_widget->actionEditHLayout->activate();
 
418
}
 
419
 
 
420
void KDevDesignerPart::layoutVLayout( )
 
421
{
 
422
    m_widget->actionEditVLayout->activate();
 
423
}
 
424
 
 
425
void KDevDesignerPart::layoutGridLayout( )
 
426
{
 
427
    m_widget->actionEditGridLayout->activate();
 
428
}
 
429
 
 
430
void KDevDesignerPart::layoutSplitHLayout( )
 
431
{
 
432
    m_widget->actionEditSplitHorizontal->activate();
 
433
}
 
434
 
 
435
void KDevDesignerPart::layoutSplitVLayout( )
 
436
{
 
437
    m_widget->actionEditSplitVertical->activate();
 
438
}
 
439
 
 
440
void KDevDesignerPart::layoutBreak( )
 
441
{
 
442
    m_widget->actionEditBreakLayout->activate();
 
443
}
 
444
 
 
445
void KDevDesignerPart::windowPreview( )
 
446
{
 
447
    m_widget->actionPreview->activate();
 
448
}
 
449
 
 
450
void KDevDesignerPart::windowNext( )
 
451
{
 
452
    m_widget->actionWindowNext->activate();
 
453
}
 
454
 
 
455
void KDevDesignerPart::windowPrev( )
 
456
{
 
457
    m_widget->actionWindowPrevious->activate();
 
458
}
 
459
 
 
460
void KDevDesignerPart::statusMessage( const QString & msg )
 
461
{
 
462
    emit setStatusBarText(msg);
 
463
}
 
464
 
 
465
void KDevDesignerPart::setToggleActionChecked( bool b)
 
466
{
 
467
    if (!sender())
 
468
        return;
 
469
    const QAction *action = dynamic_cast<const QAction*>(sender());
 
470
    if (!action)
 
471
        return;
 
472
    if (b)
 
473
    {
 
474
        if (action == m_widget->actionPointerTool)
 
475
            pointerAction->setChecked(true);
 
476
        return;
 
477
    }
 
478
    KRadioAction *kaction = m_actionMap[action];
 
479
    if (!kaction)
 
480
        return;
 
481
//    kdDebug() << "untoggle action: " << kaction->text() << endl;
 
482
    kaction->blockSignals(true);
 
483
    kaction->setChecked(b);
 
484
    kaction->blockSignals(false);
 
485
}
 
486
 
 
487
void KDevDesignerPart::setToggleActionOn( bool b )
 
488
{
 
489
    if (!sender())
 
490
        return;
 
491
    const KRadioAction *action = dynamic_cast<const KRadioAction *>(sender());
 
492
    if (!action)
 
493
        return;
 
494
//    kdDebug() << (b?QString("toggle"):QString("untoggle")) << " action: " << action->text() << endl;
 
495
    QAction *qaction = m_actionMap2[action];
 
496
    if (!qaction)
 
497
        return;
 
498
    disconnect(qaction, SIGNAL(toggled(bool )), this, SLOT(setToggleActionChecked(bool )));
 
499
    qaction->setOn(b);
 
500
    connect(qaction, SIGNAL(toggled(bool )), this, SLOT(setToggleActionChecked(bool )));
 
501
}
 
502
 
 
503
void KDevDesignerPart::openProject( const QString & // projectFile
 
504
                                    )
 
505
{
 
506
    //TODO: implement
 
507
    return;
 
508
}
 
509
 
 
510
KInterfaceDesigner::DesignerType KDevDesignerPart::designerType( )
 
511
{
 
512
    return KInterfaceDesigner::QtDesigner;
 
513
}
 
514
 
 
515
void KDevDesignerPart::emitAddedFunction( const QString & form, KInterfaceDesigner::Function func )
 
516
{
 
517
    kdDebug() << "KDevDesignerPart::emitAddedFunction: form " << form << ", function: " << func.function << endl;
 
518
    emit addedFunction(designerType(), form, func);
 
519
}
 
520
 
 
521
void KDevDesignerPart::emitRemovedFunction( const QString & form, KInterfaceDesigner::Function func )
 
522
{
 
523
    kdDebug() << "KDevDesignerPart::emitRemovedFunction: form " << form << ", function: " << func.function << endl;
 
524
    emit removedFunction(designerType(), form, func);
 
525
}
 
526
 
 
527
void KDevDesignerPart::emitEditedFunction( const QString & form, KInterfaceDesigner::Function oldFunc, KInterfaceDesigner::Function func )
 
528
{
 
529
    kdDebug() << "KDevDesignerPart::emitEditedFunction: form " << form
 
530
        << ", old function: " << oldFunc.function
 
531
        << ", function: " << func.function << endl;
 
532
 
 
533
//    m_widget->formWindow()->clearSelection(false);
 
534
    emit editedFunction(designerType(), form, oldFunc, func);
 
535
}
 
536
 
 
537
void KDevDesignerPart::emitEditFunction(const QString &formName, const QString &functionName)
 
538
{
 
539
    kdDebug() << "KDevDesignerPart::emitEditedFunction: form " << formName
 
540
        << ", function: " << functionName << endl;
 
541
    emit editFunction(designerType(), formName, functionName);
 
542
}
 
543
 
 
544
void KDevDesignerPart::formModified(bool b)
 
545
{
 
546
    kdDebug() << "KDevDesignerPart::formModified " << b << endl;
 
547
    setModified(b);
 
548
}
 
549
 
 
550
void KDevDesignerPart::emitEditSource(const QString &formName)
 
551
{
 
552
    emit editSource(designerType(), formName);
 
553
}
 
554
 
 
555
void KDevDesignerPart::emitNewStatus(const QString &formName, int status)
 
556
{
 
557
    emit newStatus(formName, status);
 
558
}
 
559
 
 
560
void KDevDesignerPart::toolsEditCustomWidgets( )
 
561
{
 
562
    m_widget->toolsCustomWidget();
 
563
}
 
564
 
 
565
#include "kdevdesigner_part.moc"