File indexing completed on 2025-01-05 04:49:46

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 #include <Akonadi/Collection>
0009 #include <Akonadi/Item>
0010 #include <KCalendarCore/Todo>
0011 #include <KJob>
0012 
0013 class QObject;
0014 namespace MessageViewer
0015 {
0016 class CreateTodoJob : public KJob
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit CreateTodoJob(const KCalendarCore::Todo::Ptr &todoPtr,
0021                            const Akonadi::Collection &collection,
0022                            const Akonadi::Item &item,
0023                            QObject *parent = nullptr);
0024     ~CreateTodoJob() override;
0025 
0026     void start() override;
0027 
0028 private Q_SLOTS:
0029     void slotFetchDone(KJob *job);
0030     void todoCreated(KJob *job);
0031     void relationCreated(KJob *job);
0032 
0033 private:
0034     void createTodo();
0035     Akonadi::Item mItem;
0036     const Akonadi::Collection mCollection;
0037     KCalendarCore::Todo::Ptr mTodoPtr;
0038 };
0039 }