KItinerary

sortutil.h
1/*
2 SPDX-FileCopyrightText: 2018 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
11class QDateTime;
12class QVariant;
13
14namespace KItinerary {
15
16/** Utility function for sorting reservations/visits/events. */
17namespace SortUtil
18{
19 /** Returns the (start) time associated with the given element.
20 * This can be either a Reservation object, or a reservable object
21 * if that has a time associated (such as an Event).
22 */
23 KITINERARY_EXPORT QDateTime startDateTime(const QVariant &elem);
24
25 /** Returns the (end) time associated with the given element.
26 * This can be either a Reservation object, or a reservable object
27 * if that has a time associated (such as an Event).
28 */
29 KITINERARY_EXPORT QDateTime endDateTime(const QVariant &res);
30
31 /** Sorting function for top-level reservation/visit/event elements. */
32 KITINERARY_EXPORT bool isBefore(const QVariant &lhs, const QVariant &rhs);
33
34 /** Returns whether the given element has a start time.
35 * This can be @c false even is SortUtil::startDateTime returns a valid
36 * result, if there is only a start date available.
37 */
38 KITINERARY_EXPORT bool hasStartTime(const QVariant &elem);
39 /** Returns whether the given element has an end time.
40 * @see hasStartTime
41 */
42 KITINERARY_EXPORT bool hasEndTime(const QVariant &elem);
43}
44
45}
46
QDateTime startDateTime(const QVariant &elem)
Returns the (start) time associated with the given element.
Definition sortutil.cpp:29
bool isBefore(const QVariant &lhs, const QVariant &rhs)
Sorting function for top-level reservation/visit/event elements.
Definition sortutil.cpp:169
bool hasStartTime(const QVariant &elem)
Returns whether the given element has a start time.
Definition sortutil.cpp:198
bool hasEndTime(const QVariant &elem)
Returns whether the given element has an end time.
Definition sortutil.cpp:216
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:28:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.