Akonadi

itemfetchjob.h
1 /*
2  Copyright (c) 2006 - 2007 Volker Krause <[email protected]>
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_ITEMFETCHJOB_H
21 #define AKONADI_ITEMFETCHJOB_H
22 
23 #include "akonadicore_export.h"
24 #include "item.h"
25 #include "job.h"
26 
27 namespace Akonadi
28 {
29 
30 class Collection;
31 class ItemFetchJobPrivate;
32 class ItemFetchScope;
33 
84 class AKONADICORE_EXPORT ItemFetchJob : public Job
85 {
86  Q_OBJECT
87  Q_FLAGS(DeliveryOptions)
88 public:
95  explicit ItemFetchJob(const Collection &collection, QObject *parent = nullptr);
96 
113  explicit ItemFetchJob(const Item &item, QObject *parent = nullptr);
114 
132  explicit ItemFetchJob(const Item::List &items, QObject *parent = nullptr);
133 
138  explicit ItemFetchJob(const QList<Item::Id> &items, QObject *parent = nullptr);
139 
144  explicit ItemFetchJob(const QVector<Item::Id> &items, QObject *parent = nullptr);
145 
154  explicit ItemFetchJob(const Tag &tag, QObject *parent = nullptr);
155 
159  ~ItemFetchJob() override;
160 
169  Q_REQUIRED_RESULT Item::List items() const;
170 
175  void clearItems();
176 
189  void setFetchScope(const ItemFetchScope &fetchScope);
190 
203  ItemFetchScope &fetchScope();
204 
214  void setCollection(const Collection &collection);
215 
217  ItemGetter = 0x1,
218  EmitItemsIndividually = 0x2,
219  EmitItemsInBatches = 0x4,
220  Default = ItemGetter | EmitItemsInBatches
221  };
222  Q_DECLARE_FLAGS(DeliveryOptions, DeliveryOption)
223 
224 
228  void setDeliveryOption(DeliveryOptions options);
229 
234  DeliveryOptions deliveryOptions() const;
235 
241  int count() const;
242 
243 Q_SIGNALS:
253  void itemsReceived(const Akonadi::Item::List &items);
254 
255 protected:
256  void doStart() override;
257  bool doHandleResponse(qint64 tag, const Protocol::CommandPtr &response) override;
258 
259 private:
260  Q_DECLARE_PRIVATE(ItemFetchJob)
261 
262  //@cond PRIVATE
263  Q_PRIVATE_SLOT(d_func(), void timeout())
264  //@endcond
265 };
266 
267 }
268 
269 Q_DECLARE_OPERATORS_FOR_FLAGS(Akonadi::ItemFetchJob::DeliveryOptions)
270 
271 #endif
Represents a collection of PIM items.
Definition: collection.h:76
Base class for all actions in the Akonadi storage.
Definition: job.h:93
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition: item.h:44
Helper integration between Akonadi and Qt.
Job that fetches items from the Akonadi storage.
Definition: itemfetchjob.h:84
An Akonadi Tag.
Definition: tag.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 24 2020 22:46:16 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.