File indexing completed on 2024-06-23 05:18:35
0001 /* 0002 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "plugineditorgrammarcustomtoolsviewinterface.h" 0008 #include <KPIMTextEdit/RichTextComposer> 0009 using namespace MessageComposer; 0010 class MessageComposer::PluginEditorGrammarCustomToolsViewInterfacePrivate 0011 { 0012 public: 0013 QWidget *mParentWidget = nullptr; 0014 KPIMTextEdit::RichTextComposer *mEditor = nullptr; 0015 }; 0016 0017 PluginEditorGrammarCustomToolsViewInterface::PluginEditorGrammarCustomToolsViewInterface(QWidget *parent) 0018 : PimCommon::CustomToolsViewInterface(parent) 0019 , d(new PluginEditorGrammarCustomToolsViewInterfacePrivate) 0020 { 0021 } 0022 0023 PluginEditorGrammarCustomToolsViewInterface::~PluginEditorGrammarCustomToolsViewInterface() = default; 0024 0025 void PluginEditorGrammarCustomToolsViewInterface::setParentWidget(QWidget *parent) 0026 { 0027 d->mParentWidget = parent; 0028 } 0029 0030 QWidget *PluginEditorGrammarCustomToolsViewInterface::parentWidget() const 0031 { 0032 return d->mParentWidget; 0033 } 0034 0035 KPIMTextEdit::RichTextComposer *PluginEditorGrammarCustomToolsViewInterface::richTextEditor() const 0036 { 0037 return d->mEditor; 0038 } 0039 0040 void PluginEditorGrammarCustomToolsViewInterface::setRichTextEditor(KPIMTextEdit::RichTextComposer *richTextEditor) 0041 { 0042 d->mEditor = richTextEditor; 0043 } 0044 0045 PluginGrammarAction::PluginGrammarAction() = default; 0046 0047 QString PluginGrammarAction::replacement() const 0048 { 0049 return mReplacement; 0050 } 0051 0052 void PluginGrammarAction::setReplacement(const QString &replacement) 0053 { 0054 mReplacement = replacement; 0055 } 0056 0057 int PluginGrammarAction::start() const 0058 { 0059 return mStart; 0060 } 0061 0062 void PluginGrammarAction::setStart(int start) 0063 { 0064 mStart = start; 0065 } 0066 0067 int PluginGrammarAction::length() const 0068 { 0069 return mLength; 0070 } 0071 0072 void PluginGrammarAction::setLength(int end) 0073 { 0074 mLength = end; 0075 } 0076 0077 QStringList PluginGrammarAction::suggestions() const 0078 { 0079 return mSuggestions; 0080 } 0081 0082 void PluginGrammarAction::setSuggestions(const QStringList &suggestions) 0083 { 0084 mSuggestions = suggestions; 0085 } 0086 0087 int PluginGrammarAction::blockId() const 0088 { 0089 return mBlockId; 0090 } 0091 0092 void PluginGrammarAction::setBlockId(int blockId) 0093 { 0094 mBlockId = blockId; 0095 } 0096 0097 QStringList PluginGrammarAction::infoUrls() const 0098 { 0099 return mInfoUrls; 0100 } 0101 0102 void PluginGrammarAction::setInfoUrls(const QStringList &urls) 0103 { 0104 mInfoUrls = urls; 0105 } 0106 0107 QDebug operator<<(QDebug d, const PluginGrammarAction &t) 0108 { 0109 d << "start " << t.start(); 0110 d << "length " << t.length(); 0111 d << "blockId " << t.blockId(); 0112 d << "suggestion " << t.suggestions(); 0113 d << "replacement " << t.replacement(); 0114 d << "urls " << t.infoUrls(); 0115 return d; 0116 } 0117 0118 #include "moc_plugineditorgrammarcustomtoolsviewinterface.cpp"