| 1 | /****************************************************************************
|
|---|
| 2 | ** $Id: qwidgetinterface_p.h 2 2005-11-16 15:49:26Z dmik $
|
|---|
| 3 | **
|
|---|
| 4 | ** ...
|
|---|
| 5 | **
|
|---|
| 6 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
|
|---|
| 7 | **
|
|---|
| 8 | ** This file is part of the widgets module of the Qt GUI Toolkit.
|
|---|
| 9 | **
|
|---|
| 10 | ** This file may be distributed under the terms of the Q Public License
|
|---|
| 11 | ** as defined by Trolltech AS of Norway and appearing in the file
|
|---|
| 12 | ** LICENSE.QPL included in the packaging of this file.
|
|---|
| 13 | **
|
|---|
| 14 | ** This file may be distributed and/or modified under the terms of the
|
|---|
| 15 | ** GNU General Public License version 2 as published by the Free Software
|
|---|
| 16 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 17 | ** packaging of this file.
|
|---|
| 18 | **
|
|---|
| 19 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
|---|
| 20 | ** licenses may use this file in accordance with the Qt Commercial License
|
|---|
| 21 | ** Agreement provided with the Software.
|
|---|
| 22 | **
|
|---|
| 23 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|---|
| 24 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|---|
| 25 | **
|
|---|
| 26 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
|---|
| 27 | ** information about Qt Commercial License Agreements.
|
|---|
| 28 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
|---|
| 29 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
|---|
| 30 | **
|
|---|
| 31 | ** Contact info@trolltech.com if any conditions of this licensing are
|
|---|
| 32 | ** not clear to you.
|
|---|
| 33 | **
|
|---|
| 34 | **********************************************************************/
|
|---|
| 35 |
|
|---|
| 36 | #ifndef QWIDGETINTERFACE_P_H
|
|---|
| 37 | #define QWIDGETINTERFACE_P_H
|
|---|
| 38 |
|
|---|
| 39 | //
|
|---|
| 40 | // W A R N I N G
|
|---|
| 41 | // -------------
|
|---|
| 42 | //
|
|---|
| 43 | // This file is not part of the Qt API. It exists for the convenience
|
|---|
| 44 | // of a number of Qt sources files. This header file may change from
|
|---|
| 45 | // version to version without notice, or even be removed.
|
|---|
| 46 | //
|
|---|
| 47 | // We mean it.
|
|---|
| 48 | //
|
|---|
| 49 | //
|
|---|
| 50 |
|
|---|
| 51 | #ifndef QT_H
|
|---|
| 52 | #include <private/qcom_p.h>
|
|---|
| 53 | #include "qiconset.h"
|
|---|
| 54 | #endif // QT_H
|
|---|
| 55 |
|
|---|
| 56 | #ifndef QT_NO_WIDGETPLUGIN
|
|---|
| 57 |
|
|---|
| 58 | class QWidget;
|
|---|
| 59 |
|
|---|
| 60 | // {55184143-f18f-42c0-a8eb-71c01516019a}
|
|---|
| 61 | #ifndef IID_QWidgetFactory
|
|---|
| 62 | #define IID_QWidgetFactory QUuid( 0x55184143, 0xf18f, 0x42c0, 0xa8, 0xeb, 0x71, 0xc0, 0x15, 0x16, 0x1, 0x9a )
|
|---|
| 63 | #endif
|
|---|
| 64 |
|
|---|
| 65 | /*! To add custom widgets to the Qt Designer, implement that interface
|
|---|
| 66 | in your custom widget plugin.
|
|---|
| 67 |
|
|---|
| 68 | You also have to implement the function featureList() (\sa
|
|---|
| 69 | QFeatureListInterface) and return there all widgets (names of it)
|
|---|
| 70 | which this interface provides.
|
|---|
| 71 | */
|
|---|
| 72 |
|
|---|
| 73 | struct QWidgetFactoryInterface : public QFeatureListInterface
|
|---|
| 74 | {
|
|---|
| 75 | public:
|
|---|
| 76 |
|
|---|
| 77 | /*! In the implementation create and return the widget \a widget
|
|---|
| 78 | here, use \a parent and \a name when creating the widget */
|
|---|
| 79 | virtual QWidget* create( const QString &widget, QWidget* parent = 0, const char* name = 0 ) = 0;
|
|---|
| 80 |
|
|---|
| 81 | /*! In the implementation return the name of the group of the
|
|---|
| 82 | widget \a widget */
|
|---|
| 83 | virtual QString group( const QString &widget ) const = 0;
|
|---|
| 84 |
|
|---|
| 85 | /*! In the implementation return the iconset, which should be used
|
|---|
| 86 | in the Qt Designer menubar and toolbar to represent the widget
|
|---|
| 87 | \a widget */
|
|---|
| 88 | virtual QIconSet iconSet( const QString &widget ) const = 0;
|
|---|
| 89 |
|
|---|
| 90 | /*! In the implementation return the include file which is needed
|
|---|
| 91 | for the widget \a widget in the generated code which uic
|
|---|
| 92 | generates. */
|
|---|
| 93 | virtual QString includeFile( const QString &widget ) const = 0;
|
|---|
| 94 |
|
|---|
| 95 | /*! In the implementation return the text which should be
|
|---|
| 96 | displayed as tooltip for the widget \a widget */
|
|---|
| 97 | virtual QString toolTip( const QString &widget ) const = 0;
|
|---|
| 98 |
|
|---|
| 99 | /*! In the implementation return the text which should be used for
|
|---|
| 100 | what's this help for the widget \a widget. */
|
|---|
| 101 | virtual QString whatsThis( const QString &widget ) const = 0;
|
|---|
| 102 |
|
|---|
| 103 | /*! In the implementation return TRUE here, of the \a widget
|
|---|
| 104 | should be able to contain other widget in the Qt Designer, else
|
|---|
| 105 | FALSE. */
|
|---|
| 106 | virtual bool isContainer( const QString &widget ) const = 0;
|
|---|
| 107 | };
|
|---|
| 108 |
|
|---|
| 109 | // {15976628-e3c3-47f4-b525-d124a3caf30e}
|
|---|
| 110 | #ifndef IID_QWidgetContainer
|
|---|
| 111 | #define IID_QWidgetContainer QUuid( 0x15976628, 0xe3c3, 0x47f4, 0xb5, 0x25, 0xd1, 0x24, 0xa3, 0xca, 0xf3, 0x0e )
|
|---|
| 112 | #endif
|
|---|
| 113 |
|
|---|
| 114 | struct QWidgetContainerInterfacePrivate : public QUnknownInterface
|
|---|
| 115 | {
|
|---|
| 116 | public:
|
|---|
| 117 | virtual QWidget *containerOfWidget( const QString &f, QWidget *container ) const = 0;
|
|---|
| 118 | virtual bool isPassiveInteractor( const QString &f, QWidget *container ) const = 0;
|
|---|
| 119 |
|
|---|
| 120 | virtual bool supportsPages( const QString &f ) const = 0;
|
|---|
| 121 |
|
|---|
| 122 | virtual QWidget *addPage( const QString &f, QWidget *container,
|
|---|
| 123 | const QString &name, int index ) const = 0;
|
|---|
| 124 | virtual void insertPage( const QString &f, QWidget *container,
|
|---|
| 125 | const QString &name, int index, QWidget *page ) const = 0;
|
|---|
| 126 | virtual void removePage( const QString &f, QWidget *container, int index ) const = 0;
|
|---|
| 127 | virtual void movePage( const QString &f, QWidget *container, int fromIndex, int toIndex ) const = 0;
|
|---|
| 128 | virtual int count( const QString &key, QWidget *container ) const = 0;
|
|---|
| 129 | virtual int currentIndex( const QString &key, QWidget *container ) const = 0;
|
|---|
| 130 | virtual QString pageLabel( const QString &key, QWidget *container, int index ) const = 0;
|
|---|
| 131 | virtual QWidget *page( const QString &key, QWidget *container, int index ) const = 0;
|
|---|
| 132 | virtual void renamePage( const QString &key, QWidget *container,
|
|---|
| 133 | int index, const QString &newName ) const = 0;
|
|---|
| 134 | virtual QWidgetList pages( const QString &f, QWidget *container ) const = 0;
|
|---|
| 135 | virtual QString createCode( const QString &f, const QString &container,
|
|---|
| 136 | const QString &page, const QString &pageName ) const = 0;
|
|---|
| 137 | };
|
|---|
| 138 |
|
|---|
| 139 | #endif // QT_NO_WIDGETPLUGIN
|
|---|
| 140 | #endif // QWIDGETINTERFACE_P_H
|
|---|