summaryrefslogtreecommitdiffstats
path: root/src/qdoc/qdoc/src/qdoc/qmlcodemarker.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qdoc/qdoc/src/qdoc/qmlcodemarker.h')
-rw-r--r--src/qdoc/qdoc/src/qdoc/qmlcodemarker.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/qdoc/qdoc/src/qdoc/qmlcodemarker.h b/src/qdoc/qdoc/src/qdoc/qmlcodemarker.h
new file mode 100644
index 000000000..64a1f7c9f
--- /dev/null
+++ b/src/qdoc/qdoc/src/qdoc/qmlcodemarker.h
@@ -0,0 +1,38 @@
+// 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 QMLCODEMARKER_H
+#define QMLCODEMARKER_H
+
+#include "cppcodemarker.h"
+
+#include <private/qqmljsastfwd_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QmlCodeMarker : public CppCodeMarker
+{
+public:
+ QmlCodeMarker() = default;
+ ~QmlCodeMarker() override = default;
+
+ bool recognizeCode(const QString &code) override;
+ bool recognizeExtension(const QString &ext) override;
+ bool recognizeLanguage(const QString &language) override;
+ [[nodiscard]] Atom::AtomType atomType() const override;
+ QString markedUpCode(const QString &code, const Node *relative,
+ const Location &location) override;
+
+ QString markedUpName(const Node *node) override;
+ QString markedUpInclude(const QString &include) override;
+
+ /* Copied from src/declarative/qml/qdeclarativescriptparser.cpp */
+ QList<QQmlJS::SourceLocation> extractPragmas(QString &script);
+
+private:
+ QString addMarkUp(const QString &code, const Node *relative, const Location &location);
+};
+
+QT_END_NAMESPACE
+
+#endif