diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-02-02 16:38:24 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-04-20 20:55:51 +0300 |
commit | 19e11293676db729909e10659f3e0710a251a03b (patch) | |
tree | 830650dd1a9a885df8df05d60c521a8f90273200 /platform/qt/include | |
parent | dd075d53edaa34d530bdd4a876ab329f9de45f44 (diff) | |
download | qtlocation-mapboxgl-19e11293676db729909e10659f3e0710a251a03b.tar.gz |
[Qt] Add the QMapbox header with QMapbox datatypes
Diffstat (limited to 'platform/qt/include')
-rw-r--r-- | platform/qt/include/QMapbox | 1 | ||||
-rw-r--r-- | platform/qt/include/qmapbox.hpp | 28 | ||||
-rw-r--r-- | platform/qt/include/qmapboxgl.hpp | 38 |
3 files changed, 41 insertions, 26 deletions
diff --git a/platform/qt/include/QMapbox b/platform/qt/include/QMapbox new file mode 100644 index 0000000000..a8479c09aa --- /dev/null +++ b/platform/qt/include/QMapbox @@ -0,0 +1 @@ +#include "qmapbox.hpp" diff --git a/platform/qt/include/qmapbox.hpp b/platform/qt/include/qmapbox.hpp new file mode 100644 index 0000000000..8877d730bb --- /dev/null +++ b/platform/qt/include/qmapbox.hpp @@ -0,0 +1,28 @@ +#ifndef QMAPBOX_H +#define QMAPBOX_H + +#include <QList> +#include <QPair> +#include <QString> + +// This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style + +namespace QMapbox { + +typedef QPair<double, double> Coordinate; +typedef QList<Coordinate> Coordinates; +typedef QList<Coordinates> CoordinateSegments; + +typedef quint32 AnnotationID; +typedef QList<AnnotationID> AnnotationIDs; + +typedef QPair<Coordinate, QString> PointAnnotation; +typedef QList<PointAnnotation> PointAnnotations; + +// FIXME: We need to add support for custom style properties +typedef QPair<CoordinateSegments, QString> ShapeAnnotation; +typedef QList<ShapeAnnotation> ShapeAnnotations; + +} + +#endif // QMAPBOX_H diff --git a/platform/qt/include/qmapboxgl.hpp b/platform/qt/include/qmapboxgl.hpp index b817d5226b..01538268d7 100644 --- a/platform/qt/include/qmapboxgl.hpp +++ b/platform/qt/include/qmapboxgl.hpp @@ -1,8 +1,8 @@ #ifndef QMAPBOXGL_H #define QMAPBOXGL_H +#include <QMapbox> #include <QObject> -#include <QPair> #include <QPointF> class QImage; @@ -77,20 +77,6 @@ class Q_DECL_EXPORT QMapboxGL : public QObject Q_PROPERTY(double pitch READ pitch WRITE setPitch) public: - typedef QPair<double, double> Coordinate; - typedef QList<Coordinate> Coordinates; - typedef QList<Coordinates> CoordinateSegments; - - typedef quint32 AnnotationID; - typedef QList<AnnotationID> AnnotationIDs; - - typedef QPair<Coordinate, QString> PointAnnotation; - typedef QList<PointAnnotation> PointAnnotations; - - // FIXME: We need to add support for custom style properties - typedef QPair<CoordinateSegments, QString> ShapeAnnotation; - typedef QList<ShapeAnnotation> ShapeAnnotations; - // Determines the orientation of the map. enum NorthOrientation { NorthUpwards, // Default @@ -135,9 +121,9 @@ public: NorthOrientation northOrientation() const; void setNorthOrientation(NorthOrientation); - Coordinate coordinate() const; - void setCoordinate(const Coordinate &); - void setCoordinateZoom(const Coordinate &, double zoom); + QMapbox::Coordinate coordinate() const; + void setCoordinate(const QMapbox::Coordinate &); + void setCoordinateZoom(const QMapbox::Coordinate &, double zoom); void setGestureInProgress(bool inProgress); @@ -147,14 +133,14 @@ public: void setClasses(const QStringList &); QStringList getClasses() const; - AnnotationID addPointAnnotation(const PointAnnotation &); - AnnotationIDs addPointAnnotations(const PointAnnotations &); + QMapbox::AnnotationID addPointAnnotation(const QMapbox::PointAnnotation &); + QMapbox::AnnotationIDs addPointAnnotations(const QMapbox::PointAnnotations &); - AnnotationID addShapeAnnotation(const ShapeAnnotation &); - AnnotationIDs addShapeAnnotations(const ShapeAnnotations &); + QMapbox::AnnotationID addShapeAnnotation(const QMapbox::ShapeAnnotation &); + QMapbox::AnnotationIDs addShapeAnnotations(const QMapbox::ShapeAnnotations &); - void removeAnnotation(AnnotationID); - void removeAnnotations(const AnnotationIDs &); + void removeAnnotation(QMapbox::AnnotationID); + void removeAnnotations(const QMapbox::AnnotationIDs &); bool isRotating() const; bool isScaling() const; @@ -169,8 +155,8 @@ public: void addAnnotationIcon(const QString &name, const QImage &sprite); - QPointF pixelForCoordinate(const Coordinate &) const; - Coordinate coordinateForPixel(const QPointF &) const; + QPointF pixelForCoordinate(const QMapbox::Coordinate &) const; + QMapbox::Coordinate coordinateForPixel(const QPointF &) const; void setMargins(const QMargins &margins); QMargins margins() const; |