File indexing completed on 2025-03-09 04:45:36
0001 /* 0002 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef RESERVATIONHELPER_H 0008 #define RESERVATIONHELPER_H 0009 0010 #include <utility> 0011 0012 class QString; 0013 class QVariant; 0014 0015 /** Helper methods for dealing with KItinerary reservation elements. */ 0016 namespace ReservationHelper 0017 { 0018 std::pair<QString, QString> lineNameAndNumber(const QVariant &res); 0019 0020 bool equals(const QVariant &lhs, const QVariant &rhs); 0021 0022 /** Returns the UIC company code for @p res, if any. */ 0023 QString uicCompanyCode(const QVariant &res); 0024 /** Returns the VDV org id for @p res, if any. */ 0025 QString vdvOrganizationId(const QVariant &res); 0026 0027 /** Returns whether @p res is an unbound reservation. */ 0028 bool isUnbound(const QVariant &res); 0029 0030 /** Checks whether the given reservation is canclled. */ 0031 bool isCancelled(const QVariant &res); 0032 } 0033 0034 #endif // RESERVATIONHELPER_H