WimaBridge.h 1.07 KB
Newer Older
1 2 3
#pragma once

#include <QObject>
4
#include <QSharedPointer>
5 6 7 8 9 10 11 12 13 14

#include "WimaPlanData.h"

class WimaController;
class WimaPlaner;

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

21 22 23 24
  Q_PROPERTY(WimaPlaner *wimaPlaner READ wimaPlaner WRITE setWimaPlaner NOTIFY
                 wimaPlanerChanged)
  Q_PROPERTY(WimaController *wimaController READ wimaController WRITE
                 setWimaController NOTIFY wimaControllerChanged)
25

26 27
  WimaController *wimaController();
  WimaPlaner *wimaPlaner();
28

29
  Q_INVOKABLE WimaBridge *thisPointer();
30

31 32
  void setWimaController(WimaController *controller);
  void setWimaPlaner(WimaPlaner *planer);
33 34

signals:
35 36
  void wimaControllerChanged(WimaController *controller);
  void wimaPlanerChanged(WimaPlaner *planer);
37 38

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

41
private:
42 43
  WimaController *_wimaController;
  WimaPlaner *_wimaPlaner;
44
};