1 | // Copyright (C) 2021 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | #ifndef DOCPRIVATE_H |
4 | #define DOCPRIVATE_H |
5 | |
6 | #include "atom.h" |
7 | #include "config.h" |
8 | #include "codemarker.h" |
9 | #include "doc.h" |
10 | #include "editdistance.h" |
11 | #include "generator.h" |
12 | #include "utilities.h" |
13 | #include "openedlist.h" |
14 | #include "quoter.h" |
15 | #include "text.h" |
16 | #include "tokenizer.h" |
17 | |
18 | #include <QtCore/qdatetime.h> |
19 | #include <QtCore/qfile.h> |
20 | #include <QtCore/qfileinfo.h> |
21 | #include <QtCore/qhash.h> |
22 | #include <QtCore/qmap.h> |
23 | #include <QtCore/qtextstream.h> |
24 | |
25 | #include <cctype> |
26 | #include <climits> |
27 | #include <utility> |
28 | |
29 | QT_BEGIN_NAMESPACE |
30 | |
31 | typedef QMap<QString, ArgList> CommandMap; |
32 | |
33 | struct DocPrivateExtra |
34 | { |
35 | QList<Atom *> m_tableOfContents {}; |
36 | QList<int> m_tableOfContentsLevels {}; |
37 | QList<Atom *> m_keywords {}; |
38 | QList<Atom *> m_targets {}; |
39 | QStringMultiMap m_metaMap {}; |
40 | }; |
41 | |
42 | class DocPrivate |
43 | { |
44 | public: |
45 | explicit DocPrivate(const Location &start = Location(), const Location &end = Location(), |
46 | QString source = QString()) |
47 | : m_start_loc(start), m_end_loc(end), m_src(std::move(source)), m_hasLegalese(false) {}; |
48 | ~DocPrivate(); |
49 | |
50 | void addAlso(const Text &also); |
51 | void constructExtra(); |
52 | void ref() { ++count; } |
53 | bool deref() { return (--count == 0); } |
54 | |
55 | int count { 1 }; |
56 | // ### move some of this in DocPrivateExtra |
57 | Location m_start_loc {}; |
58 | Location m_end_loc {}; |
59 | QString m_src {}; |
60 | Text m_text {}; |
61 | QSet<QString> m_params {}; |
62 | QList<Text> m_alsoList {}; |
63 | QStringList m_enumItemList {}; |
64 | QStringList m_omitEnumItemList {}; |
65 | QSet<QString> m_metacommandsUsed {}; |
66 | CommandMap m_metaCommandMap {}; |
67 | DocPrivateExtra *extra { nullptr }; |
68 | TopicList m_topics {}; |
69 | |
70 | bool m_hasLegalese : 1; |
71 | }; |
72 | |
73 | QT_END_NAMESPACE |
74 | |
75 | #endif // DOCPRIVATE_H |
76 |