29 lines
750 B
C++
29 lines
750 B
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QtQml>
|
|
|
|
namespace ZShell::llm {
|
|
|
|
// Marker class exposing the LlmMarkdown block type enum to QML
|
|
// (LlmMarkdown.Type.*). Blocks themselves are value maps produced by
|
|
// MarkdownParser and stored on LlmSegment.
|
|
class LlmMarkdown : public QObject {
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_UNCREATABLE("Blocks are produced by LlmSegment")
|
|
|
|
public:
|
|
enum class Type : int {
|
|
Text = 0, // Paragraph, list, quote, table; "text" is markdown source
|
|
Heading, // "level" + "text" (markdown source of the content)
|
|
Code, // "language" + "code"
|
|
Math // "latex" (display math, without the $$ delimiters)
|
|
};
|
|
Q_ENUM(Type)
|
|
|
|
explicit LlmMarkdown(QObject* parent = nullptr) : QObject(parent) {}
|
|
};
|
|
|
|
} // namespace ZShell::llm
|