Messagelib

plugineditorinterface.h
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messagecomposer_export.h"
10#include <MessageComposer/PluginActionType>
11#include <PimCommon/AbstractGenericPluginInterface>
12#include <QObject>
13
14class QKeyEvent;
15namespace TextCustomEditor
16{
17class RichTextEditor;
18}
19
20namespace MessageComposer
21{
22class PluginEditorInterfacePrivate;
23class PluginEditor;
24class PluginComposerInterface;
25/**
26 * @brief The PluginEditorInterface class
27 * @author Laurent Montel <montel@kde.org>
28 */
29class MESSAGECOMPOSER_EXPORT PluginEditorInterface : public PimCommon::AbstractGenericPluginInterface
30{
31 Q_OBJECT
32public:
33 enum ApplyOnFieldType {
34 Composer = 1,
35 EmailFields = 2,
36 SubjectField = 4,
37 All = Composer | EmailFields | SubjectField,
38 };
39 Q_FLAG(ApplyOnFieldType)
40 Q_DECLARE_FLAGS(ApplyOnFieldTypes, ApplyOnFieldType)
41
42 explicit PluginEditorInterface(QObject *parent = nullptr);
43 ~PluginEditorInterface() override;
44
45 void setActionType(PluginActionType type);
46 [[nodiscard]] PluginActionType actionType() const;
47
48 [[nodiscard]] TextCustomEditor::RichTextEditor *richTextEditor() const;
49 void setRichTextEditor(TextCustomEditor::RichTextEditor *richTextEditor);
50
51 void setNeedSelectedText(bool b);
52 [[nodiscard]] bool needSelectedText() const;
53
54 void setStatusBarWidget(QWidget *w);
55 [[nodiscard]] QWidget *statusBarWidget() const;
56
57 [[nodiscard]] MessageComposer::PluginComposerInterface *composerInterface() const;
58 void setComposerInterface(MessageComposer::PluginComposerInterface *w);
59
60 virtual bool processProcessKeyEvent(QKeyEvent *event);
61
62 [[nodiscard]] PluginEditorInterface::ApplyOnFieldTypes applyOnFieldTypes() const;
63
64 void setApplyOnFieldTypes(PluginEditorInterface::ApplyOnFieldTypes types);
65Q_SIGNALS:
66 void emitPluginActivated(MessageComposer::PluginEditorInterface *interface);
67 void insertText(const QString &str);
68
69 void errorMessage(const QString &message);
70 void successMessage(const QString &message);
71
72private:
73 std::unique_ptr<PluginEditorInterfacePrivate> const d;
74};
75}
The Composer class.
Definition composer.h:35
The PluginActionType class.
The PluginEditorInterface 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 Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.