~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/gui/inputmethod/qinputcontextplugin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
**
 
5
** This file is part of the input methods of the Qt Toolkit.
 
6
**
 
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.
 
10
**
 
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.
 
15
**
 
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.
 
20
**
 
21
** Contact info@trolltech.com if any conditions of this licensing are
 
22
** not clear to you.
 
23
**
 
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.
 
26
**
 
27
****************************************************************************/
 
28
 
 
29
/****************************************************************************
 
30
**
 
31
** Implementation of QInputContext class
 
32
**
 
33
** Copyright (C) 2003-2004 immodule for Qt Project.  All rights reserved.
 
34
**
 
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
 
39
** not clear to you.
 
40
**
 
41
****************************************************************************/
 
42
 
 
43
#include "qinputcontextplugin.h"
 
44
 
 
45
#ifndef QT_NO_IM
 
46
#ifndef QT_NO_COMPONENT
 
47
 
 
48
/*!
 
49
    \class QInputContextPlugin
 
50
    \brief The QInputContextPlugin class provides an abstract base for custom QInputContext plugins.
 
51
    \reentrant
 
52
    \ingroup plugins
 
53
 
 
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
 
56
    into applications.
 
57
 
 
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.
 
62
 
 
63
    \sa QInputContext, {How to Create Qt Plugins}
 
64
*/
 
65
 
 
66
/*!
 
67
    \fn QStringList QInputContextPlugin::keys() const
 
68
 
 
69
    Returns the list of QInputContext keys this plugin provides.
 
70
 
 
71
    These keys are usually the class names of the custom input context
 
72
    that are implemented in the plugin.
 
73
 
 
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.
 
79
 
 
80
    \sa create(), displayName(), QInputContext::identifierName()
 
81
*/
 
82
 
 
83
/*!
 
84
    \fn QInputContext* QInputContextPlugin::create( const QString& key )
 
85
 
 
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.
 
88
 
 
89
    \sa keys()
 
90
*/
 
91
 
 
92
/*!
 
93
    \fn QStringList QInputContextPlugin::languages(const QString &key)
 
94
 
 
95
    Returns what languages are supported by the QInputContext instance
 
96
    specified by \a key.
 
97
 
 
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().
 
103
 
 
104
    This information may be used to optimize user interface.
 
105
 
 
106
    \sa QInputContext::language()
 
107
*/
 
108
 
 
109
/*!
 
110
    \fn QString QInputContextPlugin::displayName(const QString &key)
 
111
 
 
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.
 
115
 
 
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.
 
120
 
 
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.
 
127
 
 
128
    \sa keys(), QInputContext::identifierName()
 
129
*/
 
130
 
 
131
/*!
 
132
    \fn QString QInputContextPlugin::description(const QString &key)
 
133
 
 
134
    Returns a i18n-ized brief description of the QInputContext
 
135
    instance specified by \a key. This string may be appeared in some
 
136
    user interfaces.
 
137
*/
 
138
 
 
139
 
 
140
/*!
 
141
    Constructs a input context plugin with the given \a parent. This
 
142
    is invoked automatically by the Q_EXPORT_PLUGIN() macro.
 
143
*/
 
144
QInputContextPlugin::QInputContextPlugin(QObject *parent)
 
145
    :QObject(parent)
 
146
{
 
147
}
 
148
 
 
149
/*!
 
150
    Destroys the input context plugin.
 
151
 
 
152
    You never have to call this explicitly. Qt destroys a plugin
 
153
    automatically when it is no longer used.
 
154
*/
 
155
QInputContextPlugin::~QInputContextPlugin()
 
156
{
 
157
}
 
158
 
 
159
#endif // QT_NO_COMPONENT
 
160
#endif // QT_NO_IM