Messagelib

plugineditorinterface.cpp
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "plugineditorinterface.h"
8#include "plugincomposerinterface.h"
9
10using namespace MessageComposer;
11
12class MessageComposer::PluginEditorInterfacePrivate
13{
14public:
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 TextCustomEditor::RichTextEditor *mRichTextEditor = nullptr;
26 MessageComposer::PluginComposerInterface *mComposerInterface = nullptr;
27 PluginEditor *plugin = nullptr;
28 QWidget *statusBarWidget = nullptr;
29 bool mSelectedText = false;
30};
31
32PluginEditorInterface::PluginEditorInterface(QObject *parent)
33 : PimCommon::AbstractGenericPluginInterface(parent)
34 , d(new MessageComposer::PluginEditorInterfacePrivate)
35{
36}
37
38PluginEditorInterface::~PluginEditorInterface() = default;
39
40void PluginEditorInterface::setActionType(PluginActionType type)
41{
42 d->mActionType = type;
43}
44
45PluginActionType PluginEditorInterface::actionType() const
46{
47 return d->mActionType;
48}
49
50TextCustomEditor::RichTextEditor *PluginEditorInterface::richTextEditor() const
51{
52 return d->mRichTextEditor;
53}
54
55void PluginEditorInterface::setRichTextEditor(TextCustomEditor::RichTextEditor *richTextEditor)
56{
57 d->mRichTextEditor = richTextEditor;
58}
59
60void PluginEditorInterface::setNeedSelectedText(bool b)
61{
62 d->mSelectedText = b;
63}
64
65bool PluginEditorInterface::needSelectedText() const
66{
67 return d->mSelectedText;
68}
69
70void PluginEditorInterface::setStatusBarWidget(QWidget *w)
71{
72 d->statusBarWidget = w;
73}
74
75QWidget *PluginEditorInterface::statusBarWidget() const
76{
77 return d->statusBarWidget;
78}
79
80PluginComposerInterface *PluginEditorInterface::composerInterface() const
81{
82 return d->mComposerInterface;
83}
84
85void PluginEditorInterface::setComposerInterface(PluginComposerInterface *w)
86{
87 d->mComposerInterface = w;
88}
89
90bool PluginEditorInterface::processProcessKeyEvent(QKeyEvent *event)
91{
92 Q_UNUSED(event)
93 return false;
94}
95
96PluginEditorInterface::ApplyOnFieldTypes PluginEditorInterface::applyOnFieldTypes() const
97{
98 return d->mApplyOnFieldTypes;
99}
100
101void PluginEditorInterface::setApplyOnFieldTypes(PluginEditorInterface::ApplyOnFieldTypes types)
102{
103 d->mApplyOnFieldTypes = types;
104}
105
106#include "moc_plugineditorinterface.cpp"
The PluginActionType class.
The PluginEditor class.
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 Tue Mar 26 2024 11:12:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.