Messagelib

plugineditorinterface.h
1 /*
2  SPDX-FileCopyrightText: 2015-2023 Laurent Montel <[email protected]>
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 
14 class QKeyEvent;
15 namespace KPIMTextEdit
16 {
17 class RichTextEditor;
18 }
19 
20 namespace MessageComposer
21 {
22 class PluginEditorInterfacePrivate;
23 class PluginEditor;
24 class PluginComposerInterface;
25 /**
26  * @brief The PluginEditorInterface class
27  * @author Laurent Montel <[email protected]>
28  */
29 class MESSAGECOMPOSER_EXPORT PluginEditorInterface : public PimCommon::AbstractGenericPluginInterface
30 {
31  Q_OBJECT
32 public:
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  Q_REQUIRED_RESULT PluginActionType actionType() const;
47 
48  Q_REQUIRED_RESULT KPIMTextEdit::RichTextEditor *richTextEditor() const;
49  void setRichTextEditor(KPIMTextEdit::RichTextEditor *richTextEditor);
50 
51  void setNeedSelectedText(bool b);
52  Q_REQUIRED_RESULT bool needSelectedText() const;
53 
54  void setStatusBarWidget(QWidget *w);
55  Q_REQUIRED_RESULT QWidget *statusBarWidget() const;
56 
57  Q_REQUIRED_RESULT MessageComposer::PluginComposerInterface *composerInterface() const;
58  void setComposerInterface(MessageComposer::PluginComposerInterface *w);
59 
60  virtual bool processProcessKeyEvent(QKeyEvent *event);
61 
62  Q_REQUIRED_RESULT PluginEditorInterface::ApplyOnFieldTypes applyOnFieldTypes() const;
63 
64  void setApplyOnFieldTypes(PluginEditorInterface::ApplyOnFieldTypes types);
65 Q_SIGNALS:
66  void emitPluginActivated(MessageComposer::PluginEditorInterface *interface);
67  void insertText(const QString &str);
68 
69 private:
70  std::unique_ptr<PluginEditorInterfacePrivate> const d;
71 };
72 }
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The PluginActionType class.
The Composer class.
Definition: composer.h:33
The PluginEditorInterface class.
The PluginComposerInterface class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:08:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.