#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QColorDialog>
#include <QListWidgetItem>
#include <QTime>
#include <memory>
#include <QJsonObject>

#include<items/item.h>

class MainObject;

namespace Ui
{
class MainWindow;
}

class MainWindow : public QMainWindow
{
	Q_OBJECT

public:
	explicit MainWindow(MainObject * const mainObject, QWidget *parent = nullptr);
	~MainWindow();

	void store(QJsonObject& json) const;
	void load(const QJsonObject& json);

private:
	Ui::MainWindow *ui;
	MainObject* const mainObject;

	QColorDialog colorChooser;

signals:

	void sigSave();
	void createdItem(ItemAddRequest request);
	void sigSetRgb(const QColor color);

private slots:

	//RGB
	void showPowerItemDialog();
	void showItemCreationDialog();
	void showSensorCreationDialog();

public slots:

	void changeHeaderLableText(QString string);
};

#endif // MAINWINDOW_H
