~timo-jyrinki/ubuntu/trusty/maliit-framework/fix_qt52

« back to all changes in this revision

Viewing changes to input-context/input-context-plugin/minputcontextplugin.cpp

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo, Sergio Schvezov, Ricardo Salveti de Araujo
  • Date: 2013-07-23 19:47:04 UTC
  • mfrom: (1.1.2) (1.2.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130723194704-1lsy1kmlda069cea
Tags: 0.99.0+git20130615+97e8335-0ubuntu1
[ Sergio Schvezov ]
* New build from HEAD 97e8335.
* Packaging import from lp:phablet-extras/maliit-framework.

[ Ricardo Salveti de Araujo ]
* debian/control: adding vcs and fixing dependencies
* General package cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* * This file is part of Maliit framework *
2
 
 *
3
 
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
 
 * All rights reserved.
5
 
 *
6
 
 * Contact: maliit-discuss@lists.maliit.org
7
 
 *
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
12
 
 * of this file.
13
 
 */
14
 
 
15
 
#include "minputcontextplugin.h"
16
 
 
17
 
#include "connectionfactory.h"
18
 
 
19
 
#include <minputcontext.h>
20
 
#include <QString>
21
 
#include <QStringList>
22
 
 
23
 
namespace {
24
 
    const QString MaliitInputContextName(MALIIT_INPUTCONTEXT_NAME);
25
 
}
26
 
 
27
 
MInputContextPlugin::MInputContextPlugin(QObject *parent)
28
 
    : QInputContextPlugin(parent)
29
 
{
30
 
    // nothing
31
 
}
32
 
 
33
 
 
34
 
MInputContextPlugin::~MInputContextPlugin()
35
 
{
36
 
    // nothing
37
 
}
38
 
 
39
 
 
40
 
QInputContext *MInputContextPlugin::create(const QString &key)
41
 
{
42
 
    QInputContext *ctx = NULL;
43
 
 
44
 
    if (key == MaliitInputContextName) {
45
 
        ctx = new MInputContext(Maliit::createServerConnection(MaliitInputContextName), MaliitInputContextName, this);
46
 
    } else {
47
 
        qCritical() << "Unknown plugin name" << key;
48
 
    }
49
 
 
50
 
    return ctx;
51
 
}
52
 
 
53
 
 
54
 
QString MInputContextPlugin::description(const QString &s)
55
 
{
56
 
    Q_UNUSED(s);
57
 
 
58
 
    return "Maliit input context plugin";
59
 
}
60
 
 
61
 
 
62
 
QString MInputContextPlugin::displayName(const QString &s)
63
 
{
64
 
    Q_UNUSED(s);
65
 
 
66
 
    // TODO: want this translated?
67
 
    return "Input context for Maliit input methods";
68
 
}
69
 
 
70
 
 
71
 
QStringList MInputContextPlugin::keys() const
72
 
{
73
 
    return QStringList(MaliitInputContextName);
74
 
}
75
 
 
76
 
 
77
 
QStringList MInputContextPlugin::languages(const QString &)
78
 
{
79
 
    return QStringList("EN"); // FIXME
80
 
}
81
 
 
82
 
 
83
 
Q_EXPORT_PLUGIN2(minputcontext, MInputContextPlugin)
84