1 | /**********************************************************************
|
---|
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved.
|
---|
3 | **
|
---|
4 | ** This file is part of Qt Designer.
|
---|
5 | **
|
---|
6 | ** This file may be distributed and/or modified under the terms of the
|
---|
7 | ** GNU General Public License version 2 as published by the Free Software
|
---|
8 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
9 | ** packaging of this file.
|
---|
10 | **
|
---|
11 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
12 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
13 | ** Agreement provided with the Software.
|
---|
14 | **
|
---|
15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
17 | **
|
---|
18 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
19 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
20 | ** information about Qt Commercial License Agreements.
|
---|
21 | **
|
---|
22 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
23 | ** not clear to you.
|
---|
24 | **
|
---|
25 | **********************************************************************/
|
---|
26 |
|
---|
27 | #ifndef WIDGETDATABASE_H
|
---|
28 | #define WIDGETDATABASE_H
|
---|
29 |
|
---|
30 | #include <qiconset.h>
|
---|
31 | #include <qstring.h>
|
---|
32 | #include "../interfaces/widgetinterface.h" // up here for GCC 2.7.* compatibility
|
---|
33 | #include <private/qpluginmanager_p.h>
|
---|
34 |
|
---|
35 |
|
---|
36 | extern QPluginManager<WidgetInterface> *widgetManager();
|
---|
37 |
|
---|
38 | struct WidgetDatabaseRecord
|
---|
39 | {
|
---|
40 | WidgetDatabaseRecord();
|
---|
41 | ~WidgetDatabaseRecord();
|
---|
42 | QString iconSet, name, group, toolTip, whatsThis, includeFile;
|
---|
43 | uint isContainer : 1;
|
---|
44 | uint isForm : 1;
|
---|
45 | uint isCommon : 1;
|
---|
46 | uint isPlugin : 1;
|
---|
47 | QIconSet *icon;
|
---|
48 | int nameCounter;
|
---|
49 | };
|
---|
50 |
|
---|
51 | class WidgetDatabase : public Qt
|
---|
52 | {
|
---|
53 | public:
|
---|
54 | WidgetDatabase();
|
---|
55 | static void setupDataBase( int id );
|
---|
56 | static void setupPlugins();
|
---|
57 |
|
---|
58 | static int count();
|
---|
59 | static int startCustom();
|
---|
60 |
|
---|
61 | static QIconSet iconSet( int id );
|
---|
62 | static QString className( int id );
|
---|
63 | static QString group( int id );
|
---|
64 | static QString toolTip( int id );
|
---|
65 | static QString whatsThis( int id );
|
---|
66 | static QString includeFile( int id );
|
---|
67 | static bool isForm( int id );
|
---|
68 | static bool isContainer( int id );
|
---|
69 | static bool isCommon( int id );
|
---|
70 |
|
---|
71 | static int idFromClassName( const QString &name );
|
---|
72 | static QString createWidgetName( int id );
|
---|
73 |
|
---|
74 | static WidgetDatabaseRecord *at( int index );
|
---|
75 | static void insert( int index, WidgetDatabaseRecord *r );
|
---|
76 | static void append( WidgetDatabaseRecord *r );
|
---|
77 |
|
---|
78 | static QString widgetGroup( const QString &g );
|
---|
79 | static QString widgetGroup( int i );
|
---|
80 | static int numWidgetGroups();
|
---|
81 | static bool isGroupVisible( const QString &g );
|
---|
82 | static bool isGroupEmpty( const QString &grp );
|
---|
83 |
|
---|
84 | static int addCustomWidget( WidgetDatabaseRecord *r );
|
---|
85 | static bool isCustomWidget( int id );
|
---|
86 | static bool isCustomPluginWidget( int id );
|
---|
87 |
|
---|
88 | static bool isWhatsThisLoaded();
|
---|
89 | static void loadWhatsThis( const QString &docPath );
|
---|
90 |
|
---|
91 | static bool hasWidget( const QString &name );
|
---|
92 | static void customWidgetClassNameChanged( const QString &oldName, const QString &newName );
|
---|
93 |
|
---|
94 | };
|
---|
95 |
|
---|
96 | #endif
|
---|