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{
13/**
14 * @brief The TextAutoGenerateMessage class
15 * @author Laurent Montel <montel@kde.org>
16 */
17class TEXTAUTOGENERATETEXT_EXPORT TextAutoGenerateMessage
18{
19 Q_GADGET
20public:
21 enum class Sender : uint8_t {
22 Unknown,
23 User,
24 LLM,
25 };
26 Q_ENUM(Sender)
27
28 TextAutoGenerateMessage();
29 ~TextAutoGenerateMessage();
30
31 [[nodiscard]] QString content() const;
32 void setContent(const QString &newContent);
33
34 [[nodiscard]] TextAutoGenerateMessage::Sender sender() const;
35 void setSender(TextAutoGenerateMessage::Sender newSender);
36
37 [[nodiscard]] qint64 dateTime() const;
38 void setDateTime(qint64 newDateTime);
39
40 [[nodiscard]] bool isValid() const;
41
42 [[nodiscard]] bool inProgress() const;
43 void setInProgress(bool newInProgress);
44
45 [[nodiscard]] bool operator==(const TextAutoGenerateMessage &other) const;
46
47 [[nodiscard]] QByteArray uuid() const;
48 void setUuid(const QByteArray &newUuid);
49
50 [[nodiscard]] QString htmlGenerated() const;
51
52 [[nodiscard]] QByteArray answerUuid() const;
53 void setAnswerUuid(const QByteArray &newAnswerUuid);
54
55 [[nodiscard]] QString topic() const;
56 void setTopic(const QString &newTopic);
57
58 [[nodiscard]] QString dateTimeStr() const;
59
60 [[nodiscard]] bool mouseHover() const;
61 void setMouseHover(bool newMouseHover);
62
63 [[nodiscard]] bool archived() const;
64 void setArchived(bool newArchived);
65
66 [[nodiscard]] bool editingMode() const;
67 void setEditingMode(bool newEditingMode);
68
69private:
70 QByteArray mAnswerUuid;
71 QByteArray mUuid;
72 QString mContent;
73 QString mHtmlGenerated;
74 QString mTopic;
75 QString mDateTimeStr;
76 TextAutoGenerateMessage::Sender mSender = TextAutoGenerateMessage::Sender::Unknown;
77 qint64 mDateTime = -1;
78 bool mInProgress = false;
79 bool mMouseHover = false;
80 bool mArchived = false;
81 bool mEditingMode = false;
82};
83}
84Q_DECLARE_TYPEINFO(TextAutogenerateText::TextAutoGenerateMessage, Q_RELOCATABLE_TYPE);
85TEXTAUTOGENERATETEXT_EXPORT QDebug operator<<(QDebug d, const TextAutogenerateText::TextAutoGenerateMessage &t);
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 12:06:03 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.