1
/* * This file is part of Maliit framework *
3
* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: maliit-discuss@lists.maliit.org
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License version 2.1 as published by the Free Software Foundation
11
* and appearing in the file LICENSE.LGPL included in the packaging
15
#include "minputmethodquickplugin.h"
16
#include "minputmethodquick.h"
17
#include "maliitquick.h"
18
#include "mkeyoverridequick.h"
20
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
21
#include <QQmlComponent>
23
#include <QDeclarativeComponent> // needed for qmlRegisterUncreatableType
27
QStringList gQmlImportPaths;
30
class MInputMethodQuickPluginPrivate
33
QSet<Maliit::HandlerState> supportedStates;
35
MInputMethodQuickPluginPrivate()
37
supportedStates << Maliit::OnScreen << Maliit::Hardware;
41
MInputMethodQuickPlugin::MInputMethodQuickPlugin()
42
: d_ptr(new MInputMethodQuickPluginPrivate)
44
qmlRegisterUncreatableType<MInputMethodQuick>
45
( "com.meego.keyboard-quick", 1, 0, "MInputMethodQuick",
46
"There's only one controller and it is in the C++ side" );
47
qmlRegisterUncreatableType<MaliitQuick>
48
( "com.meego.maliitquick", 1, 0, "Maliit",
49
"This is the class used to export Maliit Enums" );
50
// this do not have to be included to use it, but it have to be
52
qmlRegisterUncreatableType<MKeyOverrideQuick>
53
( "com.meego.maliitquick.keyoverridequick", 1, 0, "KeyOverrideQuick",
54
"This registers MKeyOverrideQuick" );
57
MInputMethodQuickPlugin::~MInputMethodQuickPlugin()
62
void MInputMethodQuickPlugin::setQmlImportPaths(const QStringList &paths)
64
gQmlImportPaths = paths;
67
QStringList MInputMethodQuickPlugin::qmlImportPaths()
69
return gQmlImportPaths;
72
MAbstractInputMethod *MInputMethodQuickPlugin::createInputMethod(MAbstractInputMethodHost *host)
74
return new MInputMethodQuick(host, qmlFileName());
77
QSet<Maliit::HandlerState> MInputMethodQuickPlugin::supportedStates() const
79
Q_D(const MInputMethodQuickPlugin);
81
return d->supportedStates;