File indexing completed on 2024-10-27 04:50:58

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QObject>
0010 
0011 namespace MessageComposer
0012 {
0013 class PluginEditorCheckBeforeSendInterface;
0014 class PluginEditorCheckBeforeSendParams;
0015 }
0016 
0017 class KMailPluginEditorCheckBeforeSendManagerInterface : public QObject
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit KMailPluginEditorCheckBeforeSendManagerInterface(QObject *parent = nullptr);
0022     ~KMailPluginEditorCheckBeforeSendManagerInterface() override;
0023 
0024     QWidget *parentWidget() const;
0025     void setParentWidget(QWidget *parentWidget);
0026 
0027     // TODO add Identity
0028     // TODO add Emails
0029     // TODO add body ? or editor
0030 
0031     void initializePlugins();
0032     [[nodiscard]] bool execute(const MessageComposer::PluginEditorCheckBeforeSendParams &params) const;
0033 
0034 private:
0035     Q_DISABLE_COPY(KMailPluginEditorCheckBeforeSendManagerInterface)
0036     QList<MessageComposer::PluginEditorCheckBeforeSendInterface *> mListPluginInterface;
0037     QWidget *mParentWidget = nullptr;
0038 };