0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the QtGui module of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
15 |
**
|
|
16 |
** GNU Lesser General Public License Usage
|
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
18 |
** General Public License version 2.1 as published by the Free Software
|
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
20 |
** packaging of this file. Please review the following information to
|
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
23 |
**
|
|
24 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
27 |
**
|
|
28 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
** $QT_END_LICENSE$
|
|
39 |
**
|
|
40 |
****************************************************************************/
|
|
41 |
|
|
42 |
/****************************************************************************
|
|
43 |
**
|
|
44 |
** Implementation of QInputContext class
|
|
45 |
**
|
|
46 |
** Copyright (C) 2003-2004 immodule for Qt Project. All rights reserved.
|
|
47 |
**
|
|
48 |
** This file is written to contribute to Nokia Corporation and/or its subsidiary(-ies) under their own
|
|
49 |
** license. You may use this file under your Qt license. Following
|
|
50 |
** description is copied from their original file headers. Contact
|
|
51 |
** immodule-qt@freedesktop.org if any conditions of this licensing are
|
|
52 |
** not clear to you.
|
|
53 |
**
|
|
54 |
****************************************************************************/
|
|
55 |
|
|
56 |
#include "qinputcontextplugin.h"
|
|
57 |
|
|
58 |
#ifndef QT_NO_IM
|
|
59 |
#ifndef QT_NO_LIBRARY
|
|
60 |
|
|
61 |
QT_BEGIN_NAMESPACE
|
|
62 |
|
|
63 |
/*!
|
|
64 |
\class QInputContextPlugin
|
|
65 |
\brief The QInputContextPlugin class provides an abstract base for custom QInputContext plugins.
|
|
66 |
|
|
67 |
\reentrant
|
|
68 |
\ingroup plugins
|
|
69 |
|
|
70 |
The input context plugin is a simple plugin interface that makes it
|
|
71 |
easy to create custom input contexts that can be loaded dynamically
|
|
72 |
into applications.
|
|
73 |
|
|
74 |
To create an input context plugin you subclass this base class,
|
|
75 |
reimplement the pure virtual functions keys(), create(),
|
|
76 |
languages(), displayName(), and description(), and export the
|
|
77 |
class with the Q_EXPORT_PLUGIN2() macro.
|
|
78 |
|
|
79 |
\legalese
|
|
80 |
Copyright (C) 2003-2004 immodule for Qt Project. All rights reserved.
|
|
81 |
|
|
82 |
This file is written to contribute to Nokia Corporation and/or its subsidiary(-ies) under their own
|
|
83 |
license. You may use this file under your Qt license. Following
|
|
84 |
description is copied from their original file headers. Contact
|
|
85 |
immodule-qt@freedesktop.org if any conditions of this licensing are
|
|
86 |
not clear to you.
|
|
87 |
\endlegalese
|
|
88 |
|
|
89 |
\sa QInputContext, {How to Create Qt Plugins}
|
|
90 |
*/
|
|
91 |
|
|
92 |
/*!
|
|
93 |
\fn QStringList QInputContextPlugin::keys() const
|
|
94 |
|
|
95 |
Returns the list of QInputContext keys this plugin provides.
|
|
96 |
|
|
97 |
These keys are usually the class names of the custom input context
|
|
98 |
that are implemented in the plugin. The names are used, for
|
|
99 |
example, to identify and specify input methods for the input
|
|
100 |
method switching mechanism. They have to be consistent with
|
|
101 |
QInputContext::identifierName(), and may only contain ASCII
|
|
102 |
characters.
|
|
103 |
|
|
104 |
\sa create(), displayName(), QInputContext::identifierName()
|
|
105 |
*/
|
|
106 |
|
|
107 |
/*!
|
|
108 |
\fn QInputContext* QInputContextPlugin::create( const QString& key )
|
|
109 |
|
|
110 |
Creates and returns a QInputContext object for the input context
|
|
111 |
key \a key. The input context key is usually the class name of
|
|
112 |
the required input method.
|
|
113 |
|
|
114 |
\sa keys()
|
|
115 |
*/
|
|
116 |
|
|
117 |
/*!
|
|
118 |
\fn QStringList QInputContextPlugin::languages(const QString &key)
|
|
119 |
|
|
120 |
Returns the languages supported by the QInputContext object
|
|
121 |
specified by \a key.
|
|
122 |
|
|
123 |
The languages are expressed as language code (e.g. "zh_CN",
|
|
124 |
"zh_TW", "zh_HK", "ja", "ko", ...). An input context that supports
|
|
125 |
multiple languages can return all supported languages as
|
|
126 |
QStringList. The name has to be consistent with
|
|
127 |
QInputContext::language().
|
|
128 |
|
|
129 |
This information may be used to optimize user interface.
|
|
130 |
|
|
131 |
\sa keys(), QInputContext::language(), QLocale
|
|
132 |
*/
|
|
133 |
|
|
134 |
/*!
|
|
135 |
\fn QString QInputContextPlugin::displayName(const QString &key)
|
|
136 |
|
|
137 |
Returns a user friendly internationalized name of the
|
|
138 |
QInputContext object specified by \a key. You can, for example,
|
|
139 |
use this name in a menu.
|
|
140 |
|
|
141 |
\sa keys(), QInputContext::identifierName()
|
|
142 |
*/
|
|
143 |
|
|
144 |
/*!
|
|
145 |
\fn QString QInputContextPlugin::description(const QString &key)
|
|
146 |
|
|
147 |
Returns an internationalized brief description of the QInputContext
|
|
148 |
object specified by \a key. You can, for example, use this
|
|
149 |
description in a user interface.
|
|
150 |
|
|
151 |
\sa keys(), displayName()
|
|
152 |
*/
|
|
153 |
|
|
154 |
|
|
155 |
/*!
|
|
156 |
Constructs a input context plugin with the given \a parent. This
|
|
157 |
is invoked automatically by the Q_EXPORT_PLUGIN2() macro.
|
|
158 |
*/
|
|
159 |
QInputContextPlugin::QInputContextPlugin(QObject *parent)
|
|
160 |
:QObject(parent)
|
|
161 |
{
|
|
162 |
}
|
|
163 |
|
|
164 |
/*!
|
|
165 |
Destroys the input context plugin.
|
|
166 |
|
|
167 |
You never have to call this explicitly. Qt destroys a plugin
|
|
168 |
automatically when it's no longer used.
|
|
169 |
*/
|
|
170 |
QInputContextPlugin::~QInputContextPlugin()
|
|
171 |
{
|
|
172 |
}
|
|
173 |
|
|
174 |
QT_END_NAMESPACE
|
|
175 |
|
|
176 |
#endif // QT_NO_LIBRARY
|
|
177 |
|
|
178 |
#endif // QT_NO_IM
|