KItinerary::LocationUtil

KItinerary::LocationUtil Namespace Reference

Enumerations

enum  Accuracy { Exact , CityLevel , WalkingDistance }
 

Functions

PostalAddress address (const QVariant &location)
 
QVariant arrivalLocation (const QVariant &res)
 
QVariant departureLocation (const QVariant &res)
 
int distance (const GeoCoordinates &coord1, const GeoCoordinates &coord2)
 
int distance (float lat1, float lon1, float lat2, float lon2)
 
GeoCoordinates geo (const QVariant &location)
 
QUrl geoUri (const QVariant &location)
 
bool isLocationChange (const QVariant &res)
 
bool isSameLocation (const QVariant &lhs, const QVariant &rhs, Accuracy accuracy=Exact)
 
QVariant location (const QVariant &res)
 
QString name (const QVariant &location)
 

Detailed Description

Utility functions related to location information.

Enumeration Type Documentation

◆ Accuracy

Location comparison accuracy.

Enumerator
Exact 

Locations match exactly.

CityLevel 

Locations are in the same city.

WalkingDistance 

Locations are close enough together to not need transportation.

Definition at line 60 of file locationutil.h.

Function Documentation

◆ address()

PostalAddress KItinerary::LocationUtil::address ( const QVariant & location)

Returns the address of the given location.

Definition at line 130 of file locationutil.cpp.

◆ arrivalLocation()

QVariant KItinerary::LocationUtil::arrivalLocation ( const QVariant & res)

Returns the arrival location of the given reservation.

This assumes isLocationChange(res) == true.

Definition at line 54 of file locationutil.cpp.

◆ departureLocation()

QVariant KItinerary::LocationUtil::departureLocation ( const QVariant & res)

Returns the departure location of the given reservation.

This assumes isLocationChange(res) == true.

Definition at line 74 of file locationutil.cpp.

◆ distance() [1/2]

int KItinerary::LocationUtil::distance ( const GeoCoordinates & coord1,
const GeoCoordinates & coord2 )

Computes the distance between to geo coordinates in meters.

Definition at line 158 of file locationutil.cpp.

◆ distance() [2/2]

int KItinerary::LocationUtil::distance ( float lat1,
float lon1,
float lat2,
float lon2 )

Computes the distance between to geo coordinates in meters.

Definition at line 164 of file locationutil.cpp.

◆ geo()

GeoCoordinates KItinerary::LocationUtil::geo ( const QVariant & location)

Returns the geo coordinates of a given location.

Definition at line 118 of file locationutil.cpp.

◆ geoUri()

QUrl KItinerary::LocationUtil::geoUri ( const QVariant & location)

Returns a geo: URI for the given location.

Definition at line 308 of file locationutil.cpp.

◆ isLocationChange()

bool KItinerary::LocationUtil::isLocationChange ( const QVariant & res)

Returns true if the given reservation is a location change.

That is, some form of transport reservation with different departure and arrival locations.

Definition at line 41 of file locationutil.cpp.

◆ isSameLocation()

bool KItinerary::LocationUtil::isSameLocation ( const QVariant & lhs,
const QVariant & rhs,
LocationUtil::Accuracy accuracy = Exact )

Returns true if the given locations are the same.

Parameters
lhsThe left hand side in the location condition.
rhsThe right hand side in the location condition.
accuracyDefines how closely the locations have to match.

Definition at line 260 of file locationutil.cpp.

◆ location()

QVariant KItinerary::LocationUtil::location ( const QVariant & res)

Returns the location of a non-transport reservation.

This assumes isLocationChange(res) == false.

Definition at line 97 of file locationutil.cpp.

◆ name()

QString KItinerary::LocationUtil::name ( const QVariant & location)

Returns a description of the location.

Definition at line 142 of file locationutil.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:50:52 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.