#ifndef PLUGIN_mainserver_H
#define PLUGIN_mainserver_H

#include "SH_plugins_loader.h"
#include "SH_plugins.h"
#include <QApplication>
#include <QFileInfo>
#include <qvariantedit.h>


class MainServerPlugin: public SHPluginBaseBlock {
public:
	MainServerPlugin();
	QString name() const override {return "Main SHS server";}
	QString description() const override {return "Using Server Designer";}
	QString version() const override {return "0.1";}
	PropertyStorage addProperties(const BlockItem * block, PropertyStorage cur_props = PropertyStorage()) override;
	PropertyStorage addPropertiesToProject() const override;

	QList<PluginAction> addActions(const BlockItem * block) override;
	void runAction(BlockItem * block, const PluginAction & action, const PropertyStorage & proj_props = PropertyStorage()) override;
	QString generatedDatabaseFile(const BlockItem * block) override;
	QString generatedConnectionFile(const BlockItem * block) override;
	void checkBlock(BlockItem * block) override;
	bool checkAction(const BlockItem * block, const PluginAction & action) override;
	QList<BlockType> createBlockTypes() override;

private:
	void runConnectionEdit(BlockItem* block, const QByteArray &model);
	
};


SHS_BUILTIN_PLUGIN(MainServerPlugin)


#endif
