File indexing completed on 2025-01-05 04:49:46
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <KCalendarCore/Event> 0010 #include <MessageViewer/ViewerPluginInterface> 0011 class KActionCollection; 0012 namespace MessageViewer 0013 { 0014 class EventEdit; 0015 class ViewerPluginCreateEventInterface : public ViewerPluginInterface 0016 { 0017 Q_OBJECT 0018 public: 0019 explicit ViewerPluginCreateEventInterface(KActionCollection *ac, QWidget *parent = nullptr); 0020 ~ViewerPluginCreateEventInterface() override; 0021 0022 void setText(const QString &text) override; 0023 [[nodiscard]] QList<QAction *> actions() const override; 0024 void setMessage(const KMime::Message::Ptr &value) override; 0025 void closePlugin() override; 0026 void showWidget() override; 0027 void setMessageItem(const Akonadi::Item &item) override; 0028 [[nodiscard]] ViewerPluginInterface::SpecificFeatureTypes featureTypes() const override; 0029 0030 private: 0031 void slotCreateEvent(const KCalendarCore::Event::Ptr &eventPtr, const Akonadi::Collection &collection); 0032 void createAction(KActionCollection *ac); 0033 EventEdit *widget(); 0034 0035 Akonadi::Item mMessageItem; 0036 EventEdit *mEventEdit = nullptr; 0037 QList<QAction *> mAction; 0038 }; 0039 }