QInputContextPlugin Class

The QInputContextPlugin class provides an abstract base for custom QInputContext 插件。 更多...

頭: #include <QInputContextPlugin>
繼承: QObject

注意: 此類的所有函數 可重入 .

公共函數

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 語言 (const QString & key ) = 0

額外繼承成員

詳細描述

The QInputContextPlugin class provides an abstract base for custom QInputContext 插件。

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.

To create an input context plugin you subclass this base class, reimplement the pure virtual functions keys (), create (), 語言 (), displayName (),和 description (), and export the class with the Q_EXPORT_PLUGIN2 () 宏。

Copyright (C) 2003-2004 immodule for Qt Project. All rights reserved.

This file is written to contribute to Nokia Corporation and/or its subsidiary(-ies) under their own license. You may use this file under your Qt license. Following description is copied from their original file headers. Contact immodule-qt@freedesktop.org if any conditions of this licensing are not clear to you.

另請參閱 QInputContext and 如何創建 Qt 插件 .

成員函數文檔編製

QInputContextPlugin:: QInputContextPlugin ( QObject * parent = 0)

Constructs a input context plugin with the given parent . This is invoked automatically by the Q_EXPORT_PLUGIN2 () 宏。

QInputContextPlugin:: ~QInputContextPlugin ()

Destroys the input context plugin.

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

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

創建並返迴 QInputContext object for the input context key key . The input context key is usually the class name of the required input method.

另請參閱 keys ().

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

Returns an internationalized brief description of the QInputContext object specified by key . You can, for example, use this description in a user interface.

另請參閱 keys () 和 displayName ().

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

Returns a user friendly internationalized name of the QInputContext object specified by key . You can, for example, use this name in a menu.

另請參閱 keys () 和 QInputContext::identifierName ().

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

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. The names are used, for example, to identify and specify input methods for the input method switching mechanism. They have to be consistent with QInputContext::identifierName (), and may only contain ASCII characters.

另請參閱 create (), displayName (),和 QInputContext::identifierName ().

[pure virtual] QStringList QInputContextPlugin:: 語言 (const QString & key )

Returns the languages supported by the QInputContext object specified by key .

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

This information may be used to optimize user interface.

另請參閱 keys (), QInputContext::language (),和 QLocale .