KTextAddons

textautogeneratetextplugin.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#include "textautogeneratetext_export.h"
9#include <QObject>
10#include <memory>
11namespace TextAutogenerateText
12{
14/**
15 * @brief The TextAutogenerateTextPlugin class
16 * @author Laurent Montel <montel@kde.org>
17 */
18class TextAutogenerateTextPluginPrivate;
19class TEXTAUTOGENERATETEXT_EXPORT TextAutogenerateTextPlugin : public QObject
20{
21 Q_OBJECT
22public:
23 explicit TextAutogenerateTextPlugin(QObject *parent = nullptr);
24 ~TextAutogenerateTextPlugin() override;
25
26 [[nodiscard]] virtual bool loadSettings() = 0;
27
28 virtual void clear() = 0;
29
30 virtual void setPrompt(const QString &text) = 0;
31
32 void setHasError(bool error);
33
34 [[nodiscard]] bool ready() const;
35 void setReady(bool newReady);
36
37 void sendMessage(const QString &str);
38 virtual void cancelRequest(const QByteArray &uuid) = 0;
39
40 void editMessage(const QByteArray &uuid, const QString &str);
41
42Q_SIGNALS:
43 void errorOccurred(const QString &message);
44 void finished(const TextAutoGenerateMessage &msg);
45
46protected:
47 virtual void sendToLLM(const QString &message, const QByteArray &uuid) = 0;
48
49private:
50 std::unique_ptr<TextAutogenerateTextPluginPrivate> const d;
51};
52}
KGuiItem clear()
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.