#pragma once

#include <QObject>
#include "QGeoCoordinate"

#include "WimaAreaData.h"
#include "WimaServiceArea.h"



class WimaServiceAreaData : public WimaAreaData
{
    Q_OBJECT

public:
    WimaServiceAreaData(QObject *parent = nullptr);
    WimaServiceAreaData(const WimaServiceAreaData &other, QObject *parent = nullptr);
    WimaServiceAreaData(const WimaServiceArea &other, QObject *parent = nullptr);
    WimaServiceAreaData& operator=(const WimaServiceAreaData &otherData);
    WimaServiceAreaData& operator=(const WimaServiceArea &otherArea);

    const QGeoCoordinate &takeOffPosition() const;
    const QGeoCoordinate &landPosition() const;

    QString type() const;
    WimaServiceAreaData *Clone() const {return new WimaServiceAreaData();}
    static const char* typeString;

signals:
    void takeOffPositionChanged(const QGeoCoordinate& other);
    void landPositionChanged(const QGeoCoordinate& other);

public slots:
    void setTakeOffPosition(const QGeoCoordinate& newCoordinate);
    void setLandPosition(const QGeoCoordinate& newCoordinate);

protected:
    void assign(const WimaServiceAreaData &other);
    void assign(const WimaServiceArea &other);
private:
    // see WimaServieArea.h for explanation
    QGeoCoordinate      _takeOffPosition;
    QGeoCoordinate      _landPosition;
};

