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 "inputmethodquickplugin.h"
16
#include "inputmethodquick.h"
17
#include "maliitquick.h"
18
#include "keyoverridequick.h"
19
#include "abstractplatform.h"
22
#include <QQmlComponent>
27
class InputMethodQuickPluginPrivate
30
QSharedPointer<Maliit::AbstractPlatform> m_platform;
31
const QString m_filename;
32
const QString m_basename;
33
QSet<Maliit::HandlerState> m_supported_states;
35
InputMethodQuickPluginPrivate(const QString &filename,
36
const QSharedPointer<Maliit::AbstractPlatform> &platform)
37
: m_platform (platform),
39
m_basename(QFileInfo(filename).baseName()),
42
m_supported_states << Maliit::OnScreen << Maliit::Hardware;
46
InputMethodQuickPlugin::InputMethodQuickPlugin(const QString &filename,
47
const QSharedPointer<Maliit::AbstractPlatform> &platform)
48
: d_ptr(new InputMethodQuickPluginPrivate(filename, platform))
50
qmlRegisterUncreatableType<MaliitQuick>("com.meego.maliitquick", 1, 0, "Maliit",
51
"This is the class used to export Maliit Enums");
53
// this do not have to be included to use it, but it have to be
55
qmlRegisterUncreatableType<KeyOverrideQuick>
56
( "com.meego.maliitquick.keyoverridequick", 1, 0, "KeyOverrideQuick",
57
"This registers KeyOverrideQuick" );
60
InputMethodQuickPlugin::~InputMethodQuickPlugin()
63
MAbstractInputMethod *InputMethodQuickPlugin::createInputMethod(MAbstractInputMethodHost *host)
65
Q_D(InputMethodQuickPlugin);
67
return new InputMethodQuick(host, d->m_filename, d->m_platform);
70
QSet<Maliit::HandlerState> InputMethodQuickPlugin::supportedStates() const
72
Q_D(const InputMethodQuickPlugin);
74
return d->m_supported_states;
77
QString InputMethodQuickPlugin::name() const
79
Q_D(const InputMethodQuickPlugin);