Messagelib

plugineditorconverttextinterface.h
1/*
2 SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messagecomposer_export.h"
10#include <KMime/Message>
11#include <MessageComposer/PluginActionType>
12#include <QObject>
13
14namespace KPIMTextEdit
15{
16class RichTextComposer;
17}
19namespace MessageComposer
20{
21class TextPart;
22class PluginEditorConvertTextInterfacePrivate;
23class PluginEditorConverterInitialData;
24class PluginEditorConverterBeforeConvertingData;
25class PluginEditorConvertText;
26/**
27 * @brief The PluginEditorConvertTextInterface class
28 * @author Laurent Montel <montel@kde.org>
29 */
30class MESSAGECOMPOSER_EXPORT PluginEditorConvertTextInterface : public QObject
31{
32 Q_OBJECT
33public:
34 explicit PluginEditorConvertTextInterface(QObject *parent = nullptr);
36
37 enum class ConvertTextStatus : uint8_t {
38 NotConverted,
39 Converted,
40 Error,
41 };
42
43 virtual bool reformatText();
44
45 [[nodiscard]] virtual PluginEditorConvertTextInterface::ConvertTextStatus convertTextToFormat(MessageComposer::TextPart *textPart) = 0;
46
47 void setParentWidget(QWidget *parent);
48 [[nodiscard]] QWidget *parentWidget() const;
49
50 [[nodiscard]] KPIMTextEdit::RichTextComposer *richTextEditor() const;
51 void setRichTextEditor(KPIMTextEdit::RichTextComposer *richTextEditor);
52
53 void setActionType(const QList<PluginActionType> &type);
54 void addActionType(PluginActionType type);
55 [[nodiscard]] QList<PluginActionType> actionTypes() const;
56
57 virtual void createAction(KActionCollection *ac);
58
59 virtual void setInitialData(const PluginEditorConverterInitialData &data);
60 [[nodiscard]] PluginEditorConverterInitialData initialData() const;
61
62 virtual void setBeforeConvertingData(const PluginEditorConverterBeforeConvertingData &data);
63 [[nodiscard]] PluginEditorConverterBeforeConvertingData beforeConvertingData() const;
64
65 virtual void enableDisablePluginActions(bool richText);
66
67 void setStatusBarWidget(QWidget *w);
68
69 [[nodiscard]] QWidget *statusBarWidget() const;
70
71 void setPlugin(PluginEditorConvertText *plugin);
72 [[nodiscard]] PluginEditorConvertText *plugin() const;
73
74public Q_SLOTS:
75 virtual void reloadConfig();
76
77Q_SIGNALS:
78 void textReformated();
79
80private:
81 std::unique_ptr<PluginEditorConvertTextInterfacePrivate> const d;
82};
83}
The PluginActionType class.
The TextPart class.
Definition textpart.h:21
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.