~michael-sheldon/ubuntu/utopic/maliit-framework/fix-orientation-updates

« back to all changes in this revision

Viewing changes to maliit-plugins-quick/plugin-factory/maliitquickpluginfactory.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) 2011 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 "maliitquickpluginfactory.h"
16
 
#include "minputmethodquickplugin.h"
17
 
 
18
 
class MyPlugin
19
 
    : public MInputMethodQuickPlugin
20
 
{
21
 
    Q_DISABLE_COPY(MyPlugin)
22
 
 
23
 
private:
24
 
    const QString m_filename;
25
 
 
26
 
public:
27
 
    explicit MyPlugin(const QString &filename)
28
 
        : MInputMethodQuickPlugin()
29
 
        , m_filename(filename)
30
 
    {}
31
 
 
32
 
    virtual QString qmlFileName() const
33
 
    {
34
 
        return m_filename;
35
 
    }
36
 
 
37
 
    virtual QString name() const
38
 
    {
39
 
        static QFileInfo info(m_filename);
40
 
        return info.baseName();
41
 
    }
42
 
};
43
 
 
44
 
MaliitQuickPluginFactory::MaliitQuickPluginFactory(QObject *parent)
45
 
    : QObject(parent)
46
 
    , MImAbstractPluginFactory()
47
 
{}
48
 
 
49
 
MaliitQuickPluginFactory::~MaliitQuickPluginFactory()
50
 
{}
51
 
 
52
 
QString MaliitQuickPluginFactory::fileExtension() const
53
 
{
54
 
    return "qml";
55
 
}
56
 
 
57
 
Maliit::Plugins::InputMethodPlugin * MaliitQuickPluginFactory::create(const QString &file) const
58
 
{
59
 
    return new MyPlugin(file);
60
 
}
61
 
 
62
 
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
63
 
Q_EXPORT_PLUGIN2(MaliitQuickPluginFactory, MaliitQuickPluginFactory)
64
 
#endif