File indexing completed on 2024-05-19 05:11:15

0001 /*
0002    SPDX-FileCopyrightText: 2011 Sérgio Martins <sergio.martins@kdab.com>
0003    SPDX-FileCopyrightText: 2012 Sérgio Martins <iamsergio@gmail.com>
0004 
0005    SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "akonadi-calendar_export.h"
0011 #include "calendarbase.h"
0012 
0013 #include <Akonadi/Item>
0014 
0015 namespace Akonadi
0016 {
0017 class FetchJobCalendarPrivate;
0018 /**
0019  * @short A KCalendarCore::Calendar that uses a one time IncidenceFetchJob to populate itself.
0020  *
0021  * If you want a persistent calendar ( which monitors Akonadi for changes )
0022  * use an ETMCalendar.
0023  *
0024  * @see ETMCalendar
0025  * @see CalendarBase
0026  *
0027  * @author Sérgio Martins <sergio.martins@kdab.com>
0028  * @since 4.11
0029  */
0030 class AKONADI_CALENDAR_EXPORT FetchJobCalendar : public Akonadi::CalendarBase
0031 {
0032     Q_OBJECT
0033 public:
0034     using Ptr = QSharedPointer<FetchJobCalendar>;
0035 
0036     /**
0037      * Creates a new FetchJobCalendar. Loading begins asynchronously.
0038      * @see loadFinished()
0039      */
0040     explicit FetchJobCalendar(QObject *parent = nullptr);
0041 
0042     /**
0043      * Destroys this FetchJobCalendar.
0044      */
0045     ~FetchJobCalendar() override;
0046 
0047 Q_SIGNALS:
0048     /**
0049      * This signal is emitted when the IncidenceFetchJob finishes.
0050      * @param success the success of the operation
0051      * @param errorMessage if @p success is false, contains the error message
0052      */
0053     void loadFinished(bool success, const QString &errorMessage);
0054 
0055 private:
0056     Q_DECLARE_PRIVATE(FetchJobCalendar)
0057 };
0058 }