KTextAddons

textautogeneratemessage.h
1/*
2 SPDX-FileCopyrightText: 2025 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "textautogeneratetext_export.h"
10#include <QDebug>
11namespace TextAutogenerateText
12{
13class TEXTAUTOGENERATETEXT_EXPORT TextAutoGenerateMessage
14{
15 Q_GADGET
16public:
17 enum class Sender : uint8_t {
18 Unknown,
19 User,
20 LLM,
21 };
22 Q_ENUM(Sender)
23
24 TextAutoGenerateMessage();
25 ~TextAutoGenerateMessage();
26
27 [[nodiscard]] QString content() const;
28 void setContent(const QString &newContent);
29
30 [[nodiscard]] TextAutoGenerateMessage::Sender sender() const;
31 void setSender(TextAutoGenerateMessage::Sender newSender);
32
33 [[nodiscard]] qint64 dateTime() const;
34 void setDateTime(qint64 newDateTime);
35
36 [[nodiscard]] bool isValid() const;
37
38 [[nodiscard]] bool inProgress() const;
39 void setInProgress(bool newInProgress);
40
41 [[nodiscard]] bool operator==(const TextAutoGenerateMessage &other) const;
42
43 [[nodiscard]] QByteArray uuid() const;
44 void setUuid(const QByteArray &newUuid);
45
46 [[nodiscard]] QString htmlGenerated() const;
47
48 [[nodiscard]] QByteArray answerUuid() const;
49 void setAnswerUuid(const QByteArray &newAnswerUuid);
50
51private:
52 QByteArray mAnswerUuid;
53 QByteArray mUuid;
54 QString mContent;
55 QString mHtmlGenerated;
56 TextAutoGenerateMessage::Sender mSender = TextAutoGenerateMessage::Sender::Unknown;
57 qint64 mDateTime = -1;
58 bool mInProgress = false;
59};
60}
61Q_DECLARE_TYPEINFO(TextAutogenerateText::TextAutoGenerateMessage, Q_RELOCATABLE_TYPE);
62TEXTAUTOGENERATETEXT_EXPORT QDebug operator<<(QDebug d, const TextAutogenerateText::TextAutoGenerateMessage &t);
bool isValid(QStringView ifopt)
bool operator==(const StyleDelim &l, const StyleDelim &r)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 18 2025 12:00:52 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.