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

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/Event>
0011 #include <KJob>
0012 
0013 class QObject;
0014 namespace MessageViewer
0015 {
0016 class CreateEventJob : public KJob
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit CreateEventJob(const KCalendarCore::Event::Ptr &eventPtr,
0021                             const Akonadi::Collection &collection,
0022                             const Akonadi::Item &item,
0023                             QObject *parent = nullptr);
0024     ~CreateEventJob() override;
0025 
0026     void start() override;
0027 
0028 private:
0029     void slotFetchDone(KJob *job);
0030     void slotEventCreated(KJob *job);
0031     void slotRelationCreated(KJob *job);
0032     void createEvent();
0033     Akonadi::Item mItem;
0034     const Akonadi::Collection mCollection;
0035     const KCalendarCore::Event::Ptr mEventPtr;
0036 };
0037 }