#include "tabwidget.h"
#include "plugin_tabwidget.h"

#include <QtCore/QtPlugin>
#include <QDesignerFormEditorInterface>
#include <QDesignerPropertyEditorInterface>


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

void SHSTabWidgetPlugin::initialize(QDesignerFormEditorInterface * /* core */) {
	if (m_initialized)
		return;

	// Add extension registrations, etc. here

	m_initialized = true;
}

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

QWidget * SHSTabWidgetPlugin::createWidget(QWidget * parent) {
	return new SHSTabWidget(parent);
}

QString SHSTabWidgetPlugin::name() const {
	return QLatin1String("SHSTabWidget");
}

QString SHSTabWidgetPlugin::group() const {
	return QLatin1String("SHS Widgets");
}

QIcon SHSTabWidgetPlugin::icon() const {
	return QIcon(":/icons/tabwidget.png");
}

QString SHSTabWidgetPlugin::toolTip() const {
	return QLatin1String("");
}

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

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

QString SHSTabWidgetPlugin::domXml() const {
	return QLatin1String(
		"<widget class=\"SHSTabWidget\" name=\"tabWidget\">"
		" <widget class=\"QWidget\" name=\"tab\">"
		"  <attribute name=\"title\">"
		"   <string>Tab 1</string>"
		"  </attribute>"
		" </widget>"
		" <widget class=\"QWidget\" name=\"tab_2\">"
		"  <attribute name=\"title\">"
		"   <string>Tab 2</string>"
		"  </attribute>"
		" </widget>"
		"</widget>");
}

QString SHSTabWidgetPlugin::includeFile() const {
	return QLatin1String("tabwidget.h");
}

