#ifndef QVARIANTEDIT_CUSTOM_H
#define QVARIANTEDIT_CUSTOM_H

#include <QDebug>
#include <QWidget>
#include <QMap>
#include "qad_export.h"


class QVariantEdit;


class QAD_EXPORT QVariantEditorFactoryBase {
	friend class QVariantEdit;
public:
	QVariantEditorFactoryBase() {}
	virtual QWidget * createEditor() = 0;
private:

};


class QAD_EXPORT QVariantEditorFactories {
public:
	static void registerEditorFactory(int meta_id, QVariantEditorFactoryBase * f);
	static void unregisterEditorFactory(int meta_id);
	static bool isRegisteredEditorFactory(int meta_id);
	static QVariantEditorFactoryBase * editorFactory(int meta_id);

private:
	QVariantEditorFactories();
	static QVariantEditorFactories * instance();

	QMap<int, QVariantEditorFactoryBase * > factories;
};


#endif // QVARIANTEDIT_CUSTOM_H
