summaryrefslogtreecommitdiffstats
path: root/src/positioning/qgeocoordinateobject_p.h
blob: 4636467495438922bcdf8d3e8dcd1d38bed8333a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QGEOCOORDINATEOBJECT_P_H
#define QGEOCOORDINATEOBJECT_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QtPositioning/private/qpositioningglobal_p.h>
#include <QObject>
#include <QProperty>
#include <QGeoCoordinate>
#include <QVariantMap>

QT_BEGIN_NAMESPACE

class Q_POSITIONING_EXPORT QGeoCoordinateObject : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QGeoCoordinate coordinate READ coordinate WRITE setCoordinate NOTIFY
                       coordinateChanged BINDABLE bindableCoordinate)

public:
    QGeoCoordinateObject(QObject *parent = 0);
    QGeoCoordinateObject(const QGeoCoordinate &c, QObject *parent = 0);
    virtual ~QGeoCoordinateObject();

    bool operator==(const QGeoCoordinate &other) const;
    bool operator==(const QGeoCoordinateObject &other) const;
    inline bool operator!=(const QGeoCoordinate &other) const {
        return !operator==(other);
    }
    inline bool operator!=(const QGeoCoordinateObject &other) const {
        return !operator==(other);
    }

    QGeoCoordinate coordinate() const;
    void setCoordinate(const QGeoCoordinate &c);
    QBindable<QGeoCoordinate> bindableCoordinate();

Q_SIGNALS:
    void coordinateChanged();

protected:
    Q_OBJECT_BINDABLE_PROPERTY(QGeoCoordinateObject, QGeoCoordinate, m_coordinate,
                               &QGeoCoordinateObject::coordinateChanged)
};

QT_END_NAMESPACE

QT_DECL_METATYPE_EXTERN_TAGGED(QGeoCoordinateObject*, QGeoCoordinateObject_ptr,
                               Q_POSITIONING_EXPORT)

#endif // QGEOCOORDINATEOBJECT_P_H