#ifndef ACTORSETTINGSDIALOG_H
#define ACTORSETTINGSDIALOG_H

#include <QDialog>
#include <QWidget>
#include "actorwidgets/alarmwidget.h"
#include "actorwidgets/sensoractorwidget.h"
#include "actorwidgets/timeractorwidget.h"
#include "actorwidgets/regulatorwdiget.h"
#include "actorwidgets/polynomalactorwidget.h"
#include "actorwidgets/scriptactorwidget.h"

class ScriptEditorDialog;

namespace Ui
{
class ActorSettingsDialog;
}

class ActorSettingsDialog : public QDialog
{
	Q_OBJECT

private:
	std::shared_ptr<Actor> actor_;
	QWidget* widget;

	void init();

public:
	ActorSettingsDialog(std::shared_ptr<AlarmTime> actor, QWidget *parent = nullptr);
	ActorSettingsDialog(std::shared_ptr<SensorActor> actor, QWidget *parent = nullptr);
	ActorSettingsDialog(std::shared_ptr<Regulator> actor, QWidget *parent = nullptr);
	ActorSettingsDialog(std::shared_ptr<TimerActor> actor, QWidget *parent = nullptr);
	ActorSettingsDialog(std::shared_ptr<PolynomalActor> actor, QWidget *parent = nullptr);
	ActorSettingsDialog(std::shared_ptr<ScriptActor> actor, QWidget *parent = nullptr);
	ActorSettingsDialog(std::shared_ptr<Actor> actor, QWidget *parent);
	~ActorSettingsDialog();

	void hideCancle(const bool hide);

private slots:
	void changeAction(int index);
	void valueChanged(int value);
	void editAsItem();
	void setEnabled();
	void editScript();

private:
	Ui::ActorSettingsDialog *ui;
};

#endif // ACTORSETTINGSDIALOG_H
