Messagelib

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

KDE's Doxygen guidelines are available online.