summaryrefslogtreecommitdiffstats
path: root/src/widgets/qwidgetplugin.cpp
blob: ca92e9e8d79026a7b9b90a2854197147afdfd867 (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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
/****************************************************************************
**
** Implementation of TQWidgetPlugin class
**
** Created : 010920
**
** Copyright (C) 2001-2008 Trolltech ASA.  All rights reserved.
**
** This file is part of the widgets module of the TQt GUI Toolkit.
**
** 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.
**
** This file may be used under the terms of the Q Public License as
** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
** included in the packaging of this file.  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.
**
**********************************************************************/

#include "ntqwidgetplugin.h"

#ifndef TQT_NO_WIDGETPLUGIN
#include "qwidgetinterface_p.h"
#include "ntqobjectcleanuphandler.h"
#include "ntqwidget.h"
#ifdef QT_CONTAINER_CUSTOM_WIDGETS
#include "ntqwidgetlist.h"
#endif

/*!
    \class TQWidgetPlugin ntqwidgetplugin.h
    \brief The TQWidgetPlugin class provides an abstract base for custom TQWidget plugins.

    \ingroup plugins

    The widget plugin is a simple plugin interface that makes it easy
    to create custom widgets that can be included in forms using \link
    designer-manual.book TQt Designer\endlink and used by applications.

    Writing a widget plugin is achieved by subclassing this base
    class, reimplementing the pure virtual functions keys(), create(),
    group(), iconSet(), includeFile(), toolTip(), whatsThis() and
    isContainer(), and exporting the class with the \c Q_EXPORT_PLUGIN
    macro.

    See the \link designer-manual.book TQt Designer manual's\endlink,
    'Creating Custom Widgets' section in the 'Creating Custom Widgets'
    chapter, for a complete example of a TQWidgetPlugin.

    See also the \link plugins-howto.html Plugins
    documentation\endlink and the \l{TQWidgetFactory} class that is
    supplied with \link designer-manual.book TQt Designer\endlink.
*/

class TQWidgetPluginPrivate : public TQWidgetFactoryInterface,
#ifdef QT_CONTAINER_CUSTOM_WIDGETS
			     public TQWidgetContainerInterfacePrivate,
#endif
			     private TQLibraryInterface
{
public:
    TQWidgetPluginPrivate( TQWidgetPlugin *p )
	: plugin( p )
    {
    }

    virtual ~TQWidgetPluginPrivate();

    TQRESULT queryInterface( const TQUuid &iid, TQUnknownInterface **iface );
    TQ_REFCOUNT;

    TQStringList featureList() const;
    TQWidget *create( const TQString &key, TQWidget *parent, const char *name );
    TQString group( const TQString &widget ) const;
    TQIconSet iconSet( const TQString &widget ) const;
    TQString includeFile( const TQString &widget ) const;
    TQString toolTip( const TQString &widget ) const;
    TQString whatsThis( const TQString &widget ) const;
    bool isContainer( const TQString &widget ) const;
#ifdef QT_CONTAINER_CUSTOM_WIDGETS
    TQWidget* containerOfWidget( const TQString &key, TQWidget *widget ) const;
    bool isPassiveInteractor( const TQString &key, TQWidget *widget ) const;
    bool supportsPages( const TQString &key ) const;
    TQWidget *addPage( const TQString &key, TQWidget *container, const TQString &name, int index ) const;
    void insertPage( const TQString &key, TQWidget *container,
		     const TQString &name, int index, TQWidget *page ) const;
    void Page( const TQString &key, TQWidget *container,
	       const TQString &name, int index, TQWidget *page ) const;
    void removePage( const TQString &key, TQWidget *container, int index ) const;
    void movePage( const TQString &key, TQWidget *container, int fromIndex, int toIndex ) const;
    int count( const TQString &key, TQWidget *container ) const;
    int currentIndex( const TQString &key, TQWidget *container ) const;
    TQString pageLabel( const TQString &key, TQWidget *container, int index ) const;
    TQWidget *page( const TQString &key, TQWidget *container, int index ) const;
    void renamePage( const TQString &key, TQWidget *container, int index, const TQString &newName ) const;
    TQWidgetList pages( const TQString &key, TQWidget *container ) const;
    TQString createCode( const TQString &key, const TQString &container,
			const TQString &page, const TQString &pageName ) const;
#endif // QT_CONTAINER_CUSTOM_WIDGETS
    bool init();
    void cleanup();
    bool canUnload() const;

private:
    TQWidgetPlugin *plugin;
    TQObjectCleanupHandler widgets;
};

TQRESULT TQWidgetPluginPrivate::queryInterface( const TQUuid &iid, TQUnknownInterface **iface )
{
    *iface = 0;

    if ( iid == IID_QUnknown )
	*iface = (TQWidgetFactoryInterface*)this;
    else if ( iid == IID_QFeatureList )
	*iface = (TQFeatureListInterface*)this;
    else if ( iid == IID_QWidgetFactory )
	*iface = (TQWidgetFactoryInterface*)this;
    else if ( iid == IID_QLibrary )
	*iface = (TQLibraryInterface*)this;
#ifdef QT_CONTAINER_CUSTOM_WIDGETS
    else if ( iid == IID_QWidgetContainer )
	*iface = (TQWidgetContainerInterfacePrivate*)this;
#endif
    else
	return TQE_NOINTERFACE;

    (*iface)->addRef();
    return TQS_OK;
}

/*!
    \fn TQStringList TQWidgetPlugin::keys() const

    Returns the list of widget keys this plugin supports.

    These keys must be the class names of the custom widgets that are
    implemented in the plugin.

    \sa create()
*/

/*!
    \fn TQWidget *TQWidgetPlugin::create( const TQString &, TQWidget *, const char * )

    Creates and returns a TQWidget object for the widget key \a key.
    The widget key is the class name of the required widget. The \a
    name and \a parent arguments are passed to the custom widget's
    constructor.

    \sa keys()
*/

TQWidgetPluginPrivate::~TQWidgetPluginPrivate()
{
    delete plugin;
}

TQStringList TQWidgetPluginPrivate::featureList() const
{
    return plugin->keys();
}

TQWidget *TQWidgetPluginPrivate::create( const TQString &key, TQWidget *parent, const char *name )
{
    TQWidget *w = plugin->create( key, parent, name );
    widgets.add( w );
    return w;
}

TQString TQWidgetPluginPrivate::group( const TQString &widget ) const
{
    return plugin->group( widget );
}

TQIconSet TQWidgetPluginPrivate::iconSet( const TQString &widget ) const
{
    return plugin->iconSet( widget );
}

TQString TQWidgetPluginPrivate::includeFile( const TQString &widget ) const
{
    return plugin->includeFile( widget );
}

TQString TQWidgetPluginPrivate::toolTip( const TQString &widget ) const
{
    return plugin->toolTip( widget );
}

TQString TQWidgetPluginPrivate::whatsThis( const TQString &widget ) const
{
    return plugin->whatsThis( widget );
}

bool TQWidgetPluginPrivate::isContainer( const TQString &widget ) const
{
    return plugin->isContainer( widget );
}

bool TQWidgetPluginPrivate::init()
{
    return TRUE;
}

void TQWidgetPluginPrivate::cleanup()
{
    widgets.clear();
}

bool TQWidgetPluginPrivate::canUnload() const
{
    return widgets.isEmpty();
}

#ifdef QT_CONTAINER_CUSTOM_WIDGETS
TQWidget* TQWidgetPluginPrivate::containerOfWidget( const TQString &key, TQWidget *widget ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->containerOfWidget( key, widget );
    return widget;
}

int TQWidgetPluginPrivate::count( const TQString &key, TQWidget *container ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->count( key, container );
    return 0;
}

int TQWidgetPluginPrivate::currentIndex( const TQString &key, TQWidget *container ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->currentIndex( key, container );
    return -1;
}

TQString TQWidgetPluginPrivate::pageLabel( const TQString &key, TQWidget *container, int index ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->pageLabel( key, container, index );
    return TQString::null;
}

TQWidget *TQWidgetPluginPrivate::page( const TQString &key, TQWidget *container, int index ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->page( key, container, index );
    return 0;
}

bool TQWidgetPluginPrivate::isPassiveInteractor( const TQString &key, TQWidget *widget ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->isPassiveInteractor( key, widget );
    return FALSE;
}

bool TQWidgetPluginPrivate::supportsPages( const TQString &key ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->supportsPages( key );
    return 0;
}

TQWidget *TQWidgetPluginPrivate::addPage( const TQString &key, TQWidget *container,
				    const TQString &name, int index ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->addPage( key, container, name, index );
    return 0;
}

void TQWidgetPluginPrivate::insertPage( const TQString &key, TQWidget *container,
				       const TQString &name, int index, TQWidget *page ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	p->insertPage( key, container, name, index, page );
}

void TQWidgetPluginPrivate::removePage( const TQString &key, TQWidget *container, int index ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	p->removePage( key, container, index );
}

void TQWidgetPluginPrivate::movePage( const TQString &key, TQWidget *container,
				     int fromIndex, int toIndex ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	p->movePage( key, container, fromIndex, toIndex );
}

void TQWidgetPluginPrivate::renamePage( const TQString &key, TQWidget *container,
				      int index, const TQString &newName ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	p->renamePage( key, container, index, newName );
}

TQWidgetList TQWidgetPluginPrivate::pages( const TQString &key, TQWidget *container ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->pages( key, container );
    return TQWidgetList();
}

TQString TQWidgetPluginPrivate::createCode( const TQString &key, const TQString &container,
					  const TQString &page, const TQString &pageName ) const
{
    TQWidgetContainerPlugin *p = (TQWidgetContainerPlugin*)plugin->tqt_cast( "TQWidgetContainerPlugin" );
    if ( p )
	return p->createCode( key, container, page, pageName );
    return TQString::null;
}
#endif // QT_CONTAINER_CUSTOM_WIDGETS

/*!
    Constructs a widget plugin. This is invoked automatically by the
    \c Q_EXPORT_PLUGIN macro.
*/
TQWidgetPlugin::TQWidgetPlugin()
    : TQGPlugin( (TQWidgetFactoryInterface*)(d = new TQWidgetPluginPrivate( this )) )
{
}

/*!
    Destroys the widget plugin.

    You never have to call this explicitly. TQt destroys a plugin
    automatically when it is no longer used.
*/
TQWidgetPlugin::~TQWidgetPlugin()
{
    // don't delete d, as this is deleted by d
}

/*!
    Returns the group (toolbar name) that the custom widget of class
    \a key should be part of when \e{TQt Designer} loads it.

    The default implementation returns TQString::null.
*/
TQString TQWidgetPlugin::group( const TQString & ) const
{
    return TQString::null;
}

/*!
    Returns the iconset that \e{TQt Designer} should use to represent
    the custom widget of class \a key in the toolbar.

    The default implementation returns an null iconset.
*/
TQIconSet TQWidgetPlugin::iconSet( const TQString & ) const
{
    return TQIconSet();
}

/*!
    Returns the name of the include file that \e{TQt Designer} and \c
    uic should use to include the custom widget of class \a key in
    generated code.

    The default implementation returns TQString::null.
*/
TQString TQWidgetPlugin::includeFile( const TQString & ) const
{
    return TQString::null;
}

/*!
    Returns the text of the tooltip that \e{TQt Designer} should use
    for the custom widget of class \a key's toolbar button.

    The default implementation returns TQString::null.
*/
TQString TQWidgetPlugin::toolTip( const TQString & ) const
{
    return TQString::null;
}

/*!
    Returns the text of the whatsThis text that \e{TQt Designer} should
    use when the user requests whatsThis help for the custom widget of
    class \a key.

    The default implementation returns TQString::null.
*/
TQString TQWidgetPlugin::whatsThis( const TQString & ) const
{
    return TQString::null;
}

/*!
    Returns TRUE if the custom widget of class \a key can contain
    other widgets, e.g. like TQFrame; otherwise returns FALSE.

    The default implementation returns FALSE.
*/
bool TQWidgetPlugin::isContainer( const TQString & ) const
{
    return FALSE;
}

#ifdef QT_CONTAINER_CUSTOM_WIDGETS

/*!
    \class TQWidgetContainerPlugin ntqwidgetplugin.h
    \brief The TQWidgetContainerPlugin class provides an abstract base
    for complex custom container TQWidget plugins.

    \internal

    \ingroup plugins

    The widget container plugin is a subclass of TQWidgetPlugin and
    extends the interface with functions necessary for supporting
    complex container widgets via plugins. These container widgets are
    widgets that have one or multiple sub widgets which act as the
    widget's containers. If the widget has multiple container
    subwidgets, they are referred to as "pages", and only one can be
    active at a time. Examples of complex container widgets include:
    TQTabWidget, TQWidgetStack and TQToolBox.

    Writing a complex container widget plugin is achieved by
    subclassing this base class. First by reimplementing
    TQWidgetPlugin's pure virtual functions keys(), create(), group(),
    iconSet(), includeFile(), toolTip(), whatsThis() and
    isContainer(), and exporting the class with the \c Q_EXPORT_PLUGIN
    macro. In addition containerOfWidget(), isPassiveInteractor() and
    supportsPages() must be reimplemented. If the widget
    supportsPages(), count(), currentIndex(), pageLabel(), page(),
    pages() and createCode() must be implemented. If the widget
    supportsPages() and you want to allow the containers pages to be
    modified, you must also reimplement addPage(), insertPage(),
    removePage(), movePage() and renamePage().

    \sa TQWidgetPlugin
*/

/*!
    Constructs a complex container widget plugin. This is invoked
    automatically by the \c Q_EXPORT_PLUGIN macro.
*/

TQWidgetContainerPlugin::TQWidgetContainerPlugin()
    : TQWidgetPlugin()
{
}

/*!
    Destroys the complex container widget plugin.

    You never have to call this explicitly. TQt destroys a plugin
    automatically when it is no longer used.
*/

TQWidgetContainerPlugin::~TQWidgetContainerPlugin()
{
}

/*!
    Operates on the plugin's \a key class.

    Returns the current \a container's custom widget. If the custom
    widget is a tab widget, this function takes the \a container as
    input and returns the widget's current page.

    The default implementation returns \a container.
*/

TQWidget* TQWidgetContainerPlugin::containerOfWidget( const TQString &,
						    TQWidget *container ) const
{
    return container;
}

/*!
    Operates on the plugin's \a key class.

    Returns the \a container custom widget's number of pages. If the
    custom widget is a tab widget, this function returns the number of
    tabs.

    The default implementation returns 0.
*/

int TQWidgetContainerPlugin::count( const TQString &, TQWidget * ) const
{
    return 0;
}

/*!
    Operates on the plugin's \a key class.

    Returns the \a container custom widget's current page index. If
    the custom widget is a tab widget, this function returns the
    current tab's index.

    The default implementation returns -1.
*/

int TQWidgetContainerPlugin::currentIndex( const TQString &, TQWidget * ) const
{
    return -1;
}

/*!
    Operates on the plugin's \a key class.

    Returns the \a container custom widget's label at position \a
    index. If the custom widget is a tab widget, this function returns
    the current tab's label.

    The default implementation returns a null string.
*/

TQString TQWidgetContainerPlugin::pageLabel( const TQString &, TQWidget *, int ) const
{
    return TQString::null;
}

/*!
    Operates on the plugin's \a key class.

    Returns the \a container custom widget's page at position \a
    index. If the custom widget is a tab widget, this function returns
    the tab at index position \e index.


    The default implementation returns 0.
*/

TQWidget *TQWidgetContainerPlugin::page( const TQString &, TQWidget *, int ) const
{
    return 0;
}

/*!
    Operates on the plugin's \a key class.

    Returns TRUE if the \a container custom widget is a passive
    interactor for class \e key; otherwise returns FALSE. The \a
    container is a child widget of the actual custom widget.

    Usually, when a custom widget is used in \e{TQt Designer}'s design
    mode, no widget receives any mouse or key events, since \e{TQt
    Designer} filters and processes them itself. If one or more
    widgets of a custom widget still need to receive such events, for
    example, because the widget needs to change pages, this function
    must return TRUE for the widget. In such cases \e{TQt Designer}
    will not filter out key and mouse events destined for the widget.

    If the custom widget is a tab widget, the tab bar is the passive
    interactor, since that's what the user will use to change pages.

    The default implementation returns FALSE.
*/

bool TQWidgetContainerPlugin::isPassiveInteractor( const TQString &,
						 TQWidget *container ) const
{
    Q_UNUSED( container )
    return FALSE;
}

/*!
    Operates on the plugin's \a key class.

    Returns TRUE if the widget supports pages; otherwise returns
    FALSE. If the custom widget is a tab widget this function should
    return TRUE.

    The default implementation returns FALSE.
*/

bool TQWidgetContainerPlugin::supportsPages( const TQString & ) const
{
    return FALSE;
}

/*!
    Operates on the plugin's \a key class.

    This function is called when a new page with the given \a name
    should be added to the \a container custom widget at position \a
    index.

    The default implementation does nothing.
*/

TQWidget* TQWidgetContainerPlugin::addPage( const TQString &, TQWidget *,
					  const TQString &, int ) const
{
    return 0;
}

/*!
    Operates on the plugin's \a key class.

    This function is called when a new page, \a page, with the given
    \a name should be added to the \a container custom widget at
    position \a index.

    The default implementation does nothing.
*/

void TQWidgetContainerPlugin::insertPage( const TQString &, TQWidget *,
					 const TQString &, int, TQWidget * ) const
{
}

/*!
    Operates on the plugin's \a key class.

    This function is called when the page at position \a index should
    be removed from the \a container custom widget.

    The default implementation does nothing.
*/

void TQWidgetContainerPlugin::removePage( const TQString &, TQWidget *, int ) const
{
}

/*!
    Operates on the plugin's \a key class.

    This function is called when the page at position \a fromIndex should
    be moved to position \a toIndex in the \a container custom widget.

    The default implementation does nothing.
*/

void TQWidgetContainerPlugin::movePage( const TQString &, TQWidget *, int, int ) const
{
}

/*!
    Operates on the plugin's \a key class.

    This function is called when the page at position \a index should
    be renamed (have its label changed) to \a newName in the \a
    container custom widget.

    The default implementation does nothing.
*/

void TQWidgetContainerPlugin::renamePage( const TQString &, TQWidget *,
					 int, const TQString & ) const
{
}

/*!
    Operates on the plugin's \a key class.

    This function should return a list of the \a container custom
    widget's pages.
*/

TQWidgetList TQWidgetContainerPlugin::pages( const TQString &, TQWidget * ) const
{
    return TQWidgetList();
}

/*!
    Operates on the plugin's \a key class.

    This function is called from \e{TQt Designer}'s User Interface
    Compiler \c uic, when generating C++ code for inserting a page in
    the \a container custom widget. The name of the page widget which
    should be inserted at the end of the container is \a page, and the
    label of the page should be \a pageName.

    If the custom widget was a TQTabWidget, the implementation of this
    function should return:

    \code
    return widget + "->addTab( " + page + ", \"" + pageName + "\" )";
    \endcode

    Warning: If the code returned by this function contains invalid
    C++ syntax, the generated \c uic code will not compile.
*/

TQString TQWidgetContainerPlugin::createCode( const TQString &, const TQString &,
					    const TQString &, const TQString & ) const
{
    return TQString::null;
}

#endif // QT_CONTAINER_CUSTOM_WIDGETS

#endif //TQT_NO_WIDGETPLUGIN