Search for usage in LXR

#include <line.h>

Public Types

enum  Mode {
  Unknown , Air , Boat , Bus ,
  BusRapidTransit , Coach , Ferry , Funicular ,
  LocalTrain , LongDistanceTrain , Metro , RailShuttle ,
  RapidTransit , Shuttle , Taxi , Train ,
  Tramway , RideShare


QColor color
bool hasColor
bool hasLogo
bool hasModeLogo
bool hasTextColor
QString logo
KPublicTransport::Line::Mode mode
QString modeLogo
QString modeString
QString name
QString operatorName
QColor textColor

Public Member Functions

void applyMetaData (const Location &location, bool download)
bool hasColor () const
bool hasLogo () const
bool hasModeLogo () const
bool hasTextColor () const
QString logo () const
QString modeLogo () const

Static Public Member Functions

static Line fromJson (const QJsonObject &obj)
static bool isSame (const Line &lhs, const Line &rhs)
static Line merge (const Line &lhs, const Line &rhs)
static QJsonObject toJson (const Line &l)

Detailed Description

A public transport line.

Definition at line 19 of file line.h.

Member Enumeration Documentation

◆ Mode

Mode of transportation.

@toto direct copy from Navitia, we maybe can reduce that a bit


peer-to-peer ride sharing/car pooling

Definition at line 27 of file line.h.

Property Documentation

◆ color

QColor Line::color

Color of the line.

Definition at line 52 of file line.h.

◆ hasColor

bool KPublicTransport::Line::hasColor

true if a line color is set.

Definition at line 54 of file line.h.

◆ hasLogo

bool KPublicTransport::Line::hasLogo

true if the line has a logo.

Definition at line 74 of file line.h.

◆ hasModeLogo

bool KPublicTransport::Line::hasModeLogo

true if the line has a mode logo.

Definition at line 85 of file line.h.

◆ hasTextColor

bool KPublicTransport::Line::hasTextColor

true if a text color is set.

Definition at line 58 of file line.h.

◆ logo

QString KPublicTransport::Line::logo

Path of a local file containing the line logo.

A line logo is typically a simple icon containing the short line name and color. This is downloaded on demand, and therefore might not be available immediately.

Definition at line 72 of file line.h.

◆ mode

KPublicTransport::Line::Mode KPublicTransport::Line::mode

Type of transport.

Definition at line 60 of file line.h.

◆ modeLogo

QString KPublicTransport::Line::modeLogo

Path of a local file containing the line mode logo.

A mode logo is the logo of the mode of transportation, or "product" this line belongs to, such as the general logo for a subway or metro service of this operator or in this city. This is downloaded on demand, and therefore might not be available immediately.

Definition at line 83 of file line.h.

◆ modeString

QString KPublicTransport::Line::modeString

Human readable representation of the type of transport.

This is not necessarily a simple 1:1 mapping from mode, but can contain e.g. a product name.

Definition at line 65 of file line.h.

◆ name

QString KPublicTransport::Line::name

Name of the line.

Definition at line 50 of file line.h.

◆ operatorName

QString KPublicTransport::Line::operatorName

Name of the operator running this line.

Definition at line 88 of file line.h.

◆ textColor

QColor KPublicTransport::Line::textColor

Text color to use on top of the line color.

Definition at line 56 of file line.h.

Member Function Documentation

◆ applyMetaData()

void Line::applyMetaData ( const Location & location,
bool download )

Look up line meta data and apply what is found.

locationA location on or close to the line.
downloadWhen set to true, not yet locally present logo URLs are retrieved.

Definition at line 142 of file line.cpp.

◆ fromJson()

Line Line::fromJson ( const QJsonObject & obj)

Deserialize an object from JSON.

Line meta data isn't serialized, so you might need to call applyLineMetaData() again after loading a line.

Definition at line 165 of file line.cpp.

◆ hasColor()

bool Line::hasColor ( ) const

Definition at line 62 of file line.cpp.

◆ hasLogo()

bool Line::hasLogo ( ) const

Definition at line 77 of file line.cpp.

◆ hasModeLogo()

bool Line::hasModeLogo ( ) const

Definition at line 87 of file line.cpp.

◆ hasTextColor()

bool Line::hasTextColor ( ) const

Definition at line 67 of file line.cpp.

◆ isSame()

bool Line::isSame ( const Line & lhs,
const Line & rhs )

Checks if to instances refer to the same line (which does not necessarily mean they are exactly equal).

Definition at line 92 of file line.cpp.

◆ logo()

QString Line::logo ( ) const

Definition at line 72 of file line.cpp.

◆ merge()

Line Line::merge ( const Line & lhs,
const Line & rhs )

Merge two Line instances.

This assumes isSame(lhs, rhs) and tries to preserve the most detailed information.

Definition at line 120 of file line.cpp.

◆ modeLogo()

QString Line::modeLogo ( ) const

Definition at line 82 of file line.cpp.

◆ toJson()

QJsonObject Line::toJson ( const Line & l)

Serializes one object to JSON.

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