~maliit-team/maliit-plugin-jp/trunk

« back to all changes in this revision

Viewing changes to src/maliit/plugin.cpp

  • Committer: liang
  • Date: 2011-07-20 17:19:53 UTC
  • Revision ID: git-v1:c3d107a6b280a8d2c071bb1df794c7b0a4d4c703
package done

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "plugin.h"
 
2
#include "inputmethod.h"
 
3
 
 
4
namespace plugin {
 
5
 
 
6
class PluginPrivate {
 
7
public :
 
8
    QString name ;
 
9
    QStringList languages ;
 
10
    QSet<MInputMethod::HandlerState> supportedStates ;
 
11
    PluginPrivate() {
 
12
        this->name = "cuteinputmethod" ;
 
13
        this->languages << "en" << "zh" << "en_GB" << "en_US" << "zh_CN" ;
 
14
        this->supportedStates << MInputMethod::Hardware ;
 
15
        this->supportedStates << MInputMethod::OnScreen ;
 
16
    }
 
17
} ;
 
18
 
 
19
Plugin::Plugin() : d_ptr( new PluginPrivate ) {
 
20
    //qmlRegisterUncreatableType<inputmethod::InputMethod> ( "me.meego.inputmethod", 1, 0, "InputMethod", "There's only one controller and it is in the C++ side" ) ;
 
21
}
 
22
 
 
23
Plugin::~Plugin() { delete this->d_ptr ; }
 
24
 
 
25
QString Plugin::name() const {
 
26
    Q_D( const Plugin ) ;
 
27
    return d->name ;
 
28
}
 
29
 
 
30
QStringList Plugin::languages() const {
 
31
    Q_D( const Plugin ) ;
 
32
    return d->languages ;
 
33
}
 
34
 
 
35
MAbstractInputMethod* Plugin::createInputMethod( MAbstractInputMethodHost *host, QWidget *mainWindow ) {
 
36
    return new inputmethod::InputMethod( host, mainWindow ) ;
 
37
}
 
38
 
 
39
MAbstractInputMethodSettings* Plugin::createInputMethodSettings() {
 
40
    return NULL ;
 
41
}
 
42
 
 
43
QSet<MInputMethod::HandlerState> Plugin::supportedStates() const {
 
44
    Q_D( const Plugin ) ;
 
45
    return d->supportedStates ;
 
46
}
 
47
 
 
48
}
 
49
 
 
50
Q_EXPORT_PLUGIN2( inputmethod, plugin::Plugin )