KPublicTransport::LocationRequest

Search for usage in LXR

KPublicTransport::LocationRequest Class Reference

#include <locationrequest.h>

Properties

QStringList backends
 
float latitude
 
KPublicTransport::Location location
 
float longitude
 
int maximumDistance
 
int maximumResults
 
QString name
 
KPublicTransport::Location::Types types
 

Public Member Functions

 LocationRequest (const Location &locaction)
 
QStringList backendIds () const
 
QString cacheKey () const
 
bool hasCoordinate () const
 
bool isValid () const
 
float latitude () const
 
Location location () const
 
float longitude () const
 
QString name () const
 
void setBackendIds (const QStringList &backendIds)
 
void setCoordinate (float lat, float lon)
 
void setLatitude (float lat)
 
void setLocation (const Location &location)
 
void setLongitude (float lon)
 
void setName (const QString &name)
 

Detailed Description

Describes a location search.

Either a geo coordinate, a name or an address must be specified as search criteria.

Definition at line 27 of file locationrequest.h.

Property Documentation

Location LocationRequest::location
readwrite

Location object containing the search parameters.

Definition at line 31 of file locationrequest.h.

int KPublicTransport::LocationRequest::maximumDistance
readwrite

When searching by coordinate, the expected maximum distance of the results in meters.

Note
This is only an optimization hint for backends, not a guarantee that all results comply with this constraint.

Definition at line 42 of file locationrequest.h.

int KPublicTransport::LocationRequest::maximumResults
readwrite

The maximum amount of expected results.

Note
This is only an optimization hint for backends, not a guarantee that all results comply with this constraint.

Definition at line 47 of file locationrequest.h.

KPublicTransport::Location::Types KPublicTransport::LocationRequest::types
readwrite

The type of locations you are interested in.

Note
This is only an optimization hint for backends, not a guarantee that all results comply with this constraint.

Definition at line 52 of file locationrequest.h.

Constructor & Destructor Documentation

LocationRequest::LocationRequest ( const Location locaction)

Create a LocationRequest from locaction.

Whatever fields set in location will be used for the search request.

Definition at line 38 of file locationrequest.cpp.

Member Function Documentation

QStringList LocationRequest::backendIds ( ) const

Identifiers of the backends that should be queried.

See also
setBackendIds()

Definition at line 125 of file locationrequest.cpp.

QString LocationRequest::cacheKey ( ) const

Unique string representation used for caching results.

Definition at line 107 of file locationrequest.cpp.

bool LocationRequest::hasCoordinate ( ) const

Returns true if a valid geo coordinate has been set.

Definition at line 88 of file locationrequest.cpp.

bool LocationRequest::isValid ( ) const

Returns true if this is a valid request, that is it has enough parameters set to perform a query.

Definition at line 44 of file locationrequest.cpp.

float KPublicTransport::LocationRequest::latitude ( ) const

Latitude of the location to search.

float KPublicTransport::LocationRequest::longitude ( ) const

Longitude of the location to search.

QString KPublicTransport::LocationRequest::name ( ) const

The name of the location to search.

void LocationRequest::setBackendIds ( const QStringList backendIds)

Set identifiers of backends that should be queried.

Settings this is only needed when you want explicit control over this, leaving this empty picks suitable backends automatically.

Definition at line 130 of file locationrequest.cpp.

void LocationRequest::setCoordinate ( float  lat,
float  lon 
)

Search by geo coordinate.

Definition at line 82 of file locationrequest.cpp.

void LocationRequest::setLatitude ( float  lat)

Sets the latitude of the location to search.

Definition at line 65 of file locationrequest.cpp.

void LocationRequest::setLongitude ( float  lon)

Sets the longitude of the location to search.

Definition at line 76 of file locationrequest.cpp.

void LocationRequest::setName ( const QString name)

Search by name or name fragment.

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