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

0001 /*
0002   SPDX-FileCopyrightText: 2014 Sandro Knauß <knauss@kolabsys.com>
0003 
0004   SPDX-License-Identifier: GPL-2.0-only
0005 */
0006 
0007 #pragma once
0008 
0009 #include <Akonadi/Collection>
0010 #include <Akonadi/Item>
0011 #include <Akonadi/NoteUtils>
0012 #include <KJob>
0013 
0014 #include <KMime/KMimeMessage>
0015 
0016 class QObject;
0017 
0018 namespace MessageViewer
0019 {
0020 class CreateNoteJob : public KJob
0021 {
0022     Q_OBJECT
0023 public:
0024     explicit CreateNoteJob(const KMime::Message::Ptr &notePtr, const Akonadi::Collection &collection, const Akonadi::Item &item, QObject *parent = nullptr);
0025     ~CreateNoteJob() override;
0026 
0027     void start() override;
0028 
0029 private Q_SLOTS:
0030     void noteCreated(KJob *job);
0031     void noteUpdated(KJob *job);
0032     void relationCreated(KJob *job);
0033 
0034 private:
0035     const Akonadi::Item mItem;
0036     const Akonadi::Collection mCollection;
0037     Akonadi::NoteUtils::NoteMessageWrapper mNote;
0038 };
0039 }