1/*
2 Copyright (c) 2013 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#ifndef AKONADI_SPECIALCOLLECTIONSDISCOVERYJOB_H
21#define AKONADI_SPECIALCOLLECTIONSDISCOVERYJOB_H
22
23#include "akonadi_export.h"
24
25#include <kcompositejob.h>
26#include <akonadi/collection.h>
27#include <akonadi/specialcollections.h>
28
29namespace Akonadi {
30
31class SpecialCollectionsDiscoveryJobPrivate;
32
33/**
34 * @short A job to discover all SpecialCollections.
35 *
36 * The collections get registered into SpecialCollections.
37 *
38 * This class is not meant to be used directly but as a base class for type
39 * specific special collection request jobs.
40 *
41 * @author David Faure <faure@kde.org>
42 * @since 4.11
43*/
44class AKONADI_EXPORT SpecialCollectionsDiscoveryJob : public KCompositeJob
45{
46 Q_OBJECT
47
48public:
49
50 /**
51 * Destroys the special collections request job.
52 */
53 ~SpecialCollectionsDiscoveryJob();
54
55 virtual void start();
56
57protected:
58 /**
59 * Creates a new special collections request job.
60 *
61 * @param collections The SpecialCollections object that shall be used.
62 * @param parent The parent object.
63 */
64 explicit SpecialCollectionsDiscoveryJob(SpecialCollections *collections, const QStringList &mimeTypes, QObject *parent = 0);
65
66 /* reimpl */
67 virtual void slotResult(KJob *job);
68
69private:
70 //@cond PRIVATE
71 SpecialCollectionsDiscoveryJobPrivate *const d;
72 //@endcond
73};
74
75} // namespace Akonadi
76
77#endif // AKONADI_SPECIALCOLLECTIONSDISCOVERYJOB_H
78