createtodojob.h 897 Bytes
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
2
   SPDX-FileCopyrightText: 2014-2020 Laurent Montel <montel@kde.org>
Laurent Montel's avatar
Laurent Montel committed
3

4
   SPDX-License-Identifier: GPL-2.0-or-later
Laurent Montel's avatar
Laurent Montel committed
5
6
7
8
9
10
11
*/

#ifndef CREATETODOJOB_H
#define CREATETODOJOB_H
#include <KJob>
#include <AkonadiCore/Item>
#include <AkonadiCore/Collection>
12
#include <KCalendarCore/Todo>
Laurent Montel's avatar
Laurent Montel committed
13
14

#include <QObject>
Laurent Montel's avatar
Laurent Montel committed
15
namespace MessageViewer {
Laurent Montel's avatar
Laurent Montel committed
16
17
18
19
class CreateTodoJob : public KJob
{
    Q_OBJECT
public:
20
    explicit CreateTodoJob(const KCalendarCore::Todo::Ptr &todoPtr, const Akonadi::Collection &collection, const Akonadi::Item &item, QObject *parent = nullptr);
Laurent Montel's avatar
Laurent Montel committed
21
    ~CreateTodoJob() override;
Laurent Montel's avatar
Laurent Montel committed
22

23
    void start() override;
Laurent Montel's avatar
Laurent Montel committed
24
25
26
27
28
29
30
31
32

private Q_SLOTS:
    void slotFetchDone(KJob *job);
    void todoCreated(KJob *job);
    void relationCreated(KJob *job);

private:
    void createTodo();
    Akonadi::Item mItem;
33
    const Akonadi::Collection mCollection;
34
    KCalendarCore::Todo::Ptr mTodoPtr;
Laurent Montel's avatar
Laurent Montel committed
35
36
37
38
};
}

#endif // CREATETODOJOB_H