File indexing completed on 2025-03-09 04:54:44

0001 /*
0002    SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "messageviewer_export.h"
0010 #include <QObject>
0011 #include <memory>
0012 class KActionCollection;
0013 
0014 namespace MessageViewer
0015 {
0016 class ViewerPluginPrivate;
0017 class ViewerPluginInterface;
0018 /**
0019  * @brief The ViewerPlugin class
0020  * @author Laurent Montel <montel@kde.org>
0021  */
0022 class MESSAGEVIEWER_EXPORT ViewerPlugin : public QObject
0023 {
0024     Q_OBJECT
0025 public:
0026     explicit ViewerPlugin(QObject *parent = nullptr);
0027     ~ViewerPlugin() override;
0028 
0029     [[nodiscard]] virtual MessageViewer::ViewerPluginInterface *createView(QWidget *parent, KActionCollection *ac) = 0;
0030     [[nodiscard]] virtual QString viewerPluginName() const = 0;
0031     virtual void showConfigureDialog(QWidget *parent = nullptr);
0032     [[nodiscard]] virtual bool hasConfigureDialog() 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<ViewerPluginPrivate> const d;
0042 };
0043 }