Messagelib

plugineditorinterface.cpp
1 /*
2  SPDX-FileCopyrightText: 2015-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "plugineditorinterface.h"
8 #include "plugincomposerinterface.h"
9 
10 using namespace MessageComposer;
11 
12 class MessageComposer::PluginEditorInterfacePrivate
13 {
14 public:
15  PluginEditorInterfacePrivate() = default;
16 
17  ~PluginEditorInterfacePrivate()
18  {
19  delete mComposerInterface;
20  }
21 
22  PluginEditorInterface::ApplyOnFieldTypes mApplyOnFieldTypes = {PluginEditorInterface::ApplyOnFieldType::All};
23  PluginActionType mActionType;
24  QWidget *mParentWidget = nullptr;
25  KPIMTextEdit::RichTextEditor *mRichTextEditor = nullptr;
26  MessageComposer::PluginComposerInterface *mComposerInterface = nullptr;
27  PluginEditor *plugin = nullptr;
28  QWidget *statusBarWidget = nullptr;
29  bool mSelectedText = false;
30 };
31 
32 PluginEditorInterface::PluginEditorInterface(QObject *parent)
33  : PimCommon::AbstractGenericPluginInterface(parent)
34  , d(new MessageComposer::PluginEditorInterfacePrivate)
35 {
36 }
37 
38 PluginEditorInterface::~PluginEditorInterface() = default;
39 
40 void PluginEditorInterface::setActionType(PluginActionType type)
41 {
42  d->mActionType = type;
43 }
44 
45 PluginActionType PluginEditorInterface::actionType() const
46 {
47  return d->mActionType;
48 }
49 
50 KPIMTextEdit::RichTextEditor *PluginEditorInterface::richTextEditor() const
51 {
52  return d->mRichTextEditor;
53 }
54 
55 void PluginEditorInterface::setRichTextEditor(KPIMTextEdit::RichTextEditor *richTextEditor)
56 {
57  d->mRichTextEditor = richTextEditor;
58 }
59 
60 void PluginEditorInterface::setNeedSelectedText(bool b)
61 {
62  d->mSelectedText = b;
63 }
64 
65 bool PluginEditorInterface::needSelectedText() const
66 {
67  return d->mSelectedText;
68 }
69 
70 void PluginEditorInterface::setStatusBarWidget(QWidget *w)
71 {
72  d->statusBarWidget = w;
73 }
74 
75 QWidget *PluginEditorInterface::statusBarWidget() const
76 {
77  return d->statusBarWidget;
78 }
79 
80 PluginComposerInterface *PluginEditorInterface::composerInterface() const
81 {
82  return d->mComposerInterface;
83 }
84 
85 void PluginEditorInterface::setComposerInterface(PluginComposerInterface *w)
86 {
87  d->mComposerInterface = w;
88 }
89 
90 bool PluginEditorInterface::processProcessKeyEvent(QKeyEvent *event)
91 {
92  Q_UNUSED(event)
93  return false;
94 }
95 
96 PluginEditorInterface::ApplyOnFieldTypes PluginEditorInterface::applyOnFieldTypes() const
97 {
98  return d->mApplyOnFieldTypes;
99 }
100 
101 void PluginEditorInterface::setApplyOnFieldTypes(PluginEditorInterface::ApplyOnFieldTypes types)
102 {
103  d->mApplyOnFieldTypes = types;
104 }
virtual bool event(QEvent *e)
The PluginActionType class.
The PluginEditorInterface class.
The PluginComposerInterface class.
The PluginEditor class.
Definition: plugineditor.h:19
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-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.