#include "graphic_analysis_plugin.h"

#include "graphic_analysis.h"

#include <QDesignerFormEditorInterface>
#include <QExtensionManager>
#include <QtPlugin>


GraphicAnalysisPlugin::GraphicAnalysisPlugin(QObject * parent): QObject(parent) {
	m_initialized = m_designer = false;
}


void GraphicAnalysisPlugin::initialize(QDesignerFormEditorInterface * core) {
	m_designer = true;
	if (m_initialized) return;
	m_initialized = true;
}


bool GraphicAnalysisPlugin::isInitialized() const {
	return m_initialized;
}


QWidget * GraphicAnalysisPlugin::createWidget(QWidget * parent) {
	auto ret = new GraphicAnalysis(parent);
	if (m_designer) ret->m_fakeGL = true;
	return ret;
}


QString GraphicAnalysisPlugin::name() const {
	return QLatin1String("GraphicAnalysis");
}


QString GraphicAnalysisPlugin::group() const {
	return QLatin1String("Display Widgets");
}


QIcon GraphicAnalysisPlugin::icon() const {
	return QIcon(":/icons/widgets/graphic.png");
}


QString GraphicAnalysisPlugin::toolTip() const {
	return QLatin1String(""); // QLatin1String("Widget for display any math graphics with grid and navigation");
}


QString GraphicAnalysisPlugin::whatsThis() const {
	return QLatin1String("");
}


bool GraphicAnalysisPlugin::isContainer() const {
	return false;
}


QString GraphicAnalysisPlugin::domXml() const {
	return QLatin1String("<widget class=\"GraphicAnalysis\" name=\"graphicAnalysis\">\n</widget>\n");
}


QString GraphicAnalysisPlugin::includeFile() const {
	return QLatin1String("graphic_analysis.h");
}
