File indexing completed on 2024-11-10 04:40:32

0001 /*
0002     SPDX-FileCopyrightText: 2007 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "akonadicore_export.h"
0010 #include "collection.h"
0011 #include "job.h"
0012 
0013 namespace Akonadi
0014 {
0015 class SubscriptionJobPrivate;
0016 
0017 /**
0018  * @internal
0019  *
0020  * @short Job to manipulate the local subscription state of a set of collections.
0021  */
0022 class AKONADICORE_EXPORT SubscriptionJob : public Job
0023 {
0024     Q_OBJECT
0025 public:
0026     /**
0027      * Creates a new subscription job.
0028      *
0029      * @param parent The parent object.
0030      */
0031     explicit SubscriptionJob(QObject *parent = nullptr);
0032 
0033     /**
0034      * Destroys the subscription job.
0035      */
0036     ~SubscriptionJob() override;
0037 
0038     /**
0039      * Subscribes to the given list of collections.
0040      *
0041      * @param collections List of collections to subscribe to.
0042      */
0043     void subscribe(const Collection::List &collections);
0044 
0045     /**
0046      * Unsubscribes from the given list of collections.
0047      *
0048      * @param collections List of collections to unsubscribe from.
0049      */
0050     void unsubscribe(const Collection::List &collections);
0051 
0052 protected:
0053     void doStart() override;
0054     void slotResult(KJob *job) override;
0055 
0056 private:
0057     Q_DECLARE_PRIVATE(SubscriptionJob)
0058 };
0059 
0060 }