Messagelib

plugineditorconverttextinterface.cpp
1 /*
2  SPDX-FileCopyrightText: 2018-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "plugineditorconverttextinterface.h"
8 #include "plugineditorconverterbeforeconvertingdata.h"
9 #include "plugineditorconverterinitialdata.h"
10 
11 #include <KActionCollection>
12 
13 using namespace MessageComposer;
14 
15 class MessageComposer::PluginEditorConvertTextInterfacePrivate
16 {
17 public:
18  PluginEditorConvertTextInterfacePrivate() = default;
19 
20  QVector<PluginActionType> mActionTypes;
21 
22  QWidget *mParentWidget = nullptr;
23  QWidget *statusBarWidget = nullptr;
24  PluginEditorConvertText *plugin = nullptr;
25  KPIMTextEdit::RichTextComposer *mEditor = nullptr;
27  PluginEditorConverterBeforeConvertingData mBeforeConvertingData;
28 };
29 
30 PluginEditorConvertTextInterface::PluginEditorConvertTextInterface(QObject *parent)
31  : QObject(parent)
32  , d(new MessageComposer::PluginEditorConvertTextInterfacePrivate)
33 {
34 }
35 
36 PluginEditorConvertTextInterface::~PluginEditorConvertTextInterface() = default;
37 
38 bool PluginEditorConvertTextInterface::reformatText()
39 {
40  return false;
41 }
42 
43 void PluginEditorConvertTextInterface::setParentWidget(QWidget *parent)
44 {
45  d->mParentWidget = parent;
46 }
47 
48 QWidget *PluginEditorConvertTextInterface::parentWidget() const
49 {
50  return d->mParentWidget;
51 }
52 
53 void PluginEditorConvertTextInterface::setActionType(const QVector<PluginActionType> &type)
54 {
55  d->mActionTypes = type;
56 }
57 
58 QVector<PluginActionType> PluginEditorConvertTextInterface::actionTypes() const
59 {
60  return d->mActionTypes;
61 }
62 
63 void PluginEditorConvertTextInterface::addActionType(PluginActionType type)
64 {
65  d->mActionTypes += type;
66 }
67 
68 void PluginEditorConvertTextInterface::createAction(KActionCollection *ac)
69 {
70  Q_UNUSED(ac)
71 }
72 
73 void PluginEditorConvertTextInterface::setInitialData(const PluginEditorConverterInitialData &data)
74 {
75  d->mInitialData = data;
76 }
77 
78 PluginEditorConverterInitialData PluginEditorConvertTextInterface::initialData() const
79 {
80  return d->mInitialData;
81 }
82 
83 void PluginEditorConvertTextInterface::setBeforeConvertingData(const PluginEditorConverterBeforeConvertingData &data)
84 {
85  d->mBeforeConvertingData = data;
86 }
87 
88 PluginEditorConverterBeforeConvertingData PluginEditorConvertTextInterface::beforeConvertingData() const
89 {
90  return d->mBeforeConvertingData;
91 }
92 
93 KPIMTextEdit::RichTextComposer *PluginEditorConvertTextInterface::richTextEditor() const
94 {
95  return d->mEditor;
96 }
97 
98 void PluginEditorConvertTextInterface::setRichTextEditor(KPIMTextEdit::RichTextComposer *richTextEditor)
99 {
100  d->mEditor = richTextEditor;
101 }
102 
103 void PluginEditorConvertTextInterface::reloadConfig()
104 {
105  // Reimplement it
106 }
107 
108 void PluginEditorConvertTextInterface::enableDisablePluginActions(bool richText)
109 {
110  Q_UNUSED(richText)
111 }
112 
113 void PluginEditorConvertTextInterface::setStatusBarWidget(QWidget *w)
114 {
115  d->statusBarWidget = w;
116 }
117 
118 QWidget *PluginEditorConvertTextInterface::statusBarWidget() const
119 {
120  return d->statusBarWidget;
121 }
122 
123 void PluginEditorConvertTextInterface::setPlugin(PluginEditorConvertText *plugin)
124 {
125  d->plugin = plugin;
126 }
127 
128 PluginEditorConvertText *PluginEditorConvertTextInterface::plugin() const
129 {
130  return d->plugin;
131 }
The PluginEditorConvertText class.
The PluginActionType class.
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:04:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.