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 #include "viewerplugininterface.h"
0008 #include "utils/messageviewerutil_p.h"
0009 #include <QAction>
0010 using namespace MessageViewer;
0011 
0012 class MessageViewer::ViewerPluginInterfacePrivate
0013 {
0014 public:
0015     ViewerPluginInterfacePrivate() = default;
0016 };
0017 
0018 ViewerPluginInterface::ViewerPluginInterface(QObject *parent)
0019     : QObject(parent)
0020     , d(new MessageViewer::ViewerPluginInterfacePrivate)
0021 {
0022 }
0023 
0024 ViewerPluginInterface::~ViewerPluginInterface() = default;
0025 
0026 void ViewerPluginInterface::execute()
0027 {
0028     showWidget();
0029 }
0030 
0031 void ViewerPluginInterface::setText(const QString &text)
0032 {
0033     Q_UNUSED(text)
0034     // Reimplement in subclass.
0035 }
0036 
0037 QList<QAction *> ViewerPluginInterface::actions() const
0038 {
0039     // Reimplement in subclass
0040     return {};
0041 }
0042 
0043 void ViewerPluginInterface::setUrl(const QUrl &url)
0044 {
0045     Q_UNUSED(url)
0046     // Reimplement in subclass
0047 }
0048 
0049 void ViewerPluginInterface::setMessage(const KMime::Message::Ptr &value)
0050 {
0051     Q_UNUSED(value)
0052     // Reimplement in subclass
0053 }
0054 
0055 void ViewerPluginInterface::setMessageItem(const Akonadi::Item &item)
0056 {
0057     Q_UNUSED(item)
0058     // Reimplement in subclass
0059 }
0060 
0061 void ViewerPluginInterface::setCurrentCollection(const Akonadi::Collection &col)
0062 {
0063     Q_UNUSED(col)
0064     // Reimplement in subclass
0065 }
0066 
0067 void ViewerPluginInterface::closePlugin()
0068 {
0069     // Reimplement in subclass
0070 }
0071 
0072 void ViewerPluginInterface::showWidget()
0073 {
0074     // Reimplement in subclass
0075 }
0076 
0077 void ViewerPluginInterface::updateAction(const Akonadi::Item &item)
0078 {
0079     Q_UNUSED(item)
0080     // Reimplement in subclass
0081 }
0082 
0083 void ViewerPluginInterface::refreshActionList(KActionCollection *ac)
0084 {
0085     // TODO
0086     Q_UNUSED(ac)
0087 }
0088 
0089 void ViewerPluginInterface::addHelpTextAction(QAction *act, const QString &text)
0090 {
0091     MessageViewer::Util::addHelpTextAction(act, text);
0092 }
0093 
0094 void ViewerPluginInterface::slotActivatePlugin()
0095 {
0096     Q_EMIT activatePlugin(this);
0097 }
0098 
0099 #include "moc_viewerplugininterface.cpp"