1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
5 **
6 ** This file is part of the Qt Designer of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 or version 3 as published by the Free
20 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22 ** following information to ensure the GNU Lesser General Public License
23 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 **
26 ** As a special exception, The Qt Company gives you certain additional
27 ** rights. These rights are described in The Qt Company LGPL Exception
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 **
30 ** GNU General Public License Usage
31 ** Alternatively, this file may be used under the terms of the GNU
32 ** General Public License version 3.0 as published by the Free Software
33 ** Foundation and appearing in the file LICENSE.GPL included in the
34 ** packaging of this file.  Please review the following information to
35 ** ensure the GNU General Public License version 3.0 requirements will be
36 ** met: http://www.gnu.org/copyleft/gpl.html.
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef ABSTRACTWIDGETDATABASE_H
43 #define ABSTRACTWIDGETDATABASE_H
44 
45 #include <QtDesigner/sdk_global.h>
46 
47 #include <QtCore/QObject>
48 #include <QtCore/QList>
49 
50 QT_BEGIN_HEADER
51 
52 QT_BEGIN_NAMESPACE
53 
54 class QIcon;
55 class QString;
56 class QDesignerFormEditorInterface;
57 class QDebug;
58 
59 class QDesignerWidgetDataBaseItemInterface
60 {
61 public:
~QDesignerWidgetDataBaseItemInterface()62     virtual ~QDesignerWidgetDataBaseItemInterface() {}
63 
64     virtual QString name() const = 0;
65     virtual void setName(const QString &name) = 0;
66 
67     virtual QString group() const = 0;
68     virtual void setGroup(const QString &group) = 0;
69 
70     virtual QString toolTip() const = 0;
71     virtual void setToolTip(const QString &toolTip) = 0;
72 
73     virtual QString whatsThis() const = 0;
74     virtual void setWhatsThis(const QString &whatsThis) = 0;
75 
76     virtual QString includeFile() const = 0;
77     virtual void setIncludeFile(const QString &includeFile) = 0;
78 
79     virtual QIcon icon() const = 0;
80     virtual void setIcon(const QIcon &icon) = 0;
81 
82     virtual bool isCompat() const = 0;
83     virtual void setCompat(bool compat) = 0;
84 
85     virtual bool isContainer() const = 0;
86     virtual void setContainer(bool container) = 0;
87 
88     virtual bool isCustom() const = 0;
89     virtual void setCustom(bool custom) = 0;
90 
91     virtual QString pluginPath() const = 0;
92     virtual void setPluginPath(const QString &path) = 0;
93 
94     virtual bool isPromoted() const = 0;
95     virtual void setPromoted(bool b) = 0;
96 
97     virtual QString extends() const = 0;
98     virtual void setExtends(const QString &s) = 0;
99 
100     virtual void setDefaultPropertyValues(const QList<QVariant> &list) = 0;
101     virtual QList<QVariant> defaultPropertyValues() const = 0;
102 };
103 
104 class QDESIGNER_SDK_EXPORT QDesignerWidgetDataBaseInterface: public QObject
105 {
106     Q_OBJECT
107 public:
108     QDesignerWidgetDataBaseInterface(QObject *parent = 0);
109     virtual ~QDesignerWidgetDataBaseInterface();
110 
111     virtual int count() const;
112     virtual QDesignerWidgetDataBaseItemInterface *item(int index) const;
113 
114     virtual int indexOf(QDesignerWidgetDataBaseItemInterface *item) const;
115     virtual void insert(int index, QDesignerWidgetDataBaseItemInterface *item);
116     virtual void append(QDesignerWidgetDataBaseItemInterface *item);
117 
118     virtual int indexOfObject(QObject *object, bool resolveName = true) const;
119     virtual int indexOfClassName(const QString &className, bool resolveName = true) const;
120 
121     virtual QDesignerFormEditorInterface *core() const;
122 
123     bool isContainer(QObject *object, bool resolveName = true) const;
124     bool isCustom(QObject *object, bool resolveName = true) const;
125 
126 Q_SIGNALS:
127     void changed();
128 
129 protected:
130     QList<QDesignerWidgetDataBaseItemInterface *> m_items;
131 };
132 
133 QT_END_NAMESPACE
134 
135 QT_END_HEADER
136 
137 #endif // ABSTRACTWIDGETDATABASE_H
138