KItinerary
calendarhandler.cpp
44 return LocationUtil::toAddress(addr).formatted(KContacts::AddressFormatStyle::MultiLineInternational);
49 return LocationUtil::toAddress(addr).formatted(KContacts::AddressFormatStyle::SingleLineInternational);
55static void fillTrainReservation(const TrainReservation &reservation, const KCalendarCore::Event::Ptr &event);
56static void fillBusReservation(const BusReservation &reservation, const KCalendarCore::Event::Ptr &event);
57static void fillBoatReservation(const BoatReservation &reservation, const KCalendarCore::Event::Ptr &event);
64static void fillFoodReservation(const FoodEstablishmentReservation &reservation, const KCalendarCore::Event::Ptr &event);
65static void fillRentalCarReservation(const RentalCarReservation &reservation, const KCalendarCore::Event::Ptr &event);
66static void fillTaxiReservation(const TaxiReservation &reservation, const KCalendarCore::Event::Ptr &event);
77 if (!(JsonLd::canConvert<Reservation>(reservation) || JsonLd::canConvert<KItinerary::Event>(reservation)) || !calendar) {
85 if (startDt.isValid() && endDt.isValid() && startDt == startDt.date().startOfDay(startDt.timeZone())
169 if (JsonLd::canConvert<Reservation>(reservation) && JsonLd::convert<Reservation>(reservation).reservationStatus() == Reservation::ReservationCancelled) {
171 event->setSummary(i18nc("canceled train/flight/loading reservation", "Canceled: %1", event->summary()));
179 const auto payload = QJsonDocument(JsonLdDocument::toJson(reservations)).toJson(QJsonDocument::Compact);
190 const auto flight = reservations.at(0).value<FlightReservation>().reservationFor().value<Flight>();
197 event->setSummary(i18n("Flight %1 from %2 to %3", flightNumber, airportDisplayCode(depPort), airportDisplayCode(arrPort)));
209 const auto it = std::find_if(existinAlarms.begin(), existinAlarms.end(), [startOffset](const Alarm::Ptr &other) {
227 desc.push_back(i18n("Boarding time: %1", QLocale().toString(boardingTime.time(), QLocale::ShortFormat)));
252static void fillTrainReservation(const TrainReservation &reservation, const KCalendarCore::Event::Ptr &event)
258 event->setSummary(i18n("Train %1 from %2 to %3", trip.trainNumber(), depStation.name(), arrStation.name()));
286static void fillBusReservation(const BusReservation &reservation, const KCalendarCore::Event::Ptr &event)
292 event->setSummary(i18n("Bus %1 from %2 to %3", trip.busNumber(), depStation.name(), arrStation.name()));
311static void fillBoatReservation(const KItinerary::BoatReservation &reservation, const KCalendarCore::Event::Ptr &event)
329 if (!ticket.ticketNumber().isEmpty() && ticket.ticketNumber() != reservation.reservationNumber()) {
351 desc.push_back(i18n("Check-in: %1", QLocale().toString(reservation.checkinTime().time(), QLocale::ShortFormat)));
354 desc.push_back(i18n("Check-out: %1", QLocale().toString(reservation.checkoutTime().time(), QLocale::ShortFormat)));
407 const auto it = std::find_if(existinAlarms.begin(), existinAlarms.end(), [startOffset](const Alarm::Ptr &other) {
424 const auto ev = reservations.at(0).value<EventReservation>().reservationFor().value<KItinerary::Event>();
456static void fillFoodReservation(const FoodEstablishmentReservation &reservation, const KCalendarCore::Event::Ptr &event)
486static void fillRentalCarReservation(const RentalCarReservation &reservation, const KCalendarCore::Event::Ptr &event)
502 desc.push_back(i18n("Pickup location: %1\n%2\n", rentalCalPickup.name(), formatAddress(addressPickUp)));
506 desc.push_back(i18n("Dropoff location: %1\n%2\n", dropOff.name(), formatAddress(dropOff.address())));
519static void fillTaxiReservation(const TaxiReservation &reservation, const KCalendarCore::Event::Ptr &event)
535 const QString description = i18n("Reservation reference: %1\nUnder name: %2\nPickup location: %3",
QTimeZone timeZone() const
Event::List events(const QDate &date, const QTimeZone &timeZone={}, EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending) const
Transparent
Food-related business (such as a restaurant, or a bakery).
Definition organization.h:94
static QJsonArray toJson(const QList< QVariant > &data)
Serialize instantiated data types to JSON-LD.
Definition jsonlddocument.cpp:497
static QList< QVariant > fromJson(const QJsonArray &array)
Convert JSON-LD array into instantiated data types.
Definition jsonlddocument.cpp:339
static bool isSame(const QVariant &lhs, const QVariant &rhs)
Checks if two Reservation or Trip values refer to the same booking element.
Definition mergeutil.cpp:155
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
char * toString(const EngineQuery &query)
QList< QVariant > reservationsForEvent(const QSharedPointer< KCalendarCore::Event > &event)
Returns the reservations for this event.
Definition calendarhandler.cpp:117
void fillEvent(const QList< QVariant > &reservations, const QSharedPointer< KCalendarCore::Event > &event)
Fills event with details of reservations.
Definition calendarhandler.cpp:135
bool canCreateEvent(const QVariant &reservation)
Checks if the given reservation contains enough information to create an iCal event from it.
Definition calendarhandler.cpp:124
QList< QSharedPointer< KCalendarCore::Event > > findEvents(KCalendarCore::Calendar *calendar, const QVariant &reservation)
Attempts to find calendar events in calendar for reservation.
Definition calendarhandler.cpp:75
bool canConvert(const QVariant &value)
Checks if the given value can be up-cast to T.
Definition datatypes.h:31
GeoCoordinates geo(const QVariant &location)
Returns the geo coordinates of a given location.
Definition locationutil.cpp:118
QVariant location(const QVariant &res)
Returns the location of a non-transport reservation.
Definition locationutil.cpp:97
QDateTime startDateTime(const QVariant &elem)
Returns the (start) time associated with the given element.
Definition sortutil.cpp:29
QDateTime endDateTime(const QVariant &res)
Returns the (end) time associated with the given element.
Definition sortutil.cpp:101
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
QDateTime endOfDay() const const
QDateTime startOfDay() const const
QDateTime addSecs(qint64 s) const const
QDate date() const const
bool isValid() const const
qint64 secsTo(const QDateTime &other) const const
QTimeZone timeZone() const const
Compact
QJsonArray array() const const
QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error)
QByteArray toJson(JsonFormat format) const const
const_reference at(qsizetype i) const const
bool isEmpty() const const
void push_back(parameter_type value)
ShortFormat
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
QString join(QChar separator) const const
bool isEmpty() const const
QString toString(FormattingOptions options) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:14:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:14:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.