Messagelib

plugineditorgrammarcustomtoolsviewinterface.h
1/*
2 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messagecomposer_export.h"
10#include <PimCommon/CustomToolsViewInterface>
11#include <QDebug>
12
13namespace KPIMTextEdit
14{
15class RichTextComposer;
16}
17namespace MessageComposer
18{
19class PluginEditorGrammarCustomToolsViewInterfacePrivate;
20/**
21 * @brief The PluginGrammarAction class
22 * @author Laurent Montel <montel@kde.org>
23 */
24class MESSAGECOMPOSER_EXPORT PluginGrammarAction
25{
26public:
28
29 [[nodiscard]] QString replacement() const;
30 void setReplacement(const QString &replacement);
31
32 [[nodiscard]] int start() const;
33 void setStart(int start);
34
35 [[nodiscard]] int length() const;
36 void setLength(int length);
37
38 [[nodiscard]] QStringList suggestions() const;
39 void setSuggestions(const QStringList &suggestions);
40
41 [[nodiscard]] int blockId() const;
42 void setBlockId(int blockId);
43
44 [[nodiscard]] QStringList infoUrls() const;
45 void setInfoUrls(const QStringList &urls);
46
47private:
48 QStringList mSuggestions;
49 QStringList mInfoUrls;
50 QString mReplacement;
51 int mStart = -1;
52 int mLength = -1;
53 int mBlockId = -1;
54};
55
56/**
57 * @brief The PluginEditorGrammarCustomToolsViewInterface class
58 * @author Laurent Montel <montel@kde.org>
59 */
61{
62 Q_OBJECT
63public:
64 explicit PluginEditorGrammarCustomToolsViewInterface(QWidget *parent = nullptr);
66
67 void setParentWidget(QWidget *parent);
68 [[nodiscard]] QWidget *parentWidget() const;
69
70 [[nodiscard]] KPIMTextEdit::RichTextComposer *richTextEditor() const;
71 void setRichTextEditor(KPIMTextEdit::RichTextComposer *richTextEditor);
72
73Q_SIGNALS:
74 void replaceText(const MessageComposer::PluginGrammarAction &act);
75
76private:
77 std::unique_ptr<PluginEditorGrammarCustomToolsViewInterfacePrivate> const d;
78};
79}
81MESSAGECOMPOSER_EXPORT QDebug operator<<(QDebug d, const MessageComposer::PluginGrammarAction &t);
Q_SCRIPTABLE Q_NOREPLY void start()
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 Fri Jul 26 2024 11:54:19 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.