KPublicTransport::JourneyRequest

Search for usage in LXR

KPublicTransport::JourneyRequest Class Reference

#include <journeyrequest.h>

Public Types

enum  DateTimeMode { Arrival , Departure }
 

Properties

QVariantList accessModes
 
QStringList backends
 
QDateTime dateTime
 
DateTimeMode dateTimeMode
 
bool downloadAssets
 
QVariantList egressModes
 
KPublicTransport::Location from
 
bool includeIntermediateStops
 
bool includePaths
 
QVariantList individualTransportModes
 
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
 
const std::vector< IndividualTransport > & individualTransportModes () const
 
bool isValid () const
 
const std::vector< Line::Mode > & lineModes () const
 
bool requiresBikeTransport () 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 setIndividualTransportModes (std::vector< IndividualTransport > &&modes)
 
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

Enumerator
Arrival 

dateTime() represents the desired arriva time.

Departure 

dateTime() represents the desired departure time.

Definition at line 81 of file journeyrequest.h.

Property Documentation

◆ accessModes

QVariantList KPublicTransport::JourneyRequest::accessModes
readwrite

Access modes.

Definition at line 69 of file journeyrequest.h.

◆ backends

QStringList KPublicTransport::JourneyRequest::backends
readwrite

Definition at line 89 of file journeyrequest.h.

◆ dateTime

QDateTime JourneyRequest::dateTime
readwrite

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

Definition at line 45 of file journeyrequest.h.

◆ dateTimeMode

DateTimeMode KPublicTransport::JourneyRequest::dateTimeMode
readwrite

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

Definition at line 87 of file journeyrequest.h.

◆ downloadAssets

bool KPublicTransport::JourneyRequest::downloadAssets
readwrite

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

Default: false

Definition at line 94 of file journeyrequest.h.

◆ egressModes

QVariantList KPublicTransport::JourneyRequest::egressModes
readwrite

Egress modes.

Definition at line 71 of file journeyrequest.h.

◆ from

KPublicTransport::Location KPublicTransport::JourneyRequest::from
readwrite

The starting point of the journey search.

Definition at line 41 of file journeyrequest.h.

◆ includeIntermediateStops

bool KPublicTransport::JourneyRequest::includeIntermediateStops
readwrite

Retrieve intermediate stops for the queried journeys as well.

Note
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
readwrite

Retrieve path details for the journeys.

Note
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.

◆ individualTransportModes

QVariantList KPublicTransport::JourneyRequest::individualTransportModes
readwrite

Individual transport modes for direct connections.

Only considered when, modes contains JourneySection::IndividualTransport.

Definition at line 79 of file journeyrequest.h.

◆ lineModes

QVariantList KPublicTransport::JourneyRequest::lineModes
readwrite

Line modes.

Definition at line 74 of file journeyrequest.h.

◆ maximumResults

int KPublicTransport::JourneyRequest::maximumResults
readwrite

The maximum amount of expected results.

Note
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
readwrite

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
readwrite

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
nodiscard

Requested access modes.

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

Definition at line 164 of file journeyrequest.cpp.

◆ backendIds()

QStringList JourneyRequest::backendIds ( ) const
nodiscard

Identifiers of the backends that should be queried.

See also
setBackendIds()

Definition at line 142 of file journeyrequest.cpp.

◆ cacheKey()

QString JourneyRequest::cacheKey ( ) const
nodiscard

Unique string representation used for caching results.

Definition at line 269 of file journeyrequest.cpp.

◆ egressModes()

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

Requested egress modes.

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

Definition at line 186 of file journeyrequest.cpp.

◆ individualTransportModes()

const std::vector< IndividualTransport > & JourneyRequest::individualTransportModes ( ) const
nodiscard

Requested individual transport modes.

Individual transport modes for direct journeys.

Definition at line 247 of file journeyrequest.cpp.

◆ isValid()

bool JourneyRequest::isValid ( ) const
nodiscard

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
nodiscard

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 208 of file journeyrequest.cpp.

◆ requiresBikeTransport()

bool JourneyRequest::requiresBikeTransport ( ) const
nodiscard

Returns true if the specified access/egress modes require bike transportation on public transport.

Definition at line 220 of file journeyrequest.cpp.

◆ setAccessModes()

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

Sets the requested access modes.

Definition at line 174 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 147 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 196 of file journeyrequest.cpp.

◆ setIndividualTransportModes()

void JourneyRequest::setIndividualTransportModes ( std::vector< IndividualTransport > && modes)

Sets individual transport modes considered for direct journeys.

Definition at line 252 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.

Note
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 225 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 Mon Nov 18 2024 12:07:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.