File indexing completed on 2024-06-23 05:18:35

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "messagecomposer_export.h"
0010 #include <QObject>
0011 #include <memory>
0012 namespace MessageComposer
0013 {
0014 class PluginEditorBasePrivate;
0015 /**
0016  * @brief The PluginEditorBase class
0017  * @author Laurent Montel <montel@kde.org>
0018  */
0019 class MESSAGECOMPOSER_EXPORT PluginEditorBase : public QObject
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit PluginEditorBase(QObject *parent = nullptr);
0024     ~PluginEditorBase() override;
0025 
0026     [[nodiscard]] virtual bool hasConfigureDialog() const;
0027 
0028     virtual void showConfigureDialog(QWidget *parent = nullptr);
0029 
0030     void emitConfigChanged();
0031 
0032     [[nodiscard]] virtual QString description() const;
0033 
0034     void setIsEnabled(bool enabled);
0035     [[nodiscard]] bool isEnabled() const;
0036 
0037 Q_SIGNALS:
0038     void configChanged();
0039 
0040 private:
0041     std::unique_ptr<PluginEditorBasePrivate> const d;
0042 };
0043 }