KPublicTransport::Line

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
}
 

Properties

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

Public Member Functions

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)
 

Friends

void LineUtil::setMetaData (Line &, const LineMetaData &)
 

Detailed Description

A public transport line.

Definition at line 23 of file line.h.

Member Enumeration Documentation

Mode of transportation.

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

Enumerator
RideShare 

peer-to-peer ride sharing/car pooling

Definition at line 31 of file line.h.

Property Documentation

QColor Line::color
readwrite

Color of the line.

Definition at line 56 of file line.h.

bool Line::hasColor
read

true if a line color is set.

Definition at line 58 of file line.h.

bool Line::hasLogo
read

true if the line has a logo.

Definition at line 78 of file line.h.

bool Line::hasModeLogo
read

true if the line has a mode logo.

Definition at line 89 of file line.h.

bool Line::hasTextColor
read

true if a text color is set.

Definition at line 62 of file line.h.

QString Line::logo
read

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 76 of file line.h.

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

Type of transport.

Definition at line 64 of file line.h.

QString Line::modeLogo
read

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 87 of file line.h.

QString KPublicTransport::Line::modeString
readwrite

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 69 of file line.h.

QString KPublicTransport::Line::name
readwrite

Name of the line.

Definition at line 54 of file line.h.

QColor KPublicTransport::Line::textColor
readwrite

Text color to use on top of the line color.

Definition at line 60 of file line.h.

Member Function Documentation

Line Line::fromJson ( const QJsonObject obj)
static

Deserialize an object from JSON.

Definition at line 152 of file line.cpp.

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

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

Definition at line 95 of file line.cpp.

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

Merge two Line instances.

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

Definition at line 123 of file line.cpp.

QJsonObject Line::toJson ( const Line l)
static

Serializes one object to JSON.

Definition at line 143 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-2021 The KDE developers.
Generated on Sat Oct 16 2021 23:07:08 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.