KItinerary

calendarhandler.h
1/*
2 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kitinerary_export.h"
10
11#include <QSharedPointer>
12template<typename T> class QList;
13class QVariant;
14
15namespace KCalendarCore {
16class Calendar;
17class Event;
18}
19
20namespace KItinerary {
21
22/** Methods for converting between ical events and JSON-LD booking data. */
23namespace CalendarHandler
24{
25 /** Attempts to find calendar events in @p calendar for @p reservation.
26 * For a complete reservation this should not return more than one element,
27 * for a minimal cancellation element however this can return multiple events
28 * (e.g. all trip segments covered by the same reservation number).
29 * @since 20.08
30 */
32findEvents(KCalendarCore::Calendar *calendar, const QVariant &reservation);
35 const QVariant &reservation);
36
37/** Returns the reservations for this event.
38 * In case of a mult-travler trip, the result contains more than one
39 * reservation.
40 */
41KITINERARY_EXPORT QList<QVariant>
43
44/** Checks if the given @p reservation contains enough information to create an
45 * iCal event from it. */
46KITINERARY_EXPORT bool canCreateEvent(const QVariant &reservation);
47
48/** Fills @p event with details of @p reservations.
49 * Can be used on new events or to update existing ones.
50 * @param reservations When passing more than one reservation here, those must
51 * be for the same multi-traveler trip. That is, MergeUtil::isSame() returns
52 * true for Reservation::reservationFor for each pair of values.
53 * @param event The event.
54 */
55KITINERARY_EXPORT void
56fillEvent(const QList<QVariant> &reservations,
58}
59
60}
61
QList< QVariant > reservationsForEvent(const QSharedPointer< KCalendarCore::Event > &event)
Returns the reservations for this event.
void fillEvent(const QList< QVariant > &reservations, const QSharedPointer< KCalendarCore::Event > &event)
Fills event with details of reservations.
bool canCreateEvent(const QVariant &reservation)
Checks if the given reservation contains enough information to create an iCal event from it.
QList< QSharedPointer< KCalendarCore::Event > > findEvents(KCalendarCore::Calendar *calendar, const QVariant &reservation)
Attempts to find calendar events in calendar for reservation.
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:48 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.