Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /**************************************************************************** |
---|---|
2 | ** |
3 | ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). |
4 | ** Contact: http://www.qt-project.org/legal |
5 | ** |
6 | ** This file is part of the tools applications 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 Digia. For licensing terms and |
14 | ** conditions see http://qt.digia.com/licensing. For further information |
15 | ** use the contact form at http://qt.digia.com/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 as published by the Free Software |
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the |
21 | ** packaging of this file. Please review the following information to |
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements |
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
24 | ** |
25 | ** In addition, as a special exception, Digia gives you certain additional |
26 | ** rights. These rights are described in the Digia Qt LGPL Exception |
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
28 | ** |
29 | ** GNU General Public License Usage |
30 | ** Alternatively, this file may be used under the terms of the GNU |
31 | ** General Public License version 3.0 as published by the Free Software |
32 | ** Foundation and appearing in the file LICENSE.GPL included in the |
33 | ** packaging of this file. Please review the following information to |
34 | ** ensure the GNU General Public License version 3.0 requirements will be |
35 | ** met: http://www.gnu.org/copyleft/gpl.html. |
36 | ** |
37 | ** |
38 | ** $QT_END_LICENSE$ |
39 | ** |
40 | ****************************************************************************/ |
41 | |
42 | #ifndef HELPPROJECTWRITER_H |
43 | #define HELPPROJECTWRITER_H |
44 | |
45 | #include <QString> |
46 | #include <QXmlStreamReader> |
47 | #include <QXmlStreamWriter> |
48 | |
49 | #include "config.h" |
50 | #include "node.h" |
51 | |
52 | QT_BEGIN_NAMESPACE |
53 | |
54 | class Tree; |
55 | typedef QPair<QString, const Node*> QStringNodePair; |
56 | |
57 | struct SubProject |
58 | { |
59 | QString title; |
60 | QString indexTitle; |
61 | QHash<Node::Type, QSet<FakeNode::SubType> > selectors; |
62 | bool sortPages; |
63 | QString type; |
64 | QHash<QString, const Node *> nodes; |
65 | }; |
66 | |
67 | struct HelpProject |
68 | { |
69 | QString name; |
70 | QString helpNamespace; |
71 | QString virtualFolder; |
72 | QString fileName; |
73 | QString indexRoot; |
74 | QString indexTitle; |
75 | QList<QStringList> keywords; |
76 | QSet<QString> files; |
77 | QSet<QString> extraFiles; |
78 | QSet<QString> filterAttributes; |
79 | QHash<QString, QSet<QString> > customFilters; |
80 | QSet<QString> excluded; |
81 | QMap<QString, SubProject> subprojects; |
82 | QHash<const Node *, QSet<Node::Status> > memberStatus; |
83 | }; |
84 | |
85 | class HelpProjectWriter |
86 | { |
87 | public: |
88 | HelpProjectWriter(const Config &config, const QString &defaultFileName); |
89 | void addExtraFile(const QString &file); |
90 | void addExtraFiles(const QSet<QString> &files); |
91 | void generate(const Tree *tre); |
92 | |
93 | private: |
94 | void generateProject(HelpProject &project); |
95 | void generateSections(HelpProject &project, QXmlStreamWriter &writer, |
96 | const Node *node); |
97 | bool generateSection(HelpProject &project, QXmlStreamWriter &writer, |
98 | const Node *node); |
99 | QStringList keywordDetails(const Node *node) const; |
100 | void writeNode(HelpProject &project, QXmlStreamWriter &writer, const Node *node); |
101 | void readSelectors(SubProject &subproject, const QStringList &selectors); |
102 | |
103 | const Tree *tree; |
104 | |
105 | QString outputDir; |
106 | QList<HelpProject> projects; |
107 | }; |
108 | |
109 | QT_END_NAMESPACE |
110 | |
111 | #endif |
112 |
Warning: That file was not part of the compilation database. It may have many parsing errors.