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

0001 /*
0002     SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
0003     SPDX-FileContributor: Kevin Ottens <kevin@kdab.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "resourcetask.h"
0011 
0012 namespace KIMAP
0013 {
0014 class Session;
0015 }
0016 
0017 class AddCollectionTask : public ResourceTask
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit AddCollectionTask(const ResourceStateInterface::Ptr &resource, QObject *parent = nullptr);
0023     ~AddCollectionTask() override;
0024 
0025 protected:
0026     void doStart(KIMAP::Session *session) override;
0027 
0028 private:
0029     void onCreateDone(KJob *job);
0030     void onSubscribeDone(KJob *job);
0031     void onSetMetaDataDone(KJob *job);
0032     Akonadi::Collection m_collection;
0033     uint m_pendingJobs = 0;
0034     KIMAP::Session *m_session = nullptr;
0035 };