Akonadi

specialcollectionsrequestjob.h
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef AKONADI_SPECIALCOLLECTIONSREQUESTJOB_H
8 #define AKONADI_SPECIALCOLLECTIONSREQUESTJOB_H
9 
10 #include "akonadicore_export.h"
11 #include "collection.h"
12 #include "specialcollections.h"
13 #include "transactionsequence.h"
14 
15 #include <QVariant>
16 
17 namespace Akonadi
18 {
19 
20 class SpecialCollectionsRequestJobPrivate;
21 
41 class AKONADICORE_EXPORT SpecialCollectionsRequestJob : public TransactionSequence
42 {
43  Q_OBJECT
44 
45 public:
46 
50  ~SpecialCollectionsRequestJob() override;
51 
55  void requestDefaultCollection(const QByteArray &type);
56 
60  void requestCollection(const QByteArray &type, const AgentInstance &instance);
61 
65  Q_REQUIRED_RESULT Collection collection() const;
66 
67 protected:
74  explicit SpecialCollectionsRequestJob(SpecialCollections *collections, QObject *parent = nullptr);
75 
80  void setDefaultResourceType(const QString &type);
81 
86  void setDefaultResourceOptions(const QVariantMap &options);
87 
91  void setTypes(const QList<QByteArray> &types);
92 
96  void setNameForTypeMap(const QMap<QByteArray, QString> &map);
97 
101  void setIconForTypeMap(const QMap<QByteArray, QString> &map);
102 
103  /* reimpl */
104  void doStart() override;
105  /* reimpl */
106  void slotResult(KJob *job) override;
107 
108 private:
109  //@cond PRIVATE
110  friend class SpecialCollectionsRequestJobPrivate;
111  friend class DefaultResourceJobPrivate;
112 
113  SpecialCollectionsRequestJobPrivate *const d;
114 
115  Q_PRIVATE_SLOT(d, void releaseLock())
116  Q_PRIVATE_SLOT(d, void resourceScanResult(KJob *))
117  Q_PRIVATE_SLOT(d, void collectionCreateResult(KJob *))
118  //@endcond
119 };
120 
121 } // namespace Akonadi
122 
123 #endif // AKONADI_SPECIALCOLLECTIONSREQUESTJOB_H
An interface to special collections.
Represents a collection of PIM items.
Definition: collection.h:63
Base class for jobs that need to run a sequence of sub-jobs in a transaction.
Helper integration between Akonadi and Qt.
A representation of an agent instance.
A job to request SpecialCollections.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Jan 17 2021 23:20:17 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.