KPublicTransport

triprequest.h
1/*
2 SPDX-FileCopyrightText: 2025 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#ifndef KPUBLICTRANSPORT_TRIPREQUEST_H
7#define KPUBLICTRANSPORT_TRIPREQUEST_H
8
9#include "kpublictransport_export.h"
10
11#include <KPublicTransport/Datatypes>
12
13#include <QMetaType>
14#include <QSharedDataPointer>
15
16class QJsonObject;
17
18namespace KPublicTransport {
19
20class JourneySection;
21class TripRequestPrivate;
22
23/** Request for a single trip. That is, one specific run along a route.
24 * This is usually based on a JourneySection from a preceeding journey query.
25 *
26 * @since 25.04
27 */
28class KPUBLICTRANSPORT_EXPORT TripRequest
29{
30 KPUBLICTRANSPORT_GADGET(TripRequest)
31 /** A JourneySection for which the full trip is requested. */
32 KPUBLICTRANSPORT_PROPERTY(KPublicTransport::JourneySection, journeySection, setJourneySection)
33 /** Identifiers of backends that should be queried.
34 * Settings this is only needed when you want explicit control over this, leaving
35 * this empty picks suitable backends automatically.
36 */
37 KPUBLICTRANSPORT_PROPERTY(QStringList, backendIds, setBackendIds)
38
39 /** Download graphic assets such as line logos for the data requested here.
40 * Default: @c false
41 */
42 KPUBLICTRANSPORT_PROPERTY(bool, downloadAssets, setDownloadAssets)
43
44public:
45 /** Create a TripRequest for @p journeySection. */
47
48 /** Returns @c true if this is a valid request, that is it has enough parameters set to perform a query. */
49 [[nodiscard]] bool isValid() const;
50
51 ///@cond internal
52 static QJsonObject toJson(const TripRequest &req);
53 ///@endcond
54};
55
56}
57
58#endif
A segment of a journey plan.
Definition journey.h:32
bool isValid() const
Returns true if this is a valid request, that is it has enough parameters set to perform a query.
TripRequest(const JourneySection &journeySection)
Create a TripRequest for journeySection.
QStringList backendIds
Identifiers of backends that should be queried.
Definition triprequest.h:37
KPublicTransport::JourneySection journeySection
A JourneySection for which the full trip is requested.
Definition triprequest.h:32
bool downloadAssets
Download graphic assets such as line logos for the data requested here.
Definition triprequest.h:42
Query operations and data types for accessing realtime public transport information from online servi...
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 11:52:18 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.