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)
 
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

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 59 of file locationutil.h.

Function Documentation

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

Returns the address of the given location.

Definition at line 106 of file locationutil.cpp.

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

Returns the arrival location of the given reservation.

This assumes isLocationChange(res) == true.

Definition at line 36 of file locationutil.cpp.

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

Returns the departure location of the given reservation.

This assumes isLocationChange(res) == true.

Definition at line 53 of file locationutil.cpp.

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

Computes the distance between to geo coordinates in meters.

Definition at line 134 of file locationutil.cpp.

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

Computes the distance between to geo coordinates in meters.

Definition at line 140 of file locationutil.cpp.

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

Returns the geo coordinates of a given location.

Definition at line 94 of file locationutil.cpp.

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 23 of file locationutil.cpp.

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 226 of file locationutil.cpp.

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

Returns the location of a non-transport reservation.

This assumes isLocationChange(res) == false.

Definition at line 73 of file locationutil.cpp.

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

Returns a description of the location.

Definition at line 118 of file locationutil.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat May 15 2021 23:14:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.