#ifndef SHSCHEMEPROCESS_H
#define SHSCHEMEPROCESS_H

#include <QListWidget>
#include <blockview.h>
#include "SH_plugins.h"


class SHSchemeProcess: public QObject {
	Q_OBJECT
public:
	explicit SHSchemeProcess(QObject * parent = 0);
	~SHSchemeProcess();
	
	BlockView * blockView() const {return view_;}
	void setBlockView(BlockView * view) {view_ = view;}
	void setErrorsList(QListWidget * list);

protected:
	
	enum EWType {
		NameEmpty,
		NamesEqual,
		NamesNonC,
		IDsEqual,
		WrongBusConnect,
		DanglingBus
		
	};
	
	void addItem(SHS::MessageClass c, EWType t, QGraphicsItem * i = 0);
	
	void checkScheme();
	void checkPlugins();
	
	BlockView * view_;
	QListWidget * list_;
	QGraphicsItem * cur_item;
	QMap<int, QIcon> icons;
	QMap<EWType, QString> texts;
	
public slots:
	void checkForErrors();
	void addMessage(int c, QString text);
	
private slots:
	void itemSelected();
	
signals:
	
};

#endif // SHSCHEMEPROCESS_H
