Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QInputContextPlugin Class Reference

The QInputContextPlugin class provides an abstract base for custom QInputContext plugins. More...

    #include <QInputContextPlugin>

Inherits QObject.

Note: All the functions in this class are reentrant.

- List of all members, including inherited members

### Writable Properties

- 1 writable property inherited from QObject

### Public Functions

- QInputContextPlugin ( QObject * parent = 0 )
- ~QInputContextPlugin ()
- virtual QInputContext * create ( const QString & key ) = 0
- virtual QString description ( const QString & key ) = 0
- virtual QString displayName ( const QString & key ) = 0
- virtual QStringList keys () const = 0
- virtual QStringList languages ( const QString & key ) = 0

- 26 public functions inherited from QObject

### Public Slots

- 1 public slot inherited from QObject

### Signals

- 1 signal inherited from QObject

### Static Public Members

- 4 static public members inherited from QObject

### Protected Functions

- 7 protected functions inherited from QObject

## Detailed Description

The QInputContextPlugin class provides an abstract base for custom QInputContext plugins.

The input context plugin is a simple plugin interface that makes it easy to create custom input contexts that can be loaded dynamically into applications.

Writing a input context plugin is achieved by subclassing this base class, reimplementing the pure virtual functions keys(), create(), languages(), displayName() description() and exporting the class with the `Q_EXPORT_PLUGIN` macro. See the Qt Plugins documentation for details.

See also QInputContext.

## Member Function Documentation

### QInputContextPlugin::QInputContextPlugin ( QObject * parent = 0 )

Constructs a input context plugin. This is invoked automatically by the `Q_EXPORT_PLUGIN` macro.

### QInputContextPlugin::~QInputContextPlugin ()

Destroys the input context plugin.

You never have to call this explicitly. Qt destroys a plugin automatically when it is no longer used.

### QInputContext * QInputContextPlugin::create ( const QString & key ) `[pure virtual]`

Creates and returns a QInputContext instance for the input context key key. The input context key is usually the class name of the required input method.

Reimplemented from QInputContextFactoryInterface.

See also keys().

### QString QInputContextPlugin::description ( const QString & key ) `[pure virtual]`

Returns a i18n-ized brief description of the QInputContext instance specified by key. This string may be appeared in some user interfaces.

Reimplemented from QInputContextFactoryInterface.

### QString QInputContextPlugin::displayName ( const QString & key ) `[pure virtual]`

Returns a user friendly i18n-ized name of the QInputContext instance specified by key. This string may be appeared in a menu and so on for users.

There are two different names with different responsibility in the input method domain. This function returns one of them. Another name is called 'identifier name' to identify and specify input methods for the input method switching mechanism and so on.

Although tr( identifierName ) can provide user friendly i18n-ized name without this function, the message catalog have to be managed by Qt in the case. However, some sophisticated input method framework manages their own message catalogs to provide this i18n-ized name string. So we need this function rather than just call tr() for identifier name.

Reimplemented from QInputContextFactoryInterface.

See also keys() and QInputContext::identifierName().

### QStringList QInputContextPlugin::keys () const `[pure virtual]`

Returns the list of QInputContext keys this plugin provides.

These keys are usually the class names of the custom input context that are implemented in the plugin.

Return value is the names to identify and specify input methods for the input method switching mechanism and so on. The names have to be consistent with QInputContext::identifierName(). The names have to consist of ASCII characters only. See also QInputContext::identifierName() for further information.

Reimplemented from QFactoryInterface.

See also create(), displayName(), and QInputContext::identifierName().

### QStringList QInputContextPlugin::languages ( const QString & key ) `[pure virtual]`

Returns what languages are supported by the QInputContext instance specified by key.

The languages are expressed as language code (e.g. "zh_CN", "zh_TW", "zh_HK", "ja", "ko", ...). An input context that suports multiple languages can return all supported languages as QStringList. The name has to be consistent with QInputContextPlugin::language().

This information may be used to optimize user interface.

Reimplemented from QInputContextFactoryInterface.

See also QInputContext::language().