comparison tools/duic/uic.h @ 1:e78566595089

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