1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef UIC_H
5#define UIC_H
6
7#include "databaseinfo.h"
8#include "customwidgetsinfo.h"
9#include <qstring.h>
10#include <qstringlist.h>
11#include <qstack.h>
12#include <qxmlstream.h>
13
14QT_BEGIN_NAMESPACE
15
16class QTextStream;
17class QIODevice;
18
19class Driver;
20class DomUI;
21class DomWidget;
22class DomSpacer;
23class DomLayout;
24class DomLayoutItem;
25class DomItem;
26
27struct Option;
28
29class Uic
30{
31 Q_DISABLE_COPY_MOVE(Uic)
32public:
33 Uic(Driver *driver);
34 ~Uic();
35
36 bool printDependencies();
37
38 inline Driver *driver() const
39 { return drv; }
40
41 inline QTextStream &output()
42 { return out; }
43
44 inline const Option &option() const
45 { return opt; }
46
47 inline QString pixmapFunction() const
48 { return pixFunction; }
49
50 inline void setPixmapFunction(const QString &f)
51 { pixFunction = f; }
52
53 inline const DatabaseInfo *databaseInfo() const
54 { return &info; }
55
56 inline const CustomWidgetsInfo *customWidgetsInfo() const
57 { return &cWidgetsInfo; }
58
59 bool write(QIODevice *in);
60
61 bool write(DomUI *ui);
62
63 bool isButton(const QString &className) const;
64 bool isContainer(const QString &className) const;
65 bool isMenu(const QString &className) const;
66
67private:
68 // copyright header
69 void writeCopyrightHeaderCpp(const DomUI *ui) const;
70 void writeCopyrightHeaderPython(const DomUI *ui) const;
71 DomUI *parseUiFile(QXmlStreamReader &reader);
72
73 // header protection
74 void writeHeaderProtectionStart();
75 void writeHeaderProtectionEnd();
76
77private:
78 Driver *drv;
79 QTextStream &out;
80 Option &opt;
81 DatabaseInfo info;
82 CustomWidgetsInfo cWidgetsInfo;
83 QString pixFunction;
84};
85
86QT_END_NAMESPACE
87
88#endif // UIC_H
89

source code of qtbase/src/tools/uic/uic.h