File indexing completed on 2024-06-02 05:21:39

0001 /*  This file is part of the KDE project
0002     SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
0003     SPDX-FileContributor: Kevin Krammer <krake@kdab.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include <QObject>
0011 
0012 #include <memory>
0013 
0014 namespace Akonadi
0015 {
0016 class Collection;
0017 class Item;
0018 
0019 using ItemList = QList<Item>;
0020 }
0021 
0022 class CompactChangeHelperPrivate;
0023 
0024 class CompactChangeHelper : public QObject
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     explicit CompactChangeHelper(const QByteArray &sessionId, QObject *parent = nullptr);
0030 
0031     ~CompactChangeHelper() override;
0032 
0033     void addChangedItems(const Akonadi::ItemList &items);
0034 
0035     QString currentRemoteId(const Akonadi::Item &item) const;
0036 
0037     void checkCollectionChanged(const Akonadi::Collection &collection);
0038 
0039 private:
0040     std::unique_ptr<CompactChangeHelperPrivate> const d;
0041 
0042     Q_PRIVATE_SLOT(d, void processNextBatch())
0043     Q_PRIVATE_SLOT(d, void processNextItem())
0044 };