Messagelib

viewerplugininterface.h
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messageviewer_export.h"
10#include <Akonadi/Item>
11#include <KMime/Message>
12#include <QObject>
13
14class QAction;
16namespace MessageViewer
17{
18class ViewerPluginInterfacePrivate;
19/**
20 * @brief The ViewerPluginInterface class
21 * @author Laurent Montel <montel@kde.org>
22 */
23class MESSAGEVIEWER_EXPORT ViewerPluginInterface : public QObject
24{
25 Q_OBJECT
26public:
27 explicit ViewerPluginInterface(QObject *parent = nullptr);
28 ~ViewerPluginInterface() override;
29 enum SpecificFeatureType { None = 0, NeedSelection = 2, NeedMessage = 4, NeedUrl = 8, All = 16 };
31 Q_DECLARE_FLAGS(SpecificFeatureTypes, SpecificFeatureType)
32
33 virtual void execute();
34
35 virtual void setText(const QString &text);
36 virtual QList<QAction *> actions() const;
37 virtual void setUrl(const QUrl &url);
38 virtual void setMessage(const KMime::Message::Ptr &value);
39 virtual void setMessageItem(const Akonadi::Item &item);
40 virtual void setCurrentCollection(const Akonadi::Collection &col);
41 virtual void closePlugin();
42 virtual ViewerPluginInterface::SpecificFeatureTypes featureTypes() const = 0;
43 virtual void updateAction(const Akonadi::Item &item);
44 virtual void refreshActionList(KActionCollection *ac);
45
46protected:
47 virtual void showWidget();
48 void addHelpTextAction(QAction *act, const QString &text);
49
50protected Q_SLOTS:
51 void slotActivatePlugin();
52
53Q_SIGNALS:
54 void activatePlugin(MessageViewer::ViewerPluginInterface *);
55
56private:
57 std::unique_ptr<ViewerPluginInterfacePrivate> const d;
58};
59}
The ViewerPluginInterface class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:56:57 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.