File indexing completed on 2024-11-24 04:44:17

0001 /*
0002     SPDX-FileCopyrightText: 2014 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
0003     SPDX-FileContributor: Kevin Krammer <kevin.krammer@kdab.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "kolabrelationresourcetask.h"
0011 #include "tagchangehelper.h"
0012 
0013 class KolabChangeItemsTagsTask : public KolabRelationResourceTask
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit KolabChangeItemsTagsTask(const ResourceStateInterface::Ptr &resource, const QSharedPointer<TagConverter> &tagConverter, QObject *parent = nullptr);
0018 
0019 protected:
0020     void startRelationTask(KIMAP::Session *session) override;
0021 
0022 private:
0023     KIMAP::Session *mSession = nullptr;
0024     QList<Akonadi::Tag> mChangedTags;
0025     const QSharedPointer<TagConverter> mTagConverter;
0026 
0027 private:
0028     void processNextTag();
0029 
0030 private Q_SLOTS:
0031     void onItemsFetchDone(KJob *job);
0032     void onTagFetchDone(KJob *job);
0033 
0034     void onApplyCollectionChanged(const Akonadi::Collection &collection);
0035     void onCancelTask(const QString &errorText);
0036     void onChangeCommitted();
0037 };