File indexing completed on 2024-04-21 03:52:44

0001 /*
0002     SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #ifndef KCALENDARCORE_CALENDARPLUGINLOADER_H
0007 #define KCALENDARCORE_CALENDARPLUGINLOADER_H
0008 
0009 #include "kcalendarcore_export.h"
0010 
0011 #include <KCalendarCore/CalendarPlugin>
0012 
0013 namespace KCalendarCore
0014 {
0015 
0016 /**
0017  * Provides access to a KCalendarCore::CalendarPlugin instance, if available.
0018  * @since 5.97
0019  */
0020 class KCALENDARCORE_EXPORT CalendarPluginLoader
0021 {
0022     Q_GADGET
0023     Q_PROPERTY(bool hasPlugin READ hasPlugin)
0024     Q_PROPERTY(KCalendarCore::CalendarPlugin *plugin READ plugin)
0025 
0026 public:
0027     /** Returns @c true if there is a platform calendar available. */
0028     static bool hasPlugin();
0029 
0030     /** Returns the platform calendar plugin. */
0031     static KCalendarCore::CalendarPlugin *plugin();
0032 };
0033 
0034 }
0035 
0036 #endif // KCALENDARCORE_CALENDARPLUGINLOADER_H