C++ / fmt (pull_request) Failing after 6s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 9s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Successful in 30s
Rust / build (pull_request) Successful in 49s
Python / verify (pull_request) Successful in 1m35s
Rust / fmt (pull_request) Successful in 36s
Rust / clippy (pull_request) Successful in 54s
55 lines
1.3 KiB
C++
55 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QtQml>
|
|
|
|
namespace ZShell::llm {
|
|
|
|
class MarkdownBlock : public QObject {
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_UNCREATABLE("Blocks are produced by LlmTextSegment")
|
|
|
|
Q_PROPERTY(Type type READ type CONSTANT)
|
|
Q_PROPERTY(QString id READ id CONSTANT)
|
|
Q_PROPERTY(QString text READ text CONSTANT)
|
|
Q_PROPERTY(QString latex READ latex CONSTANT)
|
|
Q_PROPERTY(QString code READ code CONSTANT)
|
|
Q_PROPERTY(QString language READ language CONSTANT)
|
|
Q_PROPERTY(int level READ level CONSTANT)
|
|
|
|
public:
|
|
enum class Type : int { Text = 0, Heading, Code, Math };
|
|
Q_ENUM(Type)
|
|
|
|
MarkdownBlock(
|
|
Type type,
|
|
const QString& id,
|
|
const QString& text,
|
|
const QString& latex,
|
|
const QString& code,
|
|
const QString& language,
|
|
int level,
|
|
QObject* parent = nullptr);
|
|
|
|
[[nodiscard]] Type type() const { return m_type; }
|
|
[[nodiscard]] QString id() const { return m_id; }
|
|
[[nodiscard]] QString text() const { return m_text; }
|
|
[[nodiscard]] QString latex() const { return m_latex; }
|
|
[[nodiscard]] QString code() const { return m_code; }
|
|
[[nodiscard]] QString language() const { return m_language; }
|
|
[[nodiscard]] int level() const { return m_level; }
|
|
|
|
private:
|
|
Type m_type;
|
|
QString m_id;
|
|
QString m_text;
|
|
QString m_latex;
|
|
QString m_code;
|
|
QString m_language;
|
|
int m_level = 0;
|
|
};
|
|
|
|
} // namespace ZShell::llm
|