1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the input methods of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
29
/****************************************************************************
31
** Implementation of QInputContext class
33
** Copyright (C) 2003-2004 immodule for Qt Project. All rights reserved.
35
** This file is written to contribute to Trolltech AS under their own
36
** licence. You may use this file under your Qt license. Following
37
** description is copied from their original file headers. Contact
38
** immodule-qt@freedesktop.org if any conditions of this licensing are
41
****************************************************************************/
43
#include "qinputcontextplugin.h"
46
#ifndef QT_NO_COMPONENT
49
\class QInputContextPlugin
50
\brief The QInputContextPlugin class provides an abstract base for custom QInputContext plugins.
54
The input context plugin is a simple plugin interface that makes it
55
easy to create custom input contexts that can be loaded dynamically
58
Writing a input context plugin is achieved by subclassing this
59
base class, reimplementing the pure virtual functions keys(),
60
create(), languages(), displayName(), and description(), and
61
exporting the class with the Q_EXPORT_PLUGIN() macro.
63
\sa QInputContext, {How to Create Qt Plugins}
67
\fn QStringList QInputContextPlugin::keys() const
69
Returns the list of QInputContext keys this plugin provides.
71
These keys are usually the class names of the custom input context
72
that are implemented in the plugin.
74
Return value is the names to identify and specify input methods
75
for the input method switching mechanism and so on. The names have
76
to be consistent with QInputContext::identifierName(). The names
77
have to consist of ASCII characters only. See also
78
QInputContext::identifierName() for further information.
80
\sa create(), displayName(), QInputContext::identifierName()
84
\fn QInputContext* QInputContextPlugin::create( const QString& key )
86
Creates and returns a QInputContext instance for the input context key \a key.
87
The input context key is usually the class name of the required input method.
93
\fn QStringList QInputContextPlugin::languages(const QString &key)
95
Returns what languages are supported by the QInputContext instance
98
The languages are expressed as language code (e.g. "zh_CN",
99
"zh_TW", "zh_HK", "ja", "ko", ...). An input context that suports
100
multiple languages can return all supported languages as
101
QStringList. The name has to be consistent with
102
QInputContextPlugin::language().
104
This information may be used to optimize user interface.
106
\sa QInputContext::language()
110
\fn QString QInputContextPlugin::displayName(const QString &key)
112
Returns a user friendly i18n-ized name of the QInputContext
113
instance specified by \a key. This string may be appeared in a
114
menu and so on for users.
116
There are two different names with different responsibility in the
117
input method domain. This function returns one of them. Another
118
name is called 'identifier name' to identify and specify input
119
methods for the input method switching mechanism and so on.
121
Although tr( identifierName ) can provide user friendly i18n-ized
122
name without this function, the message catalog have to be managed
123
by Qt in the case. However, some sophisticated input method
124
framework manages their own message catalogs to provide this
125
i18n-ized name string. So we need this function rather than just
126
call tr() for identifier name.
128
\sa keys(), QInputContext::identifierName()
132
\fn QString QInputContextPlugin::description(const QString &key)
134
Returns a i18n-ized brief description of the QInputContext
135
instance specified by \a key. This string may be appeared in some
141
Constructs a input context plugin with the given \a parent. This
142
is invoked automatically by the Q_EXPORT_PLUGIN() macro.
144
QInputContextPlugin::QInputContextPlugin(QObject *parent)
150
Destroys the input context plugin.
152
You never have to call this explicitly. Qt destroys a plugin
153
automatically when it is no longer used.
155
QInputContextPlugin::~QInputContextPlugin()
159
#endif // QT_NO_COMPONENT