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 {
30 None = 0,
31 NeedSelection = 2,
32 NeedMessage = 4,
33 NeedUrl = 8,
34 All = 16
35 };
37 Q_DECLARE_FLAGS(SpecificFeatureTypes, SpecificFeatureType)
38
39 virtual void execute();
40
41 virtual void setText(const QString &text);
42 virtual QList<QAction *> actions() const;
43 virtual void setUrl(const QUrl &url);
44 virtual void setMessage(const KMime::Message::Ptr &value);
45 virtual void setMessageItem(const Akonadi::Item &item);
46 virtual void setCurrentCollection(const Akonadi::Collection &col);
47 virtual void closePlugin();
48 virtual ViewerPluginInterface::SpecificFeatureTypes featureTypes() const = 0;
49 virtual void updateAction(const Akonadi::Item &item);
50 virtual void refreshActionList(KActionCollection *ac);
51
52protected:
53 virtual void showWidget();
54 void addHelpTextAction(QAction *act, const QString &text);
55
56protected Q_SLOTS:
57 void slotActivatePlugin();
58
59Q_SIGNALS:
60 void activatePlugin(MessageViewer::ViewerPluginInterface *);
61
62private:
63 std::unique_ptr<ViewerPluginInterfacePrivate> const d;
64};
65}
The ViewerPluginInterface class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.