1 | /****************************************************************************
|
---|
2 | ** $Id: qwidgetplugin.h 2 2005-11-16 15:49:26Z dmik $
|
---|
3 | **
|
---|
4 | ** Definition of QWidgetPlugin class
|
---|
5 | **
|
---|
6 | ** Created : 010920
|
---|
7 | **
|
---|
8 | ** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
|
---|
9 | **
|
---|
10 | ** This file is part of the widgets module of the Qt GUI Toolkit.
|
---|
11 | **
|
---|
12 | ** This file may be distributed under the terms of the Q Public License
|
---|
13 | ** as defined by Trolltech AS of Norway and appearing in the file
|
---|
14 | ** LICENSE.QPL included in the packaging of this file.
|
---|
15 | **
|
---|
16 | ** This file may be distributed and/or modified under the terms of the
|
---|
17 | ** GNU General Public License version 2 as published by the Free Software
|
---|
18 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
19 | ** packaging of this file.
|
---|
20 | **
|
---|
21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
22 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
23 | ** Agreement provided with the Software.
|
---|
24 | **
|
---|
25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
27 | **
|
---|
28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
29 | ** information about Qt Commercial License Agreements.
|
---|
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
---|
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
32 | **
|
---|
33 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
34 | ** not clear to you.
|
---|
35 | **
|
---|
36 | **********************************************************************/
|
---|
37 |
|
---|
38 | #ifndef QWIDGETPLUGIN_H
|
---|
39 | #define QWIDGETPLUGIN_H
|
---|
40 |
|
---|
41 | #ifndef QT_H
|
---|
42 | #include "qgplugin.h"
|
---|
43 | #include "qstringlist.h"
|
---|
44 | #include "qiconset.h"
|
---|
45 | #endif // QT_H
|
---|
46 | #ifndef QT_NO_WIDGETPLUGIN
|
---|
47 |
|
---|
48 | #ifdef Q_WS_WIN
|
---|
49 | #ifdef QT_PLUGIN
|
---|
50 | #define QT_WIDGET_PLUGIN_EXPORT __declspec(dllexport)
|
---|
51 | #else
|
---|
52 | #define QT_WIDGET_PLUGIN_EXPORT __declspec(dllimport)
|
---|
53 | #endif
|
---|
54 | #else
|
---|
55 | #define QT_WIDGET_PLUGIN_EXPORT
|
---|
56 | #endif
|
---|
57 |
|
---|
58 | class QWidgetPluginPrivate;
|
---|
59 | class QWidget;
|
---|
60 |
|
---|
61 | class Q_EXPORT QWidgetPlugin : public QGPlugin
|
---|
62 | {
|
---|
63 | Q_OBJECT
|
---|
64 | public:
|
---|
65 | QWidgetPlugin();
|
---|
66 | ~QWidgetPlugin();
|
---|
67 |
|
---|
68 | virtual QStringList keys() const = 0;
|
---|
69 | virtual QWidget *create( const QString &key, QWidget *parent = 0, const char *name = 0 ) = 0;
|
---|
70 |
|
---|
71 | virtual QString group( const QString &key ) const;
|
---|
72 | virtual QIconSet iconSet( const QString &key ) const;
|
---|
73 | virtual QString includeFile( const QString &key ) const;
|
---|
74 | virtual QString toolTip( const QString &key ) const;
|
---|
75 | virtual QString whatsThis( const QString &key ) const;
|
---|
76 | virtual bool isContainer( const QString &key ) const;
|
---|
77 |
|
---|
78 | private:
|
---|
79 | QWidgetPluginPrivate *d;
|
---|
80 | };
|
---|
81 |
|
---|
82 | class QWidgetContainerPluginPrivate;
|
---|
83 |
|
---|
84 | class Q_EXPORT QWidgetContainerPlugin : public QWidgetPlugin
|
---|
85 | {
|
---|
86 | Q_OBJECT
|
---|
87 | public:
|
---|
88 | QWidgetContainerPlugin();
|
---|
89 | ~QWidgetContainerPlugin();
|
---|
90 |
|
---|
91 | virtual QWidget* containerOfWidget( const QString &key, QWidget *container ) const;
|
---|
92 | virtual bool isPassiveInteractor( const QString &key, QWidget *container ) const;
|
---|
93 |
|
---|
94 | virtual bool supportsPages( const QString &key ) const;
|
---|
95 |
|
---|
96 | virtual QWidget *addPage( const QString &key, QWidget *container,
|
---|
97 | const QString &name, int index ) const;
|
---|
98 | virtual void insertPage( const QString &key, QWidget *container,
|
---|
99 | const QString &name, int index, QWidget *page ) const;
|
---|
100 | virtual void removePage( const QString &key, QWidget *container, int index ) const;
|
---|
101 | virtual void movePage( const QString &key, QWidget *container, int fromIndex, int toIndex ) const;
|
---|
102 | virtual int count( const QString &key, QWidget *container ) const;
|
---|
103 | virtual int currentIndex( const QString &key, QWidget *container ) const;
|
---|
104 | virtual QString pageLabel( const QString &key, QWidget *container, int index ) const;
|
---|
105 | virtual QWidget *page( const QString &key, QWidget *container, int index ) const;
|
---|
106 | virtual void renamePage( const QString &key, QWidget *container,
|
---|
107 | int index, const QString &newName ) const;
|
---|
108 | virtual QWidgetList pages( const QString &key, QWidget *container ) const;
|
---|
109 | virtual QString createCode( const QString &key, const QString &container,
|
---|
110 | const QString &page, const QString &pageName ) const;
|
---|
111 | };
|
---|
112 |
|
---|
113 | #endif // QT_NO_WIDGETPLUGIN
|
---|
114 | #endif // QWIDGETPLUGIN_H
|
---|