File indexing completed on 2025-01-19 04:46:57
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 <Akonadi/Collection> 0010 #include <KCalendarCore/Todo> 0011 #include <MessageViewer/ViewerPluginInterface> 0012 class KActionCollection; 0013 namespace MessageViewer 0014 { 0015 class TodoEdit; 0016 class ViewerPluginCreateTodoInterface : public ViewerPluginInterface 0017 { 0018 Q_OBJECT 0019 public: 0020 explicit ViewerPluginCreateTodoInterface(KActionCollection *ac, QWidget *parent = nullptr); 0021 ~ViewerPluginCreateTodoInterface() override; 0022 0023 void setText(const QString &text) override; 0024 QList<QAction *> actions() const override; 0025 void setMessage(const KMime::Message::Ptr &value) override; 0026 void closePlugin() override; 0027 void showWidget() override; 0028 void setMessageItem(const Akonadi::Item &item) override; 0029 ViewerPluginInterface::SpecificFeatureTypes featureTypes() const override; 0030 void setCurrentCollection(const Akonadi::Collection &col) override; 0031 0032 private: 0033 void slotCreateTodo(const KCalendarCore::Todo::Ptr &todoPtr, const Akonadi::Collection &collection); 0034 void createAction(KActionCollection *ac); 0035 TodoEdit *widget(); 0036 0037 TodoEdit *mTodoEdit = nullptr; 0038 QList<QAction *> mAction; 0039 Akonadi::Item mMessageItem; 0040 }; 0041 }