Commit a567775a authored by Volker Krause's avatar Volker Krause
Browse files

Add KCalendarCore platform calendar plugin for Android

parent fd33fe2f
......@@ -56,11 +56,16 @@ find_package(KPimItinerary 5.18.0 CONFIG REQUIRED)
find_package(KPublicTransport CONFIG REQUIRED)
find_package(KOSMIndoorMap CONFIG REQUIRED)
find_package(KHealthCertificate CONFIG)
find_package(LibIcal 3.0)
find_package(SharedMimeInfo 1.0 REQUIRED)
find_package(ZLIB REQUIRED)
set_package_properties("ZLIB" PROPERTIES PURPOSE "Needed for retrieving weather forecast data.")
set_package_properties(LibIcal PROPERTIES PURPOSE "Needed for Android calendar integration.")
set_package_properties(KF5Solid PROPERTIES TYPE OPTIONAL TYPE RUNTIME PURPOSE "Used for controlling the screen brightness.")
set_package_properties(KHealthCertificate PROPERTIES TYPE OPTIONAL PURPOSE "Needed for the vaccination certificate manager.")
if (ANDROID)
set_package_properties(LibIcal PROPERTIES TYPE REQUIRED)
endif()
include(ECMFindQmlModule)
ecm_find_qmlmodule(QtLocation 5.11)
......
......@@ -9,6 +9,10 @@ ecm_add_test(jniarraytest.cpp LINK_LIBRARIES Qt::Test KAndroidExtras)
ecm_add_test(jnimethodtest.cpp LINK_LIBRARIES Qt::Test KAndroidExtras)
ecm_add_test(androidwrappertest.cpp LINK_LIBRARIES Qt::Test KAndroidExtras)
if (TARGET LibIcal)
ecm_add_test(androidicalconvertertest.cpp LINK_LIBRARIES Qt::Test KAndroidExtras KCalendarCoreExtras LibIcal)
endif()
ecm_add_test(gpxwritertest.cpp LINK_LIBRARIES Qt::Test GpxIo)
ecm_add_test(pkpassmanagertest.cpp LINK_LIBRARIES Qt::Test itinerary)
......
/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "../src/calendarextras/androidicalconverter.cpp"
#include "../src/calendarextras/android/eventdata.h"
#include <QObject>
#include <QTest>
using namespace KAndroidExtras;
class AndroidIcalConverterTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void testEvent()
{
JniEventData data;
data.title = QStringLiteral("summary");
data.allDay = true;
data.dtStart = 1653055380000;
data.startTimezone = QStringLiteral("Europe/Brussels");
auto event = AndroidIcalConverter::readEvent(data);
QCOMPARE(event->summary(), QLatin1String("summary"));
QCOMPARE(event->allDay(), true);
QCOMPARE(event->dtStart(), QDateTime({2022, 5, 20}, {16, 3}, QTimeZone("Europe/Brussels")));
const auto out = AndroidIcalConverter::writeEvent(event);
QCOMPARE(out.title, QLatin1String("summary"));
QCOMPARE(out.allDay, true);
QCOMPARE(out.dtStart, 1653055380000);
QCOMPARE(out.startTimezone, QLatin1String("Europe/Brussels"));
}
void testAlarm()
{
KCalendarCore::Event ev;
auto data = Jni::fromHandle<JniReminderData>(QAndroidJniObject{});
data.minutes = 5;
auto alarm = AndroidIcalConverter::readAlarm(data, &ev);
QCOMPARE(alarm->startOffset().asSeconds(), -300);
const auto out = AndroidIcalConverter::writeAlarm(alarm);
QCOMPARE(out.minutes, 5);
}
void testAttendee()
{
auto data = Jni::fromHandle<JniAttendeeData>(QAndroidJniObject{});
data.name = QStringLiteral("Dr Konqi");
data.email = QStringLiteral("null@kde.org");
auto attendee = AndroidIcalConverter::readAttendee(data);
QCOMPARE(attendee.fullName(), QLatin1String("Dr Konqi <null@kde.org>"));
const auto out = AndroidIcalConverter::writeAttendee(attendee);
QCOMPARE(out.name, QLatin1String("Dr Konqi"));
QCOMPARE(out.email, QLatin1String("null@kde.org"));
}
void testExtendedProperties()
{
KCalendarCore::Event ev;
AndroidIcalConverter::addExtendedProperty(&ev, QStringLiteral("CREATED"), QStringLiteral("20211116T193700Z"));
AndroidIcalConverter::addExtendedProperty(&ev, QStringLiteral("GEO"), QStringLiteral("52.525;13.369"));
AndroidIcalConverter::addExtendedProperty(&ev, QStringLiteral("X-KDE-KITINERARY-RESERVATION"), QStringLiteral("<json>"));
QCOMPARE(ev.customProperty("KITINERARY", "RESERVATION"), QLatin1String("<json>"));
QVERIFY(ev.hasGeo());
QCOMPARE(ev.geoLatitude(), 52.525f);
QCOMPARE(ev.geoLongitude(), 13.369f);
QCOMPARE(ev.created(), QDateTime({2021, 11, 16}, {19, 37}, Qt::UTC));
const auto out = AndroidIcalConverter::writeExtendedProperties(&ev);
QCOMPARE(out.size(), 3);
QCOMPARE(out[0].name, QLatin1String("vnd.android.cursor.item/vnd.ical4android.unknown-property"));
QCOMPARE(QString(out[0].value), QLatin1String("[\"CREATED\",\"20211116T193700Z\"]"));
QCOMPARE(QString(out[1].value), QLatin1String("[\"GEO\",\"52.525002;13.369000\"]"));
QCOMPARE(QString(out[2].value), QLatin1String("[\"X-KDE-KITINERARY-RESERVATION\",\"<json>\"]"));
}
void testReadRDate()
{
// date/time variants
QCOMPARE(AndroidIcalConverter::readRDates<QDateTime>(QString()), QList<QDateTime>());
QCOMPARE(AndroidIcalConverter::readRDates<QDateTime>(QStringLiteral("20220520T200000Z")),
QList<QDateTime>({QDateTime({2022, 5, 20}, {20, 0}, Qt::UTC)}));
QCOMPARE(AndroidIcalConverter::readRDates<QDateTime>(QStringLiteral("Europe/Brussels;20211224T153000,20211231T153000,20220107T153000")),
QList<QDateTime>({QDateTime({2021, 12, 24}, {15, 30}, QTimeZone("Europe/Brussels")),
QDateTime({2021, 12, 31}, {15, 30}, QTimeZone("Europe/Brussels")),
QDateTime({2022, 1, 7}, {15, 30}, QTimeZone("Europe/Brussels"))}));
QCOMPARE(AndroidIcalConverter::readRDates<QDateTime>(QStringLiteral("20201230T000000Z,20211229T190000Z")),
QList<QDateTime>({QDateTime({2020, 12, 30}, {0, 0}, Qt::UTC),
QDateTime({2021, 12, 29}, {19, 0}, Qt::UTC)}));
QCOMPARE(AndroidIcalConverter::readRDates<QDateTime>(QStringLiteral("Europe/Helsinki;20210513T122346")),
QList<QDateTime>({QDateTime({2021, 05, 13}, {12, 23, 46}, QTimeZone("Europe/Helsinki"))}));
// TODO date-only variants
}
void testWriteRDate()
{
QCOMPARE(AndroidIcalConverter::writeRDates(QList<QDateTime>()), QString());
QCOMPARE(AndroidIcalConverter::writeRDates(QList<QDateTime>({QDateTime({2022, 5, 20}, {20, 0}, Qt::UTC)})),
QLatin1String("20220520T200000Z"));
QCOMPARE(AndroidIcalConverter::writeRDates(QList<QDateTime>({QDateTime({2021, 05, 13}, {12, 23, 46}, QTimeZone("Europe/Helsinki"))})),
QLatin1String("Europe/Helsinki;20210513T122346"));
QCOMPARE(AndroidIcalConverter::writeRDates(QList<QDateTime>({QDateTime({2020, 12, 30}, {0, 0}, Qt::UTC),
QDateTime({2021, 12, 29}, {19, 0}, Qt::UTC)})),
QLatin1String("20201230T000000Z,20211229T190000Z"));
QCOMPARE(AndroidIcalConverter::writeRDates(QList<QDateTime>({QDateTime({2021, 12, 24}, {15, 30}, QTimeZone("Europe/Brussels")),
QDateTime({2021, 12, 31}, {15, 30}, Qt::UTC),
QDateTime({2022, 1, 7}, {15, 30}, QTimeZone("Europe/Brussels"))})),
QLatin1String("Europe/Brussels;20211224T153000,20211231T163000,20220107T153000"));
QCOMPARE(AndroidIcalConverter::writeRDates(QList<QDate>()), QString());
QCOMPARE(AndroidIcalConverter::writeRDates(QList<QDate>({{2022, 5, 28}})), QLatin1String("20220528"));
QCOMPARE(AndroidIcalConverter::writeRDates(QList<QDate>({{2022, 5, 28}, {2022, 5, 29}})), QLatin1String("20220528,20220529"));
}
};
QTEST_APPLESS_MAIN(AndroidIcalConverterTest)
#include "androidicalconvertertest.moc"
#.rst:
# FindLibIcal
# -----------
#
# Try to find the Ical libraries.
#
# This will define the following variables:
#
# ``LibIcal_FOUND``
# True if a suitable LibIcal was found
# ``LibIcal_INCLUDE_DIRS``
# This should be passed to target_include_directories() if
# the target is not used for linking
# ``LibIcal_LIBRARIES``
# The Ical libraries (ical + icalss)
# This can be passed to target_link_libraries() instead of
# the ``LibIcal`` target
#
# ``LibIcal_VERSION``
# The LibIcal version defined in ical.h
# If ``LibIcal_FOUND`` is TRUE, the following imported target
# will be available:
#
# ``LibIcal``
# The Ical libraries
#
# The following variables are set for compatibility reason and will be
# removed in the next major version
# ``LibIcal_MAJOR_VERSION``
# The LibIcal major version
# ``LibIcal_MINOR_VERSION``
# The LibIcal minor version
#
# SPDX-FileCopyrightText: 2008, 2010 Allen Winter <winter@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#=============================================================================
if(NOT LibIcal_FIND_VERSION)
set(LibIcal_FIND_VERSION "0.33")
endif()
find_package(PkgConfig QUIET)
pkg_check_modules(PC_LibIcal QUIET libical)
find_path(LibIcal_INCLUDE_DIRS
NAMES libical/ical.h
HINTS ${PC_LibIcal_INCLUDEDIR}
)
find_library(LibIcal_LIBRARY
NAMES ical libical
HINTS ${PC_LibIcal_LIBDIR}
)
find_library(LibIcalss_LIBRARY
NAMES icalss libicalss
HINTS ${PC_LibIcal_LIBDIR}
)
find_library(LibIcalvcal_LIBRARY
NAMES icalvcal
HINTS ${PC_LibIcal_LIBDIR}
)
# For backward compatibility
set(LibIcal_INCLUDE_DIRS "${LibIcal_INCLUDE_DIRS}" "${LibIcal_INCLUDE_DIRS}/libical")
set(LibIcal_LIBRARIES ${LibIcal_LIBRARY} ${LibIcalss_LIBRARY} ${LibIcalvcal_LIBRARY})
set(LibIcal_VERSION "${PC_LibIcal_VERSION}")
if(NOT ICAL_H)
find_file(ICAL_H ical.h HINTS ${LibIcal_INCLUDE_DIRS})
endif()
if(NOT LibIcal_VERSION)
if(EXISTS "${ICAL_H}")
file(STRINGS "${ICAL_H}" _ICAL_H_VERSION REGEX "^#define[ ]+ICAL_VERSION[ ]+\"[0-9].[0-9]\"$")
string(REGEX REPLACE "^#define[ ]+ICAL_VERSION[ ]+\"([0-9].[0-9])\"$" "\\1" LibIcal_VERSION "${_ICAL_H_VERSION}")
file(STRINGS "${ICAL_H}" _ICAL_H_PATCH_VERSION REGEX "^#define[ ]+ICAL_PATCH_VERSION[ ]+\\([0-9]+\\)$")
string(REGEX REPLACE "^#define[ ]+ICAL_PATCH_VERSION[ ]+\\(([0-9]+)\\)$" "\\1" LibIcal_PATCH_VERSION "${_ICAL_H_PATCH_VERSION}")
unset(_ICAL_H_VERSION)
unset(_ICAL_H_PATCH_VERSION)
if(LibIcal_PATCH_VERSION)
set(LibIcal_VERSION "${LibIcal_VERSION}.${LibIcal_PATCH_VERSION}")
endif()
endif()
endif()
# For compatibility
string(REGEX REPLACE "^([0-9]).[0-9]$" "\\1" LibIcal_MAJOR_VERSION "${LibIcal_VERSION}")
string(REGEX REPLACE "^[0-9].([0-9])$" "\\1" LibIcal_MINOR_VERSION "${LibIcal_VERSION}")
if(NOT LibIcal_VERSION VERSION_LESS 0.46)
set(USE_ICAL_0_46 TRUE)
endif()
if(NOT LibIcal_VERSION VERSION_LESS 1.00)
set(USE_ICAL_1_0 TRUE)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibIcal
FOUND_VAR LibIcal_FOUND
REQUIRED_VARS LibIcal_LIBRARIES LibIcal_INCLUDE_DIRS
VERSION_VAR LibIcal_VERSION
)
# Internal
if(LibIcal_FOUND AND NOT TARGET LibIcalss)
add_library(LibIcalss UNKNOWN IMPORTED)
set_target_properties(LibIcalss PROPERTIES
IMPORTED_LOCATION "${LibIcalss_LIBRARY}")
endif()
if(LibIcal_FOUND AND NOT TARGET LibIcalvcal)
add_library(LibIcalvcal UNKNOWN IMPORTED)
set_target_properties(LibIcalvcal PROPERTIES
IMPORTED_LOCATION "${LibIcalvcal_LIBRARY}")
endif()
# Public Target
if(LibIcal_FOUND AND NOT TARGET LibIcal)
add_library(LibIcal UNKNOWN IMPORTED)
set_target_properties(LibIcal PROPERTIES
IMPORTED_LOCATION "${LibIcal_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LibIcal_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "LibIcalss;LibIcalvcal"
)
endif()
mark_as_advanced(LibIcal_INCLUDE_DIRS LibIcal_LIBRARY LibIcalss_LIBRARY LibIcalvcal_LIBRARY LibIcal_LIBRARIES)
include(FeatureSummary)
set_package_properties(LibIcal PROPERTIES
URL "https://github.com/libical/libical"
DESCRIPTION "Implementation of iCalendar protocols and data formats"
)
......@@ -7,6 +7,7 @@ add_subdirectory(solidextras)
add_subdirectory(weather)
add_subdirectory(kandroidextras)
add_subdirectory(gpx)
add_subdirectory(calendarextras)
add_subdirectory(app)
if (TARGET KF5::FileMetaData)
......
# SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
add_library(KCalendarCoreExtras)
generate_export_header(KCalendarCoreExtras BASE_NAME KCalendarCoreExtras)
target_sources(KCalendarCoreExtras PRIVATE
)
if (ANDROID)
add_subdirectory(android)
target_sources(KCalendarCoreExtras PRIVATE
androidcalendar.cpp
androidcalendarplugin.cpp
androidicalconverter.cpp
)
target_link_libraries(KCalendarCoreExtras PRIVATE KAndroidExtras LibIcal)
endif()
target_link_libraries(KCalendarCoreExtras PUBLIC KF5::CalendarCore)
install(TARGETS KCalendarCoreExtras ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: CC0-1.0
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.kde.kcalendarcore">
<uses-permission android:name="android.permission.READ_CALENDAR"/>
<uses-permission android:name="android.permission.WRITE_CALENDAR"/>
</manifest>
# SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
gradle_add_aar(calendarextras_aar BUILDFILE ${CMAKE_CURRENT_SOURCE_DIR}/build.gradle NAME KCalendarCoreExtras)
gradle_install_aar(calendarextras_aar DESTINATION jar)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/KCalendarCoreExtras-android-dependencies.xml
${CMAKE_BINARY_DIR}/lib/KCalendarCoreExtras_${CMAKE_ANDROID_ARCH_ABI}-android-dependencies.xml
)
install(FILES KCalendarCoreExtras-android-dependencies.xml DESTINATION ${KDE_INSTALL_LIBDIR} RENAME KCalendarCoreExtras${CMAKE_ANDROID_ARCH_ABI}-android-dependencies.xml)
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: CC0-1.0
-->
<rules>
<dependencies>
<lib name="KCalendarCoreExtras">
<depends>
<jar bundling="1" file="jar/KCalendarCoreExtras.aar"/>
</depends>
</lib>
</dependencies>
</rules>
/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: BSD-3-Clause
*/
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:@Gradle_ANDROID_GRADLE_PLUGIN_VERSION@'
}
}
repositories {
google()
jcenter()
}
apply plugin: 'com.android.library'
android {
buildToolsVersion '@ANDROID_SDK_BUILD_TOOLS_REVISION@'
compileSdkVersion @ANDROID_SDK_COMPILE_API@
sourceSets {
main {
manifest.srcFile '@CMAKE_CURRENT_SOURCE_DIR@/AndroidManifest.xml'
java.srcDirs = ['@CMAKE_CURRENT_SOURCE_DIR@/org']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion @ANDROID_API_LEVEL@
targetSdkVersion @ANDROID_SDK_COMPILE_API@
}
}
/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef KCALENDARCORE_JNI_CALENDAR_H
#define KCALENDARCORE_JNI_CALENDAR_H
#include "eventdata.h"
#include <kandroidextras/jniobject.h>
#include <kandroidextras/jnimethod.h>
#include <kandroidextras/jniproperty.h>
#include <kandroidextras/jnitypes.h>
#include <kandroidextras/javatypes.h>
#include <kandroidextras/androidtypes.h>
JNI_TYPE(org, kde, kcalendarcore, Calendar)
/** JNI wrapper for the CalendarPlugin class. */
class JniCalendar {
JNI_OBJECT(JniCalendar, org::kde::kcalendarcore::Calendar)
public:
JNI_CONSTRUCTOR(JniCalendar, KAndroidExtras::android::content::Context, jlong)
JNI_METHOD(Jni::Array<JniEventData>, rawEvents)
JNI_METHOD(Jni::Array<JniEventData>, rawEvents, jlong, jlong, bool)
JNI_METHOD(bool, addEvent, JniEventData)
JNI_METHOD(JniEventData, event, KAndroidExtras::java::lang::String)
JNI_METHOD(JniEventData, event, KAndroidExtras::java::lang::String, jlong)
JNI_METHOD(bool, deleteEvent, KAndroidExtras::java::lang::String)
JNI_METHOD(bool, deleteEvent, KAndroidExtras::java::lang::String, jlong)
JNI_METHOD(bool, deleteEventInstances, KAndroidExtras::java::lang::String)
JNI_METHOD(Jni::Array<JniEventData>, eventInstances, KAndroidExtras::java::lang::String)
JNI_METHOD(bool, updateEvent, JniEventData, bool, bool)
};
#endif
/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef KCALENDARCORE_JNI_CALENDARDATA_H
#define KCALENDARCORE_JNI_CALENDARDATA_H
#include <kandroidextras/jniobject.h>
#include <kandroidextras/jniproperty.h>
#include <kandroidextras/jnitypes.h>
#include <kandroidextras/javatypes.h>
JNI_TYPE(org, kde, kcalendarcore, CalendarData)
/** JNI wrapper for the CalendarPlugin class. */
class JniCalendarData {
JNI_OBJECT(JniCalendarData, org::kde::kcalendarcore::CalendarData)
public:
JNI_PROPERTY(jlong, id)
JNI_PROPERTY(KAndroidExtras::java::lang::String, displayName)
JNI_PROPERTY(jint, accessLevel)
JNI_PROPERTY(jint, color)
JNI_PROPERTY(KAndroidExtras::java::lang::String, timezone)
};
#endif
/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef KCALENDARCORE_JNI_CALENDARPLUGIN_H
#define KCALENDARCORE_JNI_CALENDARPLUGIN_H
#include "calendardata.h"
#include <kandroidextras/jnitypes.h>
#include <kandroidextras/jnimethod.h>
#include <kandroidextras/jniproperty.h>
#include <kandroidextras/javatypes.h>
#include <kandroidextras/androidtypes.h>
JNI_TYPE(org, kde, kcalendarcore, CalendarPlugin)
/** JNI wrapper for the CalendarPlugin class. */
class JniCalendarPlugin {
JNI_OBJECT(JniCalendarPlugin, org::kde::kcalendarcore::CalendarPlugin)
public:
JNI_CONSTRUCTOR(JniCalendarPlugin, KAndroidExtras::android::content::Context)
JNI_METHOD(KAndroidExtras::Jni::Array<JniCalendarData>, getCalendars)
};
#endif
/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef KCALENDARCORE_JNI_EVENTDATA_H
#define KCALENDARCORE_JNI_EVENTDATA_H
#include <kandroidextras/jnimethod.h>
#include <kandroidextras/jniobject.h>
#include <kandroidextras/jniproperty.h>
#include <kandroidextras/jnitypes.h>
#include <kandroidextras/javatypes.h>
JNI_TYPE(org, kde, kcalendarcore, EventData)
JNI_TYPE(org, kde, kcalendarcore, AttendeeData)
JNI_TYPE(org, kde, kcalendarcore, ExtendedPropertyData)
JNI_TYPE(org, kde, kcalendarcore, ReminderData)
/** JNI wrapper for the event reminder data class. */
class JniReminderData {
JNI_OBJECT(JniReminderData, org::kde::kcalendarcore::ReminderData)
public:
JNI_CONSTRUCTOR(JniReminderData)
JNI_PROPERTY(int, minutes)
JNI_PROPERTY(int, method)
};
/** JNI wrapper for the event extended property data class. */
class JniExtendedPropertyData {
JNI_OBJECT(JniExtendedPropertyData, org::kde::kcalendarcore::ExtendedPropertyData)
public:
JNI_CONSTRUCTOR(JniExtendedPropertyData)
JNI_PROPERTY(KAndroidExtras::java::lang::String, name)
JNI_PROPERTY(KAndroidExtras::java::lang::String, value)
};
/** JNI wrapper for the event reminder data class. */
class JniAttendeeData {
JNI_OBJECT(JniAttendeeData, org::kde::kcalendarcore::AttendeeData)
public:
JNI_CONSTRUCTOR(JniAttendeeData)
JNI_PROPERTY(KAndroidExtras::java::lang::String, name)
JNI_PROPERTY(KAndroidExtras::java::lang::String, email)
JNI_PROPERTY(int, relationship)
JNI_PROPERTY(int, type)
JNI_PROPERTY(int, status)
};
/** JNI wrapper for the event data class. */
class JniEventData {
JNI_OBJECT(JniEventData, org::kde::kcalendarcore::EventData)
public:
JNI_CONSTRUCTOR(JniEventData)
JNI_PROPERTY(jlong, id)
JNI_PROPERTY(KAndroidExtras::java::lang::String, organizer)
JNI_PROPERTY(KAndroidExtras::java::lang::String, title)
JNI_PROPERTY(KAndroidExtras::java::lang::String, location)
JNI_PROPERTY(KAndroidExtras::java::lang::String, description)
JNI_PROPERTY(jlong, dtStart)
JNI_PROPERTY(jlong, dtEnd)
JNI_PROPERTY(KAndroidExtras::java::lang::String, startTimezone)
JNI_PROPERTY(KAndroidExtras::java::lang::String, endTimezone)
JNI_PROPERTY(KAndroidExtras::java::lang::String, duration)
JNI_PROPERTY(bool, allDay)
JNI_PROPERTY(KAndroidExtras::java::lang::String, rrule)
JNI_PROPERTY(KAndroidExtras::java::lang::String, rdate)
JNI_PROPERTY(KAndroidExtras::java::lang::String, exrule)
JNI_PROPERTY(KAndroidExtras::java::lang::String, exdate)
JNI_PROPERTY(KAndroidExtras::java::lang::String, originalId)
JNI_PROPERTY(jlong, instanceId)
JNI_PROPERTY(jint, accessLevel)
JNI_PROPERTY(jint, availability)
JNI_PROPERTY(KAndroidExtras::java::lang::String, uid2445)
JNI_PROPERTY(KAndroidExtras::Jni::Array<JniAttendeeData>, attendees)
JNI_PROPERTY(KAndroidExtras::Jni::Array<JniExtendedPropertyData>, extendedProperties)
JNI_PROPERTY(KAndroidExtras::Jni::Array<JniReminderData>, reminders)
};
#endif
/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/