Mercurial > projects > qtd
annotate generator/containergenerator.h @ 259:515d6e1c7b10 lifetime
another iteration
author | maxter |
---|---|
date | Thu, 17 Sep 2009 16:28:41 +0000 |
parents | ae06da58ec25 |
children |
rev | line source |
---|---|
1 | 1 /**************************************************************************** |
2 ** | |
3 ** Copyright (C) 1992-2008 Nokia. All rights reserved. | |
4 ** | |
5 ** This file is part of Qt Jambi. | |
6 ** | |
7 ** * Commercial Usage | |
8 * Licensees holding valid Qt Commercial licenses may use this file in | |
9 * accordance with the Qt Commercial License Agreement provided with the | |
10 * Software or, alternatively, in accordance with the terms contained in | |
11 * a written agreement between you and Nokia. | |
12 * | |
13 * | |
14 * GNU General Public License Usage | |
15 * Alternatively, this file may be used under the terms of the GNU | |
16 * General Public License versions 2.0 or 3.0 as published by the Free | |
17 * Software Foundation and appearing in the file LICENSE.GPL included in | |
18 * the packaging of this file. Please review the following information | |
19 * to ensure GNU General Public Licensing requirements will be met: | |
20 * http://www.fsf.org/licensing/licenses/info/GPLv2.html and | |
21 * http://www.gnu.org/copyleft/gpl.html. In addition, as a special | |
22 * exception, Nokia gives you certain additional rights. These rights | |
23 * are described in the Nokia Qt GPL Exception version 1.2, included in | |
24 * the file GPL_EXCEPTION.txt in this package. | |
25 * | |
26 * Qt for Windows(R) Licensees | |
27 * As a special exception, Nokia, as the sole copyright holder for Qt | |
28 * Designer, grants users of the Qt/Eclipse Integration plug-in the | |
29 * right for the Qt/Eclipse Integration to link to functionality | |
30 * provided by Qt Designer and its related libraries. | |
31 * | |
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 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | |
38 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
39 ** | |
40 ****************************************************************************/ | |
41 | |
42 #ifndef CONTAINERGENERATOR_H | |
43 #define CONTAINERGENERATOR_H | |
44 | |
45 #include "dgenerator.h" | |
46 #include "metajava.h" | |
47 #include "prigenerator.h" | |
48 | |
49 const int NUM_ARRAY_FUNCS = 3; | |
50 | |
51 class ContainerGenerator : public DGenerator | |
52 { | |
53 Q_OBJECT | |
54 | |
55 public: | |
56 enum OutputDirectoryType { | |
57 CppDirectory, | |
58 DDirectory, | |
59 HDirectory | |
60 }; | |
61 | |
62 typedef void (ContainerGenerator::*WriteOut)(QTextStream &s, AbstractMetaClass *cls); | |
63 | |
167
ae06da58ec25
fixed hacky conversion of arguments when emmitting a signal
eldar
parents:
1
diff
changeset
|
64 ContainerGenerator(CppImplGenerator *cpp_impl_generator); |
1 | 65 |
66 virtual void generate(); | |
67 virtual void write(QTextStream &s, const AbstractMetaClass *java_class); | |
68 void writeFile(const QString& fileName, OutputDirectoryType dirType, WriteOut writeOut); | |
69 | |
70 // base functions for operating with arrays | |
71 void writeHeaderContent(QTextStream &s, AbstractMetaClass *cls); | |
72 void writeCppContent(QTextStream &s, AbstractMetaClass *cls); | |
73 void writeDContent(QTextStream &s, AbstractMetaClass *cls); | |
167
ae06da58ec25
fixed hacky conversion of arguments when emmitting a signal
eldar
parents:
1
diff
changeset
|
74 void writeDContent2(QTextStream &s, AbstractMetaClass *cls); |
1 | 75 |
76 void buildTypeList(); | |
77 | |
78 void processFunction(const AbstractMetaFunction *d_function); | |
79 void processType(AbstractMetaType *d_type); | |
80 void addTypeEntry(const TypeEntry* te); | |
81 | |
82 virtual QString subDirectoryForPackage(const QString &package, OutputDirectoryType type) const; | |
83 | |
84 void setFilenameStub(const QString &stub) { m_filenameStub = stub; } | |
85 QString filenameStub() const { return m_filenameStub; } | |
86 | |
87 QString headerFilename() const { return filenameStub() + ".h"; } | |
88 QString cppFilename() const { return filenameStub() + "_shell.cpp"; } | |
89 QString dFilename() const { return filenameStub() + ".d"; } | |
90 | |
91 private: | |
92 virtual void writeArrayFunctions(QTextStream &s, const ComplexTypeEntry *centry); | |
93 void writeHeaderArrayFunctions(QTextStream &s, const ComplexTypeEntry *centry); | |
94 void writeNotice(QTextStream &s); | |
95 | |
96 void setFuncNames(const QString& cls_name); | |
97 | |
98 QString m_filenameStub; | |
99 QSet<const TypeEntry*> containerTypes; | |
100 // QSet< QPair<const TypeEntry*, AbstractMetaClass*> > containerTypes; | |
101 AbstractMetaClass* m_class; | |
102 | |
103 QString all_name, ass_name, get_name; | |
167
ae06da58ec25
fixed hacky conversion of arguments when emmitting a signal
eldar
parents:
1
diff
changeset
|
104 // QMap<QString, QMap<const TypeEntry*, AbstractMetaType*> > signalEntries; |
ae06da58ec25
fixed hacky conversion of arguments when emmitting a signal
eldar
parents:
1
diff
changeset
|
105 QMap<QString, QSet<AbstractMetaType*> > signalEntries; |
ae06da58ec25
fixed hacky conversion of arguments when emmitting a signal
eldar
parents:
1
diff
changeset
|
106 |
ae06da58ec25
fixed hacky conversion of arguments when emmitting a signal
eldar
parents:
1
diff
changeset
|
107 CppImplGenerator *m_cpp_impl_generator; |
1 | 108 }; |
109 | |
110 #endif // CONTAINERGENERATOR_H |