Messagelib

plugineditorgrammarcustomtoolsviewinterface.cpp
1 /*
2  SPDX-FileCopyrightText: 2019-2023 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "plugineditorgrammarcustomtoolsviewinterface.h"
8 #include <KPIMTextEdit/RichTextComposer>
9 using namespace MessageComposer;
10 class MessageComposer::PluginEditorGrammarCustomToolsViewInterfacePrivate
11 {
12 public:
13  QWidget *mParentWidget = nullptr;
14  KPIMTextEdit::RichTextComposer *mEditor = nullptr;
15 };
16 
17 PluginEditorGrammarCustomToolsViewInterface::PluginEditorGrammarCustomToolsViewInterface(QWidget *parent)
18  : PimCommon::CustomToolsViewInterface(parent)
19  , d(new PluginEditorGrammarCustomToolsViewInterfacePrivate)
20 {
21 }
22 
23 PluginEditorGrammarCustomToolsViewInterface::~PluginEditorGrammarCustomToolsViewInterface() = default;
24 
25 void PluginEditorGrammarCustomToolsViewInterface::setParentWidget(QWidget *parent)
26 {
27  d->mParentWidget = parent;
28 }
29 
30 QWidget *PluginEditorGrammarCustomToolsViewInterface::parentWidget() const
31 {
32  return d->mParentWidget;
33 }
34 
35 KPIMTextEdit::RichTextComposer *PluginEditorGrammarCustomToolsViewInterface::richTextEditor() const
36 {
37  return d->mEditor;
38 }
39 
40 void PluginEditorGrammarCustomToolsViewInterface::setRichTextEditor(KPIMTextEdit::RichTextComposer *richTextEditor)
41 {
42  d->mEditor = richTextEditor;
43 }
44 
45 PluginGrammarAction::PluginGrammarAction() = default;
46 
47 QString PluginGrammarAction::replacement() const
48 {
49  return mReplacement;
50 }
51 
52 void PluginGrammarAction::setReplacement(const QString &replacement)
53 {
54  mReplacement = replacement;
55 }
56 
57 int PluginGrammarAction::start() const
58 {
59  return mStart;
60 }
61 
62 void PluginGrammarAction::setStart(int start)
63 {
64  mStart = start;
65 }
66 
67 int PluginGrammarAction::length() const
68 {
69  return mLength;
70 }
71 
72 void PluginGrammarAction::setLength(int end)
73 {
74  mLength = end;
75 }
76 
77 QStringList PluginGrammarAction::suggestions() const
78 {
79  return mSuggestions;
80 }
81 
82 void PluginGrammarAction::setSuggestions(const QStringList &suggestions)
83 {
84  mSuggestions = suggestions;
85 }
86 
87 int PluginGrammarAction::blockId() const
88 {
89  return mBlockId;
90 }
91 
92 void PluginGrammarAction::setBlockId(int blockId)
93 {
94  mBlockId = blockId;
95 }
96 
97 QStringList PluginGrammarAction::infoUrls() const
98 {
99  return mInfoUrls;
100 }
101 
102 void PluginGrammarAction::setInfoUrls(const QStringList &urls)
103 {
104  mInfoUrls = urls;
105 }
106 
108 {
109  d << "start " << t.start();
110  d << "length " << t.length();
111  d << "blockId " << t.blockId();
112  d << "suggestion " << t.suggestions();
113  d << "replacement " << t.replacement();
114  d << "urls " << t.infoUrls();
115  return d;
116 }
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
Q_SCRIPTABLE Q_NOREPLY void start()
QDataStream & operator<<(QDataStream &out, const KDateTime &dateTime)
QObject * parent() const const
const QList< QKeySequence > & end()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Mar 24 2023 04:08:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.