KTextAddons

textautogeneratemanager.h
1/*
2 SPDX-FileCopyrightText: 2025 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6#pragma once
7#include "textautogeneratetext_export.h"
8#include <KSharedConfig>
9#include <QObject>
10#include <TextAutogenerateText/TextAutoGenerateMessage>
11namespace TextAutogenerateText
12{
14/**
15 * @brief The TextAutogenerateManager class
16 * @author Laurent Montel <montel@kde.org>
17 */
18class TEXTAUTOGENERATETEXT_EXPORT TextAutogenerateManager : public QObject
19{
21public:
22 explicit TextAutogenerateManager(QObject *parent = nullptr);
23 ~TextAutogenerateManager() override;
24
25 static TextAutogenerateManager *self();
26
27 void ask(const QString &msg);
28
29 [[nodiscard]] TextAutoGenerateChatModel *textAutoGenerateChatModel() const;
30
31 virtual void loadHistory();
32 virtual void saveHistory();
33
34 [[nodiscard]] bool showArchived() const;
35 void setShowArchived(bool newShowArchived);
36
38 void sendMessageRequested(const QString &str);
39
40private:
41 [[nodiscard]] TEXTAUTOGENERATETEXT_NO_EXPORT QStringList keyRecorderList(KSharedConfig::Ptr &config) const;
42 TEXTAUTOGENERATETEXT_NO_EXPORT void filterListMessages(QList<TextAutoGenerateMessage> &messages, bool archived) const;
43 TextAutoGenerateChatModel *const mTextAutoGenerateChatModel;
44 bool mShowArchived = false;
45};
46}
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
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.