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
#ifndef M_INPUT_METHOD_QUICK_PLUGIN
16
#define M_INPUT_METHOD_QUICK_PLUGIN
18
#include <maliit/plugins/inputmethodplugin.h>
22
#include <QStringList>
25
class MInputMethodQuickPluginPrivate;
27
//! \brief Creates an input method plugin that allows to use QML.
29
//! To create a QML-based virtual keyboard or input method plugin, derive from
30
//! this class and reimplement MInputMethodPlugin::name() and
31
//! MInputMethodQuickPlugin::qmlFileName().
32
//! The QML components can communicate with the framework through the
33
//! MInputMethodQuick context.
34
//! If the provided MInputMethodQuick class is not sufficient, then reimplement
35
//! MInputMethodQuickPlugin::createInputMethodSettings as well and create a
36
//! custom MAbstractInputMethod instance there.
37
class MInputMethodQuickPlugin
38
: public Maliit::Plugins::InputMethodPlugin
41
MInputMethodQuickPlugin();
42
virtual ~MInputMethodQuickPlugin();
44
// FIXME: Add getter as vfunc with next API break and remove both static functions.
45
//! Add list of import paths that will be used by the internal QML engine of this plugin.
46
//! For this function to take any effect, it needs to be called before the
47
//! reimplementation of createInputMethod calls MInputMethodQuickPlugin::createInputMethod.
48
static void setQmlImportPaths(const QStringList &paths);
51
//! Used to read the current list of import paths.
52
static QStringList qmlImportPaths();
56
virtual MAbstractInputMethod *createInputMethod(MAbstractInputMethodHost *host);
57
virtual QSet<Maliit::HandlerState> supportedStates() const;
60
//! Which QML file to load.
61
virtual QString qmlFileName() const = 0;
64
Q_DISABLE_COPY(MInputMethodQuickPlugin);
65
Q_DECLARE_PRIVATE(MInputMethodQuickPlugin);
66
MInputMethodQuickPluginPrivate *const d_ptr;
69
Q_DECLARE_INTERFACE(MInputMethodQuickPlugin,
70
"com.meego.meegoimframework.MInputMethodQuickPlugin/1.1")
72
#endif // M_INPUT_METHOD_QUICK_PLUGIN