• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
itemsync.h
1/*
2 Copyright (c) 2007 Tobias Koenig <tokoe@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_ITEMSYNC_H
21#define AKONADI_ITEMSYNC_H
22
23#include "akonadi_export.h"
24
25#include <akonadi/item.h>
26#include <akonadi/job.h>
27
28namespace Akonadi {
29
30class Collection;
31class ItemFetchScope;
32class ItemSyncPrivate;
33
54class AKONADI_EXPORT ItemSync : public Job
55{
56 Q_OBJECT
57
58public:
59 enum MergeMode
60 {
61 RIDMerge,
62 GIDMerge
63 };
64
71 explicit ItemSync(const Collection &collection, QObject *parent = 0);
72
76 ~ItemSync();
77
88 void setFullSyncItems(const Item::List &items);
89
101 void setTotalItems(int amount);
102
109 void setStreamingEnabled(bool enable);
110
115 void deliveryDone();
116
128 void setIncrementalSyncItems(const Item::List &changedItems,
129 const Item::List &removedItems);
130
142 void setFetchScope(ItemFetchScope &fetchScope);
143
156 ItemFetchScope &fetchScope();
157
164 void rollback();
165
170 enum TransactionMode {
171 SingleTransaction,
172 MultipleTransactions,
173 NoTransaction
174 };
175
182 void setTransactionMode(TransactionMode mode);
183
191 int batchSize() const;
192
202 void setBatchSize(int);
203
216 void setDisableAutomaticDeliveryDone(bool disable);
217
224 MergeMode mergeMode() const;
225
237 void setMergeMode(MergeMode mergeMode);
238
239Q_SIGNALS:
246 void readyForNextBatch(int remainingBatchSize);
247
254 void transactionCommitted();
255
256protected:
257 void doStart();
258 void slotResult(KJob *job);
259
269 AKONADI_DEPRECATED virtual bool updateItem(const Item &storedItem, Item &newItem);
270
271private:
272 //@cond PRIVATE
273 Q_DECLARE_PRIVATE(ItemSync)
274 ItemSyncPrivate *dummy; // for BC. KF5 TODO: REMOVE.
275
276 Q_PRIVATE_SLOT(d_func(), void slotLocalListDone(KJob *))
277 Q_PRIVATE_SLOT(d_func(), void slotLocalDeleteDone(KJob *))
278 Q_PRIVATE_SLOT(d_func(), void slotLocalChangeDone(KJob *))
279 Q_PRIVATE_SLOT(d_func(), void slotTransactionResult(KJob *))
280 Q_PRIVATE_SLOT(d_func(), void slotItemsReceived(const Akonadi::Item::List &))
281 //@endcond
282};
283
284}
285
286#endif
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:76
Akonadi::ItemFetchScope
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition: itemfetchscope.h:70
Akonadi::ItemSync
Syncs between items known to a client (usually a resource) and the Akonadi storage.
Definition: itemsync.h:55
Akonadi::ItemSync::readyForNextBatch
void readyForNextBatch(int remainingBatchSize)
Signals the resource that new items can be delivered.
Akonadi::ItemSync::TransactionMode
TransactionMode
Transaction mode used by ItemSync.
Definition: itemsync.h:170
Akonadi::ItemSync::MultipleTransactions
@ MultipleTransactions
Use one transaction per chunk of delivered items, good compromise between the other two when using st...
Definition: itemsync.h:172
Akonadi::ItemSync::SingleTransaction
@ SingleTransaction
Use a single transaction for the entire sync process (default), provides maximum consistency ("all or...
Definition: itemsync.h:171
Akonadi::ItemSync::transactionCommitted
void transactionCommitted()
Akonadi::Job
Base class for all actions in the Akonadi storage.
Definition: job.h:87
Akonadi
FreeBusyManager::Singleton.
Definition: actionstatemanager_p.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal