#include "touchbuttframeplugin.h"

#include "touchbuttframe.h"

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


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

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

	// Add extension registrations, etc. here
	// core->propertyEditor()->property();
	m_initialized = true;
}

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

QWidget * TouchButtFramePlugin::createWidget(QWidget * parent) {
	TouchButtFrame * tbw = new TouchButtFrame(parent);
	QStringList l;
	l.append("First");
	l.append("Second");
	tbw->setButtons(l);
	return tbw;
}

QString TouchButtFramePlugin::name() const {
	return QLatin1String("TouchButtFrame");
}

QString TouchButtFramePlugin::group() const {
	return QLatin1String("Touch Widgets");
}

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

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

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

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

QString TouchButtFramePlugin::domXml() const {
	return QLatin1String("<ui language=\"c++\">\n"
	                     " <widget class=\"TouchButtFrame\" name=\"touchButtFrame\">\n"
	                     "  <property name=\"geometry\">\n"
	                     "   <rect>\n"
	                     "    <x>0</x>\n"
	                     "    <y>0</y>\n"
	                     "    <width>100</width>\n"
	                     "    <height>100</height>\n"
	                     "   </rect>\n"
	                     "  </property>\n"
	                     " </widget>\n"
	                     "</ui>\n");
}

QString TouchButtFramePlugin::includeFile() const {
	return QLatin1String("touchbuttframe.h");
}
