File indexing completed on 2024-05-12 05:10:46

0001 /*
0002   SPDX-FileCopyrightText: 2011 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
0003   SPDX-FileContributor: Volker Krause <vkrause@kde.org>
0004 
0005   SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include <Akonadi/Item>
0011 #include <Akonadi/Job>
0012 #include <Akonadi/MimeTypeChecker>
0013 #include <KCalendarCore/Incidence>
0014 
0015 namespace Akonadi
0016 {
0017 /**
0018  * Retrieve all incidences in all calendars.
0019  * This is a Strigi/Nepomuk-free replacement for an IncidenceSearchJob without a query.
0020  * @internal
0021  */
0022 class IncidenceFetchJob : public Akonadi::Job
0023 {
0024     Q_OBJECT
0025 public:
0026     explicit IncidenceFetchJob(QObject *parent = nullptr);
0027 
0028     Akonadi::Item::List items() const;
0029 
0030 protected:
0031     void doStart() override;
0032 
0033 private:
0034     void collectionFetchResult(KJob *job);
0035     void itemFetchResult(KJob *job);
0036     Akonadi::Item::List m_items;
0037     Akonadi::MimeTypeChecker m_mimeTypeChecker;
0038     int m_jobCount = 0;
0039 };
0040 }