1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** Contact: Qt Software Information ([email protected])
|
---|
5 | **
|
---|
6 | ** This file is part of the tools applications of the Qt Toolkit.
|
---|
7 | **
|
---|
8 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
9 | ** Commercial Usage
|
---|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
11 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
12 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
13 | ** a written agreement between you and Nokia.
|
---|
14 | **
|
---|
15 | ** GNU Lesser General Public License Usage
|
---|
16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
17 | ** General Public License version 2.1 as published by the Free Software
|
---|
18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
19 | ** packaging of this file. Please review the following information to
|
---|
20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
22 | **
|
---|
23 | ** In addition, as a special exception, Nokia gives you certain
|
---|
24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
---|
25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
---|
26 | ** package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you are unsure which license is appropriate for your use, please
|
---|
37 | ** contact the sales department at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #ifndef UIC_H
|
---|
43 | #define UIC_H
|
---|
44 |
|
---|
45 | #include "databaseinfo.h"
|
---|
46 | #include "customwidgetsinfo.h"
|
---|
47 | #include <QtCore/QString>
|
---|
48 | #include <QtCore/QStringList>
|
---|
49 | #include <QtCore/QHash>
|
---|
50 | #include <QtCore/QStack>
|
---|
51 | #include <QtCore/QXmlStreamReader>
|
---|
52 |
|
---|
53 | QT_BEGIN_NAMESPACE
|
---|
54 |
|
---|
55 | class QTextStream;
|
---|
56 | class QIODevice;
|
---|
57 |
|
---|
58 | class Driver;
|
---|
59 | class DomUI;
|
---|
60 | class DomWidget;
|
---|
61 | class DomSpacer;
|
---|
62 | class DomLayout;
|
---|
63 | class DomLayoutItem;
|
---|
64 | class DomItem;
|
---|
65 |
|
---|
66 | struct Option;
|
---|
67 |
|
---|
68 | class Uic
|
---|
69 | {
|
---|
70 | public:
|
---|
71 | Uic(Driver *driver);
|
---|
72 | ~Uic();
|
---|
73 |
|
---|
74 | bool printDependencies();
|
---|
75 |
|
---|
76 | inline Driver *driver() const
|
---|
77 | { return drv; }
|
---|
78 |
|
---|
79 | inline QTextStream &output()
|
---|
80 | { return out; }
|
---|
81 |
|
---|
82 | inline const Option &option() const
|
---|
83 | { return opt; }
|
---|
84 |
|
---|
85 | inline QString pixmapFunction() const
|
---|
86 | { return pixFunction; }
|
---|
87 |
|
---|
88 | inline void setPixmapFunction(const QString &f)
|
---|
89 | { pixFunction = f; }
|
---|
90 |
|
---|
91 | inline bool hasExternalPixmap() const
|
---|
92 | { return externalPix; }
|
---|
93 |
|
---|
94 | inline void setExternalPixmap(bool b)
|
---|
95 | { externalPix = b; }
|
---|
96 |
|
---|
97 | inline const DatabaseInfo *databaseInfo() const
|
---|
98 | { return &info; }
|
---|
99 |
|
---|
100 | inline const CustomWidgetsInfo *customWidgetsInfo() const
|
---|
101 | { return &cWidgetsInfo; }
|
---|
102 |
|
---|
103 | bool write(QIODevice *in);
|
---|
104 |
|
---|
105 | #ifdef QT_UIC_JAVA_GENERATOR
|
---|
106 | bool jwrite(DomUI *ui);
|
---|
107 | #endif
|
---|
108 |
|
---|
109 | #ifdef QT_UIC_CPP_GENERATOR
|
---|
110 | bool write(DomUI *ui);
|
---|
111 | #endif
|
---|
112 |
|
---|
113 | bool isMainWindow(const QString &className) const;
|
---|
114 | bool isToolBar(const QString &className) const;
|
---|
115 | bool isStatusBar(const QString &className) const;
|
---|
116 | bool isButton(const QString &className) const;
|
---|
117 | bool isContainer(const QString &className) const;
|
---|
118 | bool isMenuBar(const QString &className) const;
|
---|
119 | bool isMenu(const QString &className) const;
|
---|
120 |
|
---|
121 | private:
|
---|
122 | // copyright header
|
---|
123 | void writeCopyrightHeader(DomUI *ui);
|
---|
124 | DomUI *parseUiFile(QXmlStreamReader &reader);
|
---|
125 |
|
---|
126 | #ifdef QT_UIC_CPP_GENERATOR
|
---|
127 | // header protection
|
---|
128 | void writeHeaderProtectionStart();
|
---|
129 | void writeHeaderProtectionEnd();
|
---|
130 | #endif
|
---|
131 |
|
---|
132 | private:
|
---|
133 | Driver *drv;
|
---|
134 | QTextStream &out;
|
---|
135 | Option &opt;
|
---|
136 | DatabaseInfo info;
|
---|
137 | CustomWidgetsInfo cWidgetsInfo;
|
---|
138 | QString pixFunction;
|
---|
139 | bool externalPix;
|
---|
140 | };
|
---|
141 |
|
---|
142 | QT_END_NAMESPACE
|
---|
143 |
|
---|
144 | #endif // UIC_H
|
---|