Messagelib

plugineditorinterface.h
1 /*
2  SPDX-FileCopyrightText: 2015-2021 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 { Composer = 1, EmailFields = 2, SubjectField = 4, All = Composer | EmailFields | SubjectField };
34  Q_FLAG(ApplyOnFieldType)
35  Q_DECLARE_FLAGS(ApplyOnFieldTypes, ApplyOnFieldType)
36 
37  explicit PluginEditorInterface(QObject *parent = nullptr);
38  ~PluginEditorInterface() override;
39 
40  void setActionType(PluginActionType type);
41  Q_REQUIRED_RESULT PluginActionType actionType() const;
42 
43  Q_REQUIRED_RESULT KPIMTextEdit::RichTextEditor *richTextEditor() const;
44  void setRichTextEditor(KPIMTextEdit::RichTextEditor *richTextEditor);
45 
46  void setNeedSelectedText(bool b);
47  Q_REQUIRED_RESULT bool needSelectedText() const;
48 
49  void setStatusBarWidget(QWidget *w);
50  Q_REQUIRED_RESULT QWidget *statusBarWidget() const;
51 
52  Q_REQUIRED_RESULT MessageComposer::PluginComposerInterface *composerInterface() const;
53  void setComposerInterface(MessageComposer::PluginComposerInterface *w);
54 
55  virtual bool processProcessKeyEvent(QKeyEvent *event);
56 
57  Q_REQUIRED_RESULT PluginEditorInterface::ApplyOnFieldTypes applyOnFieldTypes() const;
58 
59  void setApplyOnFieldTypes(PluginEditorInterface::ApplyOnFieldTypes types);
60 Q_SIGNALS:
61  void emitPluginActivated(MessageComposer::PluginEditorInterface *interface);
62  void insertText(const QString &str);
63 
64 private:
65  std::unique_ptr<PluginEditorInterfacePrivate> const d;
66 };
67 }
68 
The Composer class.
Definition: composer.h:33
PartitionTable::TableType type
The PluginActionType class.
The PluginEditorInterface class.
The PluginComposerInterface 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-2021 The KDE developers.
Generated on Thu Dec 2 2021 23:06:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.