#include "virtual_keyboard_plugin.h"

#include "virtual_keyboard.h"

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


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

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

	// Add extension registrations, etc. here

	m_initialized = true;
}

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

QWidget * VirtualKeyboardPlugin::createWidget(QWidget * parent) {
	auto ret = new VirtualKeyboard(parent);
	ret->setAlwaysVisible(true);
	return ret;
}

QString VirtualKeyboardPlugin::name() const {
	return QLatin1String("VirtualKeyboard");
}

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

QIcon VirtualKeyboardPlugin::icon() const {
	return QIcon(":/icons/widgets/virtual-keyboard.png");
}

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

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

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

QString VirtualKeyboardPlugin::domXml() const {
	return QLatin1String("<widget class=\"VirtualKeyboard\" name=\"virtualKeyboard\">\n</widget>\n");
}

QString VirtualKeyboardPlugin::includeFile() const {
	return QLatin1String("virtual_keyboard.h");
}
