summaryrefslogtreecommitdiffstats
path: root/src/qdoc/qdoc/src/qdoc/namespacenode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qdoc/qdoc/src/qdoc/namespacenode.h')
-rw-r--r--src/qdoc/qdoc/src/qdoc/namespacenode.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/qdoc/qdoc/src/qdoc/namespacenode.h b/src/qdoc/qdoc/src/qdoc/namespacenode.h
new file mode 100644
index 000000000..80d068838
--- /dev/null
+++ b/src/qdoc/qdoc/src/qdoc/namespacenode.h
@@ -0,0 +1,48 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef NAMESPACENODE_H
+#define NAMESPACENODE_H
+
+#include "aggregate.h"
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qstring.h>
+
+QT_BEGIN_NAMESPACE
+
+class Tree;
+
+class NamespaceNode : public Aggregate
+{
+public:
+ NamespaceNode(Aggregate *parent, const QString &name) : Aggregate(Namespace, parent, name) {}
+ ~NamespaceNode() override = default;
+ [[nodiscard]] Tree *tree() const override { return (parent() ? parent()->tree() : m_tree); }
+
+ [[nodiscard]] bool isFirstClassAggregate() const override { return true; }
+ [[nodiscard]] bool isRelatableType() const override { return true; }
+ [[nodiscard]] bool wasSeen() const override { return m_seen; }
+ void markSeen() { m_seen = true; }
+ void setTree(Tree *t) { m_tree = t; }
+ [[nodiscard]] const NodeList &includedChildren() const;
+ void includeChild(Node *child);
+ void setWhereDocumented(const QString &t) { m_whereDocumented = t; }
+ [[nodiscard]] bool isDocumentedHere() const;
+ [[nodiscard]] bool hasDocumentedChildren() const;
+ void reportDocumentedChildrenInUndocumentedNamespace() const;
+ [[nodiscard]] bool docMustBeGenerated() const override;
+ void setDocNode(NamespaceNode *ns) { m_docNode = ns; }
+ [[nodiscard]] NamespaceNode *docNode() const { return m_docNode; }
+
+private:
+ bool m_seen { false };
+ Tree *m_tree { nullptr };
+ QString m_whereDocumented {};
+ NamespaceNode *m_docNode { nullptr };
+ NodeList m_includedChildren {};
+};
+
+QT_END_NAMESPACE
+
+#endif // NAMESPACENODE_H