File indexing completed on 2024-05-12 04:42:43
0001 /* 0002 SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KPUBLICTRANSPORT_JOURNEYUTIL_P_H 0008 #define KPUBLICTRANSPORT_JOURNEYUTIL_P_H 0009 0010 class QDateTime; 0011 class QTimeZone; 0012 0013 namespace KPublicTransport { 0014 0015 class Journey; 0016 0017 /** Internal utility functions for dealing with journeys. */ 0018 namespace JourneyUtil 0019 { 0020 /** Departure time of the first transport section (overall departure time, if there is none). 0021 * Unlike the overall departure time, this guarantees a stable order in the face of merging journeys. 0022 */ 0023 QDateTime firstTransportDeparture(const Journey &jny); 0024 0025 /** Less than comparison on first transport departure time. */ 0026 bool firstTransportDepartureLessThan(const Journey &lhs, const Journey &rhs); 0027 /** Equal comparison on first transport departure time. */ 0028 bool firstTransportDepartureEqual(const Journey &lhs, const Journey &rhs); 0029 0030 /** Reinterpret all floating times as times with the given timezone. */ 0031 void applyTimeZone(Journey &jny, const QTimeZone &tz); 0032 } 0033 0034 } 0035 0036 #endif // KPUBLICTRANSPORT_JOURNEYUTIL_P_H