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

0001 /*
0002     SPDX-FileCopyrightText: 2013 David Faure <faure@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 "specialcollections.h"
0012 #include <KCompositeJob>
0013 
0014 #include <memory>
0015 
0016 namespace Akonadi
0017 {
0018 class SpecialCollectionsDiscoveryJobPrivate;
0019 
0020 /**
0021  * @short A job to discover all SpecialCollections.
0022  *
0023  * The collections get registered into SpecialCollections.
0024  *
0025  * This class is not meant to be used directly but as a base class for type
0026  * specific special collection request jobs.
0027  *
0028  * @author David Faure <faure@kde.org>
0029  * @since 4.11
0030  */
0031 class AKONADICORE_EXPORT SpecialCollectionsDiscoveryJob : public KCompositeJob
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036     /**
0037      * Destroys the special collections request job.
0038      */
0039     ~SpecialCollectionsDiscoveryJob() override;
0040 
0041     void start() override;
0042 
0043 protected:
0044     /**
0045      * Creates a new special collections request job.
0046      *
0047      * @param collections The SpecialCollections object that shall be used.
0048      * @param parent The parent object.
0049      */
0050     explicit SpecialCollectionsDiscoveryJob(SpecialCollections *collections, const QStringList &mimeTypes, QObject *parent = nullptr);
0051 
0052     /* reimpl */
0053     void slotResult(KJob *job) override;
0054 
0055 private:
0056     /// @cond PRIVATE
0057     std::unique_ptr<SpecialCollectionsDiscoveryJobPrivate> const d;
0058     /// @endcond
0059 };
0060 
0061 } // namespace Akonadi