#pragma once

#include <QObject>
#include "WimaPolygon.h"

class WimaServicePolygon : public WimaPolygon
{
    Q_OBJECT
public:
    WimaServicePolygon(QObject* parent = nullptr);
    WimaServicePolygon(QGCMapPolygon* other, QObject* parent = nullptr);

    Q_PROPERTY(QGeoCoordinate* takeOffPosition           READ takeOffPosition                    WRITE setTakeOffPosition            NOTIFY takeOffPositionChanged)
    Q_PROPERTY(QGeoCoordinate* landPosition              READ landPosition                       WRITE setLandPosition               NOTIFY landPositionChanged)

    // Overrides from WimaPolygon
    QString         mapVisualQML    (void) const { return "WimaServicePolygonMapVisual.qml";}
    QString         editorQML       (void) const { return "WimaServicePolygonEditor.qml";}

    // Property acessors
    QGeoCoordinate*          takeOffPosition             (void)  { return &_takeOffPosition;}
    QGeoCoordinate*          landPosition                (void)  { return &_landPosition;}

    // Property setters
    void setTakeOffPosition             (QGeoCoordinate* coordinate);
    void setLandPosition                (QGeoCoordinate* coordinate);

signals:
    void takeOffPositionChanged         (void);
    void landPositionChanged            (void);
private:
    QGeoCoordinate      _takeOffPosition;
    QGeoCoordinate      _landPosition;
};

