#pragma once

#include <QObject>
#include "WimaArea.h"
#include "WimaTrackerPolyline.h"

class WimaServiceArea : public WimaArea
{
    Q_OBJECT
public:
    WimaServiceArea(QObject* parent = nullptr);
    WimaServiceArea(WimaArea* other = nullptr, QObject* parent = nullptr);

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


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

    // Property acessors
    QGeoCoordinate*          takeOffPosition             (void)  { return &_takeOffPosition;}
    QGeoCoordinate*          landPosition                (void)  { return &_landPosition;}
    WimaTrackerPolyline*     polyline                    (void)  { return &_polyline;}
    WimaVCorridor*           vehicleCorridor             (void)  { return _vehicleCorridor;}


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

signals:
    void takeOffPositionChanged         (void);
    void landPositionChanged            (void);
    void vehicleCorridorChanged         (WimaVCorridor* corridor);
private:
    WimaTrackerPolyline _polyline;
    QGeoCoordinate      _takeOffPosition;
    QGeoCoordinate      _landPosition;
    WimaVCorridor*      _vehicleCorridor;
};

