Search for usage in LXR

KPublicTransport::JourneyRequest Class Reference

#include <journeyrequest.h>

Public Types

enum  DateTimeMode { Arrival , Departure }


QVariantList accessModes
QStringList backends
QDateTime dateTime
DateTimeMode dateTimeMode
bool downloadAssets
QVariantList egressModes
KPublicTransport::Location from
bool includeIntermediateStops
bool includePaths
QVariantList lineModes
int maximumResults
KPublicTransport::JourneySection::Modes modes
KPublicTransport::Location to

Public Member Functions

 JourneyRequest (const Location &from, const Location &to)
const std::vector< IndividualTransport > & accessModes () const
QStringList backendIds () const
QString cacheKey () const
const std::vector< IndividualTransport > & egressModes () const
bool isValid () const
const std::vector< Line::Mode > & lineModes () const
void setAccessModes (std::vector< IndividualTransport > &&accessModes)
void setArrivalTime (const QDateTime &dt)
void setBackendIds (const QStringList &backendIds)
void setDepartureTime (const QDateTime &dt)
void setEgressModes (std::vector< IndividualTransport > &&egressModes)
void setLineModes (std::vector< Line::Mode > &&modes)

Detailed Description

Describes a journey search.

By default journeys departing now are searched.

Definition at line 36 of file journeyrequest.h.

Member Enumeration Documentation

◆ DateTimeMode


dateTime() represents the desired arriva time.


dateTime() represents the desired departure time.

Definition at line 77 of file journeyrequest.h.

Property Documentation

◆ accessModes

QVariantList KPublicTransport::JourneyRequest::accessModes

Access modes.

Definition at line 69 of file journeyrequest.h.

◆ backends

QStringList KPublicTransport::JourneyRequest::backends

Definition at line 85 of file journeyrequest.h.

◆ dateTime

QDateTime JourneyRequest::dateTime

Date/time at which the journey should start/end.

Definition at line 45 of file journeyrequest.h.

◆ dateTimeMode

DateTimeMode KPublicTransport::JourneyRequest::dateTimeMode

Controls whether to search for journeys starting or ending at the given time.

Definition at line 83 of file journeyrequest.h.

◆ downloadAssets

bool KPublicTransport::JourneyRequest::downloadAssets

Download graphic assets such as line logos for the data requested here.

Default: false

Definition at line 90 of file journeyrequest.h.

◆ egressModes

QVariantList KPublicTransport::JourneyRequest::egressModes

Egress modes.

Definition at line 71 of file journeyrequest.h.

◆ from

KPublicTransport::Location KPublicTransport::JourneyRequest::from

The starting point of the journey search.

Definition at line 41 of file journeyrequest.h.

◆ includeIntermediateStops

bool KPublicTransport::JourneyRequest::includeIntermediateStops

Retrieve intermediate stops for the queried journeys as well.

This is only an optimization hint for backends, not a guarantee that all results will contain this information.

Definition at line 61 of file journeyrequest.h.

◆ includePaths

bool KPublicTransport::JourneyRequest::includePaths

Retrieve path details for the journeys.

This is only an optimization hint for backends, not a guarantee that all results will contain this information.

Definition at line 66 of file journeyrequest.h.

◆ lineModes

QVariantList KPublicTransport::JourneyRequest::lineModes

Line modes.

Definition at line 74 of file journeyrequest.h.

◆ maximumResults

int KPublicTransport::JourneyRequest::maximumResults

The maximum amount of expected results.

This is only an optimization hint for backends, not a guarantee that all results comply with this constraint.

Definition at line 56 of file journeyrequest.h.

◆ modes

KPublicTransport::JourneySection::Modes KPublicTransport::JourneyRequest::modes

Modes of transportation that should be considered for this query.

Only transit modes matter (public transport, rented vehicles, etc), values for tranfers/waits/etc are ignored.

Definition at line 51 of file journeyrequest.h.

◆ to

KPublicTransport::Location KPublicTransport::JourneyRequest::to

The journey destination.

Definition at line 43 of file journeyrequest.h.

Constructor & Destructor Documentation

◆ JourneyRequest()

JourneyRequest::JourneyRequest ( const Location & from,
const Location & to )

Search a journey from from to to.

Definition at line 58 of file journeyrequest.cpp.

Member Function Documentation

◆ accessModes()

const std::vector< IndividualTransport > & JourneyRequest::accessModes ( ) const

Requested access modes.

That is individual transport modes on the first (access) leg of the journey. Default: walking

Definition at line 163 of file journeyrequest.cpp.

◆ backendIds()

QStringList JourneyRequest::backendIds ( ) const

Identifiers of the backends that should be queried.

See also

Definition at line 141 of file journeyrequest.cpp.

◆ cacheKey()

QString JourneyRequest::cacheKey ( ) const

Unique string representation used for caching results.

Definition at line 234 of file journeyrequest.cpp.

◆ egressModes()

const std::vector< IndividualTransport > & JourneyRequest::egressModes ( ) const

Requested egress modes.

That is, individual transport modes for the last (egress) leg of the journey. Default: walking

Definition at line 185 of file journeyrequest.cpp.

◆ isValid()

bool JourneyRequest::isValid ( ) const

Returns true if this is a valid request, that is, it has enough parameters set to perform a query.

Definition at line 65 of file journeyrequest.cpp.

◆ lineModes()

const std::vector< Line::Mode > & JourneyRequest::lineModes ( ) const

Requested line modes.

That is, the possible types of public transport lines to consider for public transports sections of the journey. Default: all

Definition at line 207 of file journeyrequest.cpp.

◆ setAccessModes()

void JourneyRequest::setAccessModes ( std::vector< IndividualTransport > && accessModes)

Sets the requested access modes.

Definition at line 173 of file journeyrequest.cpp.

◆ setArrivalTime()

void JourneyRequest::setArrivalTime ( const QDateTime & dt)

Sets the desired arrival time.

This is mutually exclusive to setting a desired departure time.

Definition at line 91 of file journeyrequest.cpp.

◆ setBackendIds()

void JourneyRequest::setBackendIds ( const QStringList & backendIds)

Set identifiers of backends that should be queried.

Settings this is only needed when you want explicit control over this, leaving this empty picks suitable backends automatically.

Definition at line 146 of file journeyrequest.cpp.

◆ setDepartureTime()

void JourneyRequest::setDepartureTime ( const QDateTime & dt)

Set the desired departure time.

This is mutually exclusive to setting a desired arrival time.

Definition at line 84 of file journeyrequest.cpp.

◆ setEgressModes()

void JourneyRequest::setEgressModes ( std::vector< IndividualTransport > && egressModes)

Sets the requested egress modes.

Definition at line 195 of file journeyrequest.cpp.

◆ setLineModes()

void JourneyRequest::setLineModes ( std::vector< Line::Mode > && modes)

Sets the requested line modes.

An empty list is considered as all modes being allowed.

This relies on backends actually supporting this and is thus does not provide any guarantee that the results wont contain other modes as well.

Definition at line 212 of file journeyrequest.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.