2013-11-13 13:41:04 +01:00
|
|
|
/*
|
2020-08-13 21:08:54 +02:00
|
|
|
SPDX-FileCopyrightText: 2013 Mark Gaiser <markg85@gmail.com>
|
2013-11-13 13:41:04 +01:00
|
|
|
|
2020-08-13 21:08:54 +02:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
2013-11-13 13:41:04 +01:00
|
|
|
*/
|
|
|
|
|
2013-08-31 15:23:04 +02:00
|
|
|
#include "calendarplugin.h"
|
|
|
|
#include "calendar.h"
|
2021-03-05 19:15:32 +01:00
|
|
|
#include "calendardata.h"
|
2015-11-02 21:33:15 +01:00
|
|
|
#include "eventdatadecorator.h"
|
2015-11-04 19:55:32 +01:00
|
|
|
#include "eventpluginsmanager.h"
|
2015-11-02 21:33:15 +01:00
|
|
|
|
2013-08-31 15:23:04 +02:00
|
|
|
#include <QAbstractListModel>
|
2021-03-05 19:15:32 +01:00
|
|
|
#include <QQmlEngine>
|
|
|
|
#include <QtQml>
|
2013-08-31 15:23:04 +02:00
|
|
|
|
2015-11-04 19:55:32 +01:00
|
|
|
static QObject *event_plugins_manager_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
|
|
|
|
{
|
2018-12-11 19:17:39 +01:00
|
|
|
Q_UNUSED(engine)
|
2015-11-04 19:55:32 +01:00
|
|
|
Q_UNUSED(scriptEngine)
|
|
|
|
|
2018-11-19 23:09:30 +01:00
|
|
|
return new EventPluginsManager();
|
2015-11-04 19:55:32 +01:00
|
|
|
}
|
|
|
|
|
2013-08-31 15:23:04 +02:00
|
|
|
void CalendarPlugin::registerTypes(const char *uri)
|
|
|
|
{
|
2017-12-02 15:12:40 +01:00
|
|
|
Q_ASSERT(uri == QByteArray("org.kde.plasma.calendar"));
|
2015-02-24 15:31:41 +01:00
|
|
|
qmlRegisterType<CalendarData>(uri, 2, 0, "CalendarData");
|
|
|
|
qmlRegisterType<Calendar>(uri, 2, 0, "Calendar");
|
2020-06-26 15:48:28 +02:00
|
|
|
qmlRegisterAnonymousType<QAbstractItemModel>(uri, 1);
|
|
|
|
qmlRegisterAnonymousType<QAbstractListModel>(uri, 1);
|
2015-11-04 19:55:32 +01:00
|
|
|
qmlRegisterSingletonType<EventPluginsManager>(uri, 2, 0, "EventPluginsManager", event_plugins_manager_provider);
|
2021-07-14 10:55:55 +02:00
|
|
|
qmlRegisterUncreatableType<EventDataDecorator>(uri, 2, 0, "EventDataDecorator", QStringLiteral("Unable to create EventDataDecorator from QML"));
|
2013-08-31 15:23:04 +02:00
|
|
|
}
|