KPublicTransport::IndividualTransport

Search for usage in LXR

KPublicTransport::IndividualTransport Class Reference

#include <individualtransport.h>

Public Types

enum  Mode { Walk , Bike , Car }
 
enum  Qualifier {
  None , Park , Rent , Dropoff ,
  Pickup
}
 

Properties

Mode mode
 
QString modeIconName
 
Qualifier qualifier
 

Public Member Functions

 IndividualTransport (Mode mode, Qualifier qualifier=None)
 
QString modeIconName () const
 
bool operator!= (const IndividualTransport &other) const
 
bool operator== (const IndividualTransport &other) const
 

Static Public Member Functions

static std::vector< IndividualTransportfromJson (const QJsonArray &array)
 
static IndividualTransport fromJson (const QJsonObject &obj)
 
static std::vector< IndividualTransportfromVariant (const QVariantList &v)
 
static Q_INVOKABLE QString modeIconName (KPublicTransport::IndividualTransport::Mode mode)
 
static QJsonObject toJson (const IndividualTransport &it)
 
static QJsonArray toJson (const std::vector< IndividualTransport > &its)
 

Detailed Description

Individual transport mode details for a journey section, and for specifying journey requests.

Definition at line 18 of file individualtransport.h.

Member Enumeration Documentation

◆ Mode

Mode of (individual) transportation.

Definition at line 23 of file individualtransport.h.

◆ Qualifier

Qualifier on how the mode of transport is used.

Enumerator
None 

not applicable, or bike is taken on public transport legs.

Park 

for access legs, vehicle is parked before taking public transport.

Rent 

use a rental vehicle

Dropoff 

for access legs: vehicle is not taken onto public transport but also doesn't need parking

Pickup 

for egress legs: vehicle is available at the last public transport leg

Definition at line 39 of file individualtransport.h.

Property Documentation

◆ mode

Mode KPublicTransport::IndividualTransport::mode
readwrite

Definition at line 29 of file individualtransport.h.

◆ modeIconName

QString KPublicTransport::IndividualTransport::modeIconName
read

Name of an icon to represent this transport mode.

This does not consider the Qualifier value. Can be an qrc: URL or a icon name compatbile with QIcon::fromTheme.

Definition at line 35 of file individualtransport.h.

◆ qualifier

Qualifier KPublicTransport::IndividualTransport::qualifier
readwrite

Definition at line 47 of file individualtransport.h.

Constructor & Destructor Documentation

◆ IndividualTransport()

IndividualTransport::IndividualTransport ( IndividualTransport::Mode mode,
IndividualTransport::Qualifier qualifier = None )

Definition at line 31 of file individualtransport.cpp.

Member Function Documentation

◆ fromJson() [1/2]

std::vector< IndividualTransport > IndividualTransport::fromJson ( const QJsonArray & array)
staticnodiscard

Deserialize a list of journey from JSON.

Definition at line 82 of file individualtransport.cpp.

◆ fromJson() [2/2]

IndividualTransport IndividualTransport::fromJson ( const QJsonObject & obj)
staticnodiscard

Deserialize an object from JSON.

Definition at line 77 of file individualtransport.cpp.

◆ fromVariant()

std::vector< IndividualTransport > IndividualTransport::fromVariant ( const QVariantList & v)
staticnodiscard

for QML bindings only

Definition at line 87 of file individualtransport.cpp.

◆ modeIconName() [1/2]

QString IndividualTransport::modeIconName ( ) const
nodiscard

Definition at line 62 of file individualtransport.cpp.

◆ modeIconName() [2/2]

QString IndividualTransport::modeIconName ( KPublicTransport::IndividualTransport::Mode mode)
staticnodiscard

Name of an icon to represent mode.

Can be an qrc: URL or a icon name compatbile with QIcon::fromTheme.

Definition at line 48 of file individualtransport.cpp.

◆ operator!=()

bool IndividualTransport::operator!= ( const IndividualTransport & other) const
nodiscard

Definition at line 43 of file individualtransport.cpp.

◆ operator==()

bool IndividualTransport::operator== ( const IndividualTransport & other) const
nodiscard

Definition at line 38 of file individualtransport.cpp.

◆ toJson() [1/2]

QJsonObject IndividualTransport::toJson ( const IndividualTransport & it)
staticnodiscard

Serializes one object to JSON.

Definition at line 67 of file individualtransport.cpp.

◆ toJson() [2/2]

QJsonArray IndividualTransport::toJson ( const std::vector< IndividualTransport > & its)
staticnodiscard

Serializes a vector of objects to JSON.

Definition at line 72 of file individualtransport.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.