KGAPI2::StaticMapUrl

Search for usage in LXR

KGAPI2::StaticMapUrl Class Reference

#include <staticmapurl.h>

Public Types

enum  ImageFormat {
  PNG , PNG32 , GIF , JPG ,
  JPGBaseline
}
 
enum  LocationType { Undefined = -1 , String , KABCAddress , KABCGeo }
 
enum  MapType { Roadmap , Satellite , Terrain , Hybrid }
 
enum  Scale { Normal = 1 , TwiceBigger = 2 }
 

Public Member Functions

 StaticMapUrl ()
 
 StaticMapUrl (const KContacts::Address &address, const QSize &size, quint32 zoom, bool sensor)
 
 StaticMapUrl (const KContacts::Geo &geo, const QSize &size, quint32 zoom, bool sensor)
 
 StaticMapUrl (const QString &location, const QSize &size, quint32 zoom, bool sensor)
 
 StaticMapUrl (const StaticMapUrl &other)
 
virtual ~StaticMapUrl ()
 
ImageFormat format () const
 
bool isValid () const
 
KContacts::Address locationAddress () const
 
KContacts::Geo locationGeo () const
 
QString locationString () const
 
LocationType locationType () const
 
MapType mapType () const
 
QList< StaticMapMarkermarkers () const
 
StaticMapUrloperator= (const StaticMapUrl &other)
 
QList< StaticMapPathpaths () const
 
Scale scale () const
 
bool sensorUsed () const
 
void setFormat (const ImageFormat format)
 
void setLocation (const KContacts::Address &address)
 
void setLocation (const KContacts::Geo &geo)
 
void setLocation (const QString &location)
 
void setMapType (const MapType type)
 
void setMarker (const StaticMapMarker &marker)
 
void setMarkers (const QList< StaticMapMarker > &markers)
 
void setPath (const StaticMapPath &path)
 
void setPaths (const QList< StaticMapPath > &paths)
 
void setScale (const Scale scale)
 
void setSensorUsed (const bool sensor)
 
void setSize (const QSize &size)
 
void setVisibleLocation (const KContacts::Address &address)
 
void setVisibleLocation (const KContacts::Geo &geo)
 
void setVisibleLocation (const QString &location)
 
void setZoomLevel (const quint32 zoom)
 
QSize size () const
 
QUrl url () const
 
KContacts::Address visibleLocationAddress () const
 
KContacts::Geo visibleLocationGeo () const
 
QString visibleLocationString () const
 
LocationType visibleLocationType () const
 
qint8 zoomLevel () const
 

Detailed Description

A class to build a URL from StaticMapMarkers and StaticMapPaths to fetch a map tile.

Author
Jan Grulich grulj.nosp@m.a@gm.nosp@m.ail.c.nosp@m.om
Since
0.4

Definition at line 29 of file staticmapurl.h.

Member Enumeration Documentation

◆ ImageFormat

enum KGAPI2::StaticMapUrl::ImageFormat

Definition at line 34 of file staticmapurl.h.

◆ LocationType

enum KGAPI2::StaticMapUrl::LocationType

Definition at line 32 of file staticmapurl.h.

◆ MapType

enum KGAPI2::StaticMapUrl::MapType

Definition at line 36 of file staticmapurl.h.

◆ Scale

enum KGAPI2::StaticMapUrl::Scale

Definition at line 38 of file staticmapurl.h.

Constructor & Destructor Documentation

◆ StaticMapUrl() [1/5]

StaticMapUrl::StaticMapUrl ( )
explicit

Constructs an empty StaticMapUrl.

Definition at line 79 of file staticmapurl.cpp.

◆ StaticMapUrl() [2/5]

StaticMapUrl::StaticMapUrl ( const QString & location,
const QSize & size,
quint32 zoom,
bool sensor )

Constructs a new StaticMapUrl.

Parameters
locationLocation of map center in QString
sizeRequested size of the map image
zoomZoom level of map
sensorSensor specifies whether the application requesting the static map is using a sensor to determine the user's location.

Definition at line 104 of file staticmapurl.cpp.

◆ StaticMapUrl() [3/5]

StaticMapUrl::StaticMapUrl ( const KContacts::Address & address,
const QSize & size,
quint32 zoom,
bool sensor )

Constructs a new StaticMapUrl.

Parameters
addressLocation of map center in KContacts::Address
sizeRequested size of the map image
zoomZoom level of map
sensorSensor specifies whether the application requesting the static map is using a sensor to determine the user's location.

Definition at line 113 of file staticmapurl.cpp.

◆ StaticMapUrl() [4/5]

StaticMapUrl::StaticMapUrl ( const KContacts::Geo & geo,
const QSize & size,
quint32 zoom,
bool sensor )

Constructs a new StaticMapUrl.

Parameters
geoLocation of map center in KContacts::Geo
sizeRequested size of the map image
zoomZoom level of map
sensorSensor specifies whether the application requesting the static map is using a sensor to determine the user's location.

Definition at line 122 of file staticmapurl.cpp.

◆ StaticMapUrl() [5/5]

StaticMapUrl::StaticMapUrl ( const StaticMapUrl & other)

Copy constructor.

Definition at line 84 of file staticmapurl.cpp.

◆ ~StaticMapUrl()

StaticMapUrl::~StaticMapUrl ( )
virtual

Destructor.

Definition at line 89 of file staticmapurl.cpp.

Member Function Documentation

◆ format()

StaticMapUrl::ImageFormat StaticMapUrl::format ( ) const

Returns map image format.

Definition at line 136 of file staticmapurl.cpp.

◆ isValid()

bool StaticMapUrl::isValid ( ) const

Returns whether map url is valid.

Definition at line 146 of file staticmapurl.cpp.

◆ locationAddress()

KContacts::Address StaticMapUrl::locationAddress ( ) const

Returns map center in KContacts::Address.

Returns empty KContacts::Address if location is not defined in KContacts::Address

Definition at line 187 of file staticmapurl.cpp.

◆ locationGeo()

KContacts::Geo StaticMapUrl::locationGeo ( ) const

Returns map center in KContacts::Geo.

Returns invalid KContacts::Geo if location is not defined in KContacts::Geo

Definition at line 201 of file staticmapurl.cpp.

◆ locationString()

QString StaticMapUrl::locationString ( ) const

Returns map center in QString.

Returns empty QString if location is not defined in QString

Definition at line 173 of file staticmapurl.cpp.

◆ locationType()

StaticMapUrl::LocationType StaticMapUrl::locationType ( ) const

Returns in which format the location is stored.

Definition at line 131 of file staticmapurl.cpp.

◆ mapType()

StaticMapUrl::MapType StaticMapUrl::mapType ( ) const

Returns type of map.

Definition at line 214 of file staticmapurl.cpp.

◆ markers()

QList< StaticMapMarker > StaticMapUrl::markers ( ) const

Returns list of markers.

Returns empty QList if no marker were added

Definition at line 224 of file staticmapurl.cpp.

◆ operator=()

StaticMapUrl & StaticMapUrl::operator= ( const StaticMapUrl & other)

Assignment operator.

Definition at line 94 of file staticmapurl.cpp.

◆ paths()

QList< StaticMapPath > StaticMapUrl::paths ( ) const

Returns list paths.

Returns empty QList if no path were added

Definition at line 241 of file staticmapurl.cpp.

◆ scale()

StaticMapUrl::Scale StaticMapUrl::scale ( ) const

Returns scale of map.

Definition at line 268 of file staticmapurl.cpp.

◆ sensorUsed()

bool StaticMapUrl::sensorUsed ( ) const

Returns whether the application uses a sensor to determine user's location.

Definition at line 278 of file staticmapurl.cpp.

◆ setFormat()

void StaticMapUrl::setFormat ( const ImageFormat format)

Sets map image format (default is PNG)

Parameters
format

Definition at line 141 of file staticmapurl.cpp.

◆ setLocation() [1/3]

void StaticMapUrl::setLocation ( const KContacts::Address & address)

Defines center of the map.

Parameters
addressLocation (required when no markers are present) of center of the map in KContacts::Address

Definition at line 192 of file staticmapurl.cpp.

◆ setLocation() [2/3]

void StaticMapUrl::setLocation ( const KContacts::Geo & geo)

Defines center of the map.

Parameters
geoLocation (required when no markers are present) of center of the map in KContacts::Geo

Definition at line 206 of file staticmapurl.cpp.

◆ setLocation() [3/3]

void StaticMapUrl::setLocation ( const QString & location)

Defines center of the map.

Parameters
locationLocation (required when no markers are present) of center of the map in QString

Definition at line 178 of file staticmapurl.cpp.

◆ setMapType()

void StaticMapUrl::setMapType ( const MapType type)

Sets type of map (roadmap by default)

Parameters
type

Definition at line 219 of file staticmapurl.cpp.

◆ setMarker()

void StaticMapUrl::setMarker ( const StaticMapMarker & marker)

Adds marker to map.

Parameters
marker

Definition at line 229 of file staticmapurl.cpp.

◆ setMarkers()

void StaticMapUrl::setMarkers ( const QList< StaticMapMarker > & markers)

Adds markers to map.

Parameters
markers

Definition at line 236 of file staticmapurl.cpp.

◆ setPath()

void StaticMapUrl::setPath ( const StaticMapPath & path)

Adds path to map.

Parameters
path

Definition at line 246 of file staticmapurl.cpp.

◆ setPaths()

void StaticMapUrl::setPaths ( const QList< StaticMapPath > & paths)

Adds paths to map.

Parameters
paths

Definition at line 253 of file staticmapurl.cpp.

◆ setScale()

void StaticMapUrl::setScale ( const Scale scale)

Sets scale of map (default is 1)

Parameters
scale

Definition at line 273 of file staticmapurl.cpp.

◆ setSensorUsed()

void StaticMapUrl::setSensorUsed ( const bool sensor)

Sets whether the application uses a sensor to determine the user's location.

Parameters
sensor

Definition at line 283 of file staticmapurl.cpp.

◆ setSize()

void StaticMapUrl::setSize ( const QSize & size)

Sets size of requested map tile.

Parameters
sizeMaximum size is 640x640

Definition at line 263 of file staticmapurl.cpp.

◆ setVisibleLocation() [1/3]

void StaticMapUrl::setVisibleLocation ( const KContacts::Address & address)

Sets visible location.

You can use this instead of using center and zoom parameters.

Visible specifies location that should remain visible on the map, though no markers or other indicators will be displayed. Use this parameter to ensure that certain features or map location are shown on the static map.

Parameters
address

Definition at line 307 of file staticmapurl.cpp.

◆ setVisibleLocation() [2/3]

void StaticMapUrl::setVisibleLocation ( const KContacts::Geo & geo)

Sets visible location.

You can use this instead of using center and zoom parameters.

Visible specifies location that should remain visible on the map, though no markers or other indicators will be displayed. Use this parameter to ensure that certain features or map location are shown on the static map.

Parameters
geo

Definition at line 321 of file staticmapurl.cpp.

◆ setVisibleLocation() [3/3]

void StaticMapUrl::setVisibleLocation ( const QString & location)

Sets visible location.

You can use this instead of using center and zoom parameters.

Specifies location that should remain visible on the map, though no markers or other indicators will be displayed. Use this parameter to ensure that certain features or map location are shown on the static map.

Parameters
location

Definition at line 293 of file staticmapurl.cpp.

◆ setZoomLevel()

void StaticMapUrl::setZoomLevel ( const quint32 zoom)

Sets zoom level of the map.

Parameters
zoomZoom parameter can be in range 0 to 21 where 21 is maximum zoom level.

Definition at line 339 of file staticmapurl.cpp.

◆ size()

QSize StaticMapUrl::size ( ) const

Returns size of map tile.

Definition at line 258 of file staticmapurl.cpp.

◆ url()

QUrl StaticMapUrl::url ( ) const

Returns constructed url from all defined parameters.

Definition at line 344 of file staticmapurl.cpp.

◆ visibleLocationAddress()

KContacts::Address StaticMapUrl::visibleLocationAddress ( ) const

Returns visible area in KContacts::Address.

Returns empty KContacts::Address if visible area is not defined in KContacts::Address

Definition at line 302 of file staticmapurl.cpp.

◆ visibleLocationGeo()

KContacts::Geo StaticMapUrl::visibleLocationGeo ( ) const

Returns visible area in KContacts::Geo.

Returns empty KContacts::Geo if visible area is not defined in KContacts::Geo

Definition at line 316 of file staticmapurl.cpp.

◆ visibleLocationString()

QString StaticMapUrl::visibleLocationString ( ) const

Returns visible area in QString.

Returns empty QString if visible area is not defined in QString

Definition at line 288 of file staticmapurl.cpp.

◆ visibleLocationType()

StaticMapUrl::LocationType StaticMapUrl::visibleLocationType ( ) const

Returns type of visible location.

Definition at line 329 of file staticmapurl.cpp.

◆ zoomLevel()

qint8 StaticMapUrl::zoomLevel ( ) const

Returns zoom level of map.

Returns -1 if zoom level is not defined

Definition at line 334 of file staticmapurl.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:19:52 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.