File indexing completed on 2024-06-23 05:18:29

0001 /*
0002    SPDX-FileCopyrightText: 2014-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 <Akonadi/Item>
0011 #include <KJob>
0012 #include <QDate>
0013 #include <QObject>
0014 
0015 #include "messagecomposer_export.h"
0016 
0017 #include <memory>
0018 
0019 namespace MessageComposer
0020 {
0021 class FollowupReminderCreateJobPrivate;
0022 /**
0023  * @brief The FollowupReminderCreateJob class
0024  * @author Laurent Montel <montel@kde.org>
0025  */
0026 class MESSAGECOMPOSER_EXPORT FollowupReminderCreateJob : public KJob
0027 {
0028     Q_OBJECT
0029 public:
0030     explicit FollowupReminderCreateJob(QObject *parent = nullptr);
0031     ~FollowupReminderCreateJob() override;
0032 
0033     void setFollowUpReminderDate(const QDate &date);
0034 
0035     void setOriginalMessageItemId(Akonadi::Item::Id value);
0036 
0037     void setMessageId(const QString &messageId);
0038 
0039     void setTo(const QString &to);
0040 
0041     void setSubject(const QString &subject);
0042 
0043     void setCollectionToDo(const Akonadi::Collection &collection);
0044 
0045     void start() override;
0046 
0047 private Q_SLOTS:
0048     void slotCreateNewTodo(KJob *job);
0049 
0050 private:
0051     MESSAGECOMPOSER_NO_EXPORT void writeFollowupReminderInfo();
0052 
0053     std::unique_ptr<FollowupReminderCreateJobPrivate> const d;
0054 };
0055 }