diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,6 +6,7 @@ attachment.cpp attendee.cpp calendar.cpp + calendarplugin.cpp calfilter.cpp calformat.cpp calstorage.cpp @@ -92,6 +93,7 @@ CalFormat CalStorage Calendar + CalendarPlugin CustomProperties Duration Event diff --git a/src/calendarplugin.h b/src/calendarplugin.h new file mode 100644 --- /dev/null +++ b/src/calendarplugin.h @@ -0,0 +1,43 @@ +/* + This file is part of the kcalcore library. + + SPDX-FileCopyrightText: 2020 Nicolas Fella + SPDX-License-Identifier: LGPL-2.0-or-later +*/ +#pragma once + +#include + +namespace KCalendarCore +{ +/** + @brief + A plugin that provides calendar data. + + It allows calendar applications to consume data provided by multiple + sources, e.g. local ical files or remote calendars. +*/ +class Q_DECL_EXPORT CalendarPlugin : public QObject +{ + Q_OBJECT +public: + CalendarPlugin(QObject *parent, const QVariantList &args); + + /** + * The set of calendars defined by this plugin. + * + * @return QVector of calendars. + */ + virtual QVector calendars() const = 0; + +Q_SIGNALS: + /** + * Emitted when the set of calendars changed. + */ + void calendarsChanged(); + +private: + void *d; +}; + +} diff --git a/src/calendarplugin.cpp b/src/calendarplugin.cpp new file mode 100644 --- /dev/null +++ b/src/calendarplugin.cpp @@ -0,0 +1,16 @@ +/* + This file is part of the kcalcore library. + + SPDX-FileCopyrightText: 2020 Nicolas Fella + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "calendarplugin.h" + +using namespace KCalendarCore; + +CalendarPlugin::CalendarPlugin(QObject *parent, const QVariantList &args) + : QObject(parent) +{ + Q_UNUSED(args) +}