#pragma once

#include <QObject>
#include <QSharedPointer>

#include "WimaPlanData.h"

class WimaController;
class WimaPlaner;

//!
//! \brief The WimaBridge class
//!
//! A bridge establishing a link between WimaController and WimaPlaner
class WimaBridge : public QObject {
  Q_OBJECT
public:
  WimaBridge(QObject *parent = nullptr);
  WimaBridge(WimaBridge &other) = delete;

  Q_PROPERTY(WimaPlaner *wimaPlaner READ wimaPlaner WRITE setWimaPlaner NOTIFY
                 wimaPlanerChanged)
  Q_PROPERTY(WimaController *wimaController READ wimaController WRITE
                 setWimaController NOTIFY wimaControllerChanged)

  WimaController *wimaController();
  WimaPlaner *wimaPlaner();

  Q_INVOKABLE WimaBridge *thisPointer();

  void setWimaController(WimaController *controller);
  void setWimaPlaner(WimaPlaner *planer);

signals:
  void wimaControllerChanged(WimaController *controller);
  void wimaPlanerChanged(WimaPlaner *planer);

public slots:
  bool setWimaPlanData(QSharedPointer<WimaPlanData> planData);

private:
  WimaController *_wimaController;
  WimaPlaner *_wimaPlaner;
};
