diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-06-21 16:00:36 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-06-22 10:46:12 +0200 |
commit | 4363d836f6a2b245e8e12d1e5eb08db791e95fce (patch) | |
tree | 6b14e2e3b03d42ecd7dad378ba87d85276f19c90 /src/widgets | |
parent | e1293b49e3adbcff8eade91dc64901d40aeb5099 (diff) |
remove the plugin support for QInputContext
This will be handled through the lighthouse plugin
instead.
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/inputmethod/inputmethod.pri | 26 | ||||
-rw-r--r-- | src/widgets/inputmethod/qinputcontextfactory.cpp | 354 | ||||
-rw-r--r-- | src/widgets/inputmethod/qinputcontextfactory.h | 88 | ||||
-rw-r--r-- | src/widgets/inputmethod/qinputcontextplugin.cpp | 178 | ||||
-rw-r--r-- | src/widgets/inputmethod/qinputcontextplugin.h | 106 | ||||
-rw-r--r-- | src/widgets/kernel/kernel.pri | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 33 | ||||
-rw-r--r-- | src/widgets/kernel/qinputcontext.cpp (renamed from src/widgets/inputmethod/qinputcontext.cpp) | 0 | ||||
-rw-r--r-- | src/widgets/kernel/qinputcontext.h (renamed from src/widgets/inputmethod/qinputcontext.h) | 0 | ||||
-rw-r--r-- | src/widgets/platforms/mac/qmacinputcontext_mac.cpp (renamed from src/widgets/inputmethod/qmacinputcontext_mac.cpp) | 0 | ||||
-rw-r--r-- | src/widgets/platforms/mac/qmacinputcontext_p.h (renamed from src/widgets/inputmethod/qmacinputcontext_p.h) | 0 | ||||
-rw-r--r-- | src/widgets/platforms/s60/qcoefepinputcontext_p.h (renamed from src/widgets/inputmethod/qcoefepinputcontext_p.h) | 0 | ||||
-rw-r--r-- | src/widgets/platforms/s60/qcoefepinputcontext_s60.cpp (renamed from src/widgets/inputmethod/qcoefepinputcontext_s60.cpp) | 0 | ||||
-rw-r--r-- | src/widgets/platforms/win/qwininputcontext_p.h (renamed from src/widgets/inputmethod/qwininputcontext_p.h) | 0 | ||||
-rw-r--r-- | src/widgets/platforms/win/qwininputcontext_win.cpp (renamed from src/widgets/inputmethod/qwininputcontext_win.cpp) | 0 | ||||
-rw-r--r-- | src/widgets/platforms/x11/qximinputcontext_p.h (renamed from src/widgets/inputmethod/qximinputcontext_p.h) | 0 | ||||
-rw-r--r-- | src/widgets/platforms/x11/qximinputcontext_x11.cpp (renamed from src/widgets/inputmethod/qximinputcontext_x11.cpp) | 0 | ||||
-rw-r--r-- | src/widgets/widgets.pro | 1 |
18 files changed, 3 insertions, 785 deletions
diff --git a/src/widgets/inputmethod/inputmethod.pri b/src/widgets/inputmethod/inputmethod.pri deleted file mode 100644 index a3f2f1a8dc..0000000000 --- a/src/widgets/inputmethod/inputmethod.pri +++ /dev/null @@ -1,26 +0,0 @@ -# Qt inputmethod module - -HEADERS +=inputmethod/qinputcontextfactory.h \ - inputmethod/qinputcontextplugin.h \ - inputmethod/qinputcontext.h -SOURCES +=inputmethod/qinputcontextfactory.cpp \ - inputmethod/qinputcontextplugin.cpp \ - inputmethod/qinputcontext.cpp -x11 { - HEADERS += inputmethod/qximinputcontext_p.h - SOURCES += inputmethod/qximinputcontext_x11.cpp -} -win32:!qpa { - HEADERS += inputmethod/qwininputcontext_p.h - SOURCES += inputmethod/qwininputcontext_win.cpp -} -mac:!qpa { - HEADERS += inputmethod/qmacinputcontext_p.h - SOURCES += inputmethod/qmacinputcontext_mac.cpp -} -symbian:contains(QT_CONFIG, s60) { - HEADERS += inputmethod/qcoefepinputcontext_p.h - SOURCES += inputmethod/qcoefepinputcontext_s60.cpp - LIBS += -lfepbase -lakninputlanguage -} - diff --git a/src/widgets/inputmethod/qinputcontextfactory.cpp b/src/widgets/inputmethod/qinputcontextfactory.cpp deleted file mode 100644 index d85b655650..0000000000 --- a/src/widgets/inputmethod/qinputcontextfactory.cpp +++ /dev/null @@ -1,354 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/**************************************************************************** -** -** Implementation of QInputContextFactory class -** -** 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. -** -****************************************************************************/ - -#include "qinputcontextfactory.h" - -#ifndef QT_NO_IM - -#include "qcoreapplication.h" -#include "qinputcontext.h" -#include "qinputcontextplugin.h" - -#ifdef Q_WS_X11 -#include "private/qt_x11_p.h" -#include "qximinputcontext_p.h" -#endif -#ifdef Q_WS_WIN -#include "qwininputcontext_p.h" -#endif -#ifdef Q_WS_MAC -#include "qmacinputcontext_p.h" -#endif -#ifdef Q_WS_S60 -#include "qcoefepinputcontext_p.h" -#include "AknInputLanguageInfo.h" -#endif - -#include "private/qfactoryloader_p.h" -#include "qmutex.h" - -QT_BEGIN_NAMESPACE - -#ifndef QT_NO_LIBRARY -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, - (QInputContextFactoryInterface_iid, QLatin1String("/inputmethods"))) -#endif - -/*! - \class QInputContextFactory - \brief The QInputContextFactory class creates QInputContext objects. - - - The input context factory creates a QInputContext object for a - given key with QInputContextFactory::create(). - - The input contexts are either built-in or dynamically loaded from - an input context plugin (see QInputContextPlugin). - - keys() returns a list of valid keys. The - keys are the names used, for example, to identify and specify - input methods for the input method switching mechanism. The names - have to be consistent with QInputContext::identifierName(), and - may only contain ASCII characters. - - A key can be used to retrieve the associated input context's - supported languages using languages(). You - can retrieve the input context's description using - description() and finally you can get a user - friendly internationalized name of the QInputContext object - specified by the key using displayName(). - - \legalese - 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. - \endlegalese - - \sa QInputContext, QInputContextPlugin -*/ - -/*! - Creates and returns a QInputContext object for the input context - specified by \a key with the given \a parent. Keys are case - sensitive. - - \sa keys() -*/ -QInputContext *QInputContextFactory::create( const QString& key, QObject *parent ) -{ - QInputContext *result = 0; -#if defined(Q_WS_X11) && !defined(QT_NO_XIM) - if (key == QLatin1String("xim")) { - result = new QXIMInputContext; - } -#endif -#if defined(Q_WS_WIN) - if (key == QLatin1String("win")) { - result = new QWinInputContext; - } -#endif -#if defined(Q_WS_MAC) - if (key == QLatin1String("mac")) { - result = new QMacInputContext; - } -#endif -#if defined(Q_WS_S60) - if (key == QLatin1String("coefep")) { - result = new QCoeFepInputContext; - } -#endif -#ifdef QT_NO_LIBRARY - Q_UNUSED(key); -#else - if (QInputContextFactoryInterface *factory = - qobject_cast<QInputContextFactoryInterface*>(loader()->instance(key))) { - result = factory->create(key); - } -#endif - if (result) - result->setParent(parent); - return result; -} - - -/*! - Returns the list of keys this factory can create input contexts - for. - - The keys are the names used, for example, to identify and specify - input methods for the input method switching mechanism. The names - have to be consistent with QInputContext::identifierName(), and - may only contain ASCII characters. - - \sa create(), displayName(), QInputContext::identifierName() -*/ -QStringList QInputContextFactory::keys() -{ - QStringList result; -#if defined(Q_WS_X11) && !defined(QT_NO_XIM) - result << QLatin1String("xim"); -#endif -#if defined(Q_WS_WIN) && !defined(QT_NO_XIM) - result << QLatin1String("win"); -#endif -#if defined(Q_WS_MAC) - result << QLatin1String("mac"); -#endif -#if defined(Q_WS_S60) - result << QLatin1String("coefep"); -#endif -#ifndef QT_NO_LIBRARY - result += loader()->keys(); -#endif // QT_NO_LIBRARY - return result; -} - -#if defined(Q_WS_S60) -/*! - \internal - - This function contains pure Symbian exception handling code for - getting S60 language list. - Returned object ownership is transferred to caller. -*/ -static CAknInputLanguageList* s60LangListL() -{ - CAknInputLanguageInfo *langInfo = AknInputLanguageInfoFactory::CreateInputLanguageInfoL(); - CleanupStack::PushL(langInfo); - // In rare phone there is more than 7 languages installed -> use 7 as an array granularity - CAknInputLanguageList *langList = new (ELeave) CAknInputLanguageList(7); - CleanupStack::PushL(langList); - langInfo->AppendAvailableLanguagesL(langList); - CleanupStack::Pop(langList); - CleanupStack::PopAndDestroy(langInfo); - return langList; -} - -/*! - \internal - - This function utility function return S60 language list. - Returned object ownership is transferred to caller. -*/ -static CAknInputLanguageList* s60LangList() -{ - CAknInputLanguageList *langList = NULL; - TRAP_IGNORE(langList = s60LangListL()); - q_check_ptr(langList); - return langList; -} -#endif - -/*! - Returns the languages supported by the QInputContext object - specified by \a 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 a - QStringList. The name has to be consistent with - QInputContext::language(). - - This information may be used to optimize a user interface. - - \sa keys(), QInputContext::language(), QLocale -*/ -QStringList QInputContextFactory::languages( const QString &key ) -{ - QStringList result; -#if defined(Q_WS_X11) && !defined(QT_NO_XIM) - if (key == QLatin1String("xim")) - return QStringList(QString()); -#endif -#if defined(Q_WS_WIN) - if (key == QLatin1String("win")) - return QStringList(QString()); -#endif -#if defined(Q_WS_MAC) - if (key == QLatin1String("mac")) - return QStringList(QString()); -#endif -#if defined(Q_WS_S60) - if (key == QLatin1String("coefep")) - { - CAknInputLanguageList *langList = s60LangList(); - int count = langList->Count(); - for (int i = 0; i < count; ++i) - { - result.append(QString(qt_symbianLocaleName(langList->At(i)->LanguageCode()))); - } - delete langList; - } -#endif -#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS) - Q_UNUSED(key); -#else - if (QInputContextFactoryInterface *factory = - qobject_cast<QInputContextFactoryInterface*>(loader()->instance(key))) - result = factory->languages(key); -#endif // QT_NO_LIBRARY - return result; -} - -/*! - Returns a user friendly internationalized name of the - QInputContext object specified by \a key. You can, for example, - use this name in a menu. - - \sa keys(), QInputContext::identifierName() -*/ -QString QInputContextFactory::displayName( const QString &key ) -{ - QString result; -#if defined(Q_WS_X11) && !defined(QT_NO_XIM) - if (key == QLatin1String("xim")) - return QInputContext::tr( "XIM" ); -#endif -#ifdef Q_WS_S60 - if (key == QLatin1String("coefep")) - return QInputContext::tr( "FEP" ); -#endif -#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS) - Q_UNUSED(key); -#else - if (QInputContextFactoryInterface *factory = - qobject_cast<QInputContextFactoryInterface*>(loader()->instance(key))) - return factory->displayName(key); -#endif // QT_NO_LIBRARY - return QString(); -} - -/*! - Returns an internationalized brief description of the QInputContext - object specified by \a key. You can, for example, use this - description in a user interface. - - \sa keys(), displayName() -*/ -QString QInputContextFactory::description( const QString &key ) -{ -#if defined(Q_WS_X11) && !defined(QT_NO_XIM) - if (key == QLatin1String("xim")) - return QInputContext::tr( "XIM input method" ); -#endif -#if defined(Q_WS_WIN) && !defined(QT_NO_XIM) - if (key == QLatin1String("win")) - return QInputContext::tr( "Windows input method" ); -#endif -#if defined(Q_WS_MAC) - if (key == QLatin1String("mac")) - return QInputContext::tr( "Mac OS X input method" ); -#endif -#if defined(Q_WS_S60) - if (key == QLatin1String("coefep")) - return QInputContext::tr( "S60 FEP input method" ); -#endif -#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS) - Q_UNUSED(key); -#else - if (QInputContextFactoryInterface *factory = - qobject_cast<QInputContextFactoryInterface*>(loader()->instance(key))) - return factory->description(key); -#endif // QT_NO_LIBRARY - return QString(); -} - -QT_END_NAMESPACE - -#endif // QT_NO_IM diff --git a/src/widgets/inputmethod/qinputcontextfactory.h b/src/widgets/inputmethod/qinputcontextfactory.h deleted file mode 100644 index 458ae62aba..0000000000 --- a/src/widgets/inputmethod/qinputcontextfactory.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/**************************************************************************** -** -** Definition of QInputContextFactory class -** -** 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. -** -****************************************************************************/ - -#ifndef QINPUTCONTEXTFACTORY_H -#define QINPUTCONTEXTFACTORY_H - -#include <QtCore/qstringlist.h> - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -#ifndef QT_NO_IM - -class QInputContext; -class QWidget; - -class Q_WIDGETS_EXPORT QInputContextFactory -{ -public: - static QStringList keys(); - static QInputContext *create( const QString &key, QObject *parent ); // should be a toplevel widget - static QStringList languages( const QString &key ); - static QString displayName( const QString &key ); - static QString description( const QString &key ); -}; - -#endif // QT_NO_IM - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QINPUTCONTEXTFACTORY_H diff --git a/src/widgets/inputmethod/qinputcontextplugin.cpp b/src/widgets/inputmethod/qinputcontextplugin.cpp deleted file mode 100644 index 5921b936ab..0000000000 --- a/src/widgets/inputmethod/qinputcontextplugin.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/**************************************************************************** -** -** Implementation of QInputContext class -** -** 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. -** -****************************************************************************/ - -#include "qinputcontextplugin.h" - -#ifndef QT_NO_IM -#ifndef QT_NO_LIBRARY - -QT_BEGIN_NAMESPACE - -/*! - \class QInputContextPlugin - \brief The QInputContextPlugin class provides an abstract base for custom QInputContext plugins. - - \reentrant - \ingroup 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. - - To create an input context plugin you subclass this base class, - reimplement the pure virtual functions keys(), create(), - languages(), displayName(), and description(), and export the - class with the Q_EXPORT_PLUGIN2() macro. - - \legalese - 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. - \endlegalese - - \sa QInputContext, {How to Create Qt Plugins} -*/ - -/*! - \fn 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. - - \sa create(), displayName(), QInputContext::identifierName() -*/ - -/*! - \fn QInputContext* QInputContextPlugin::create( const QString& key ) - - Creates and returns a QInputContext object for the input context - key \a key. The input context key is usually the class name of - the required input method. - - \sa keys() -*/ - -/*! - \fn QStringList QInputContextPlugin::languages(const QString &key) - - Returns the languages supported by the QInputContext object - specified by \a 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. - - \sa keys(), QInputContext::language(), QLocale -*/ - -/*! - \fn QString QInputContextPlugin::displayName(const QString &key) - - Returns a user friendly internationalized name of the - QInputContext object specified by \a key. You can, for example, - use this name in a menu. - - \sa keys(), QInputContext::identifierName() -*/ - -/*! - \fn QString QInputContextPlugin::description(const QString &key) - - Returns an internationalized brief description of the QInputContext - object specified by \a key. You can, for example, use this - description in a user interface. - - \sa keys(), displayName() -*/ - - -/*! - Constructs a input context plugin with the given \a parent. This - is invoked automatically by the Q_EXPORT_PLUGIN2() macro. -*/ -QInputContextPlugin::QInputContextPlugin(QObject *parent) - :QObject(parent) -{ -} - -/*! - Destroys the input context plugin. - - You never have to call this explicitly. Qt destroys a plugin - automatically when it's no longer used. -*/ -QInputContextPlugin::~QInputContextPlugin() -{ -} - -QT_END_NAMESPACE - -#endif // QT_NO_LIBRARY - -#endif // QT_NO_IM diff --git a/src/widgets/inputmethod/qinputcontextplugin.h b/src/widgets/inputmethod/qinputcontextplugin.h deleted file mode 100644 index 7a340a6745..0000000000 --- a/src/widgets/inputmethod/qinputcontextplugin.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/**************************************************************************** -** -** Definition of QInputContextPlugin class -** -** 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. -** -****************************************************************************/ - -#ifndef QINPUTCONTEXTPLUGIN_H -#define QINPUTCONTEXTPLUGIN_H - -#include <QtCore/qplugin.h> -#include <QtCore/qfactoryinterface.h> -#include <QtCore/qstringlist.h> - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -#if !defined(QT_NO_IM) - -class QInputContext; -class QInputContextPluginPrivate; - -struct Q_WIDGETS_EXPORT QInputContextFactoryInterface : public QFactoryInterface -{ - virtual QInputContext *create( const QString &key ) = 0; - virtual QStringList languages( const QString &key ) = 0; - virtual QString displayName( const QString &key ) = 0; - virtual QString description( const QString &key ) = 0; -}; - -#define QInputContextFactoryInterface_iid "com.trolltech.Qt.QInputContextFactoryInterface" -Q_DECLARE_INTERFACE(QInputContextFactoryInterface, QInputContextFactoryInterface_iid) - -class Q_WIDGETS_EXPORT QInputContextPlugin : public QObject, public QInputContextFactoryInterface -{ - Q_OBJECT - Q_INTERFACES(QInputContextFactoryInterface:QFactoryInterface) -public: - explicit QInputContextPlugin(QObject *parent = 0); - ~QInputContextPlugin(); - - virtual QStringList keys() const = 0; - virtual QInputContext *create( const QString &key ) = 0; - virtual QStringList languages( const QString &key ) = 0; - virtual QString displayName( const QString &key ) = 0; - virtual QString description( const QString &key ) = 0; -}; - -#endif // QT_NO_IM - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QINPUTCONTEXTPLUGIN_H diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri index a4754018b2..08ec6ac81a 100644 --- a/src/widgets/kernel/kernel.pri +++ b/src/widgets/kernel/kernel.pri @@ -21,6 +21,7 @@ HEADERS += \ kernel/qiconloader_p.h \ kernel/qiconengine.h \ kernel/qiconengineplugin.h \ + kernel/qinputcontext.h \ kernel/qlayout.h \ kernel/qlayout_p.h \ kernel/qlayoutengine_p.h \ @@ -54,6 +55,7 @@ SOURCES += \ kernel/qiconloader.cpp \ kernel/qiconengine.cpp \ kernel/qiconengineplugin.cpp \ + kernel/qinputcontext.cpp \ kernel/qlayout.cpp \ kernel/qlayoutengine.cpp \ kernel/qlayoutitem.cpp \ diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 7595290d11..517df5252f 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -5222,38 +5222,7 @@ void QApplication::setInputContext(QInputContext *inputContext) */ QInputContext *QApplication::inputContext() const { - Q_D(const QApplication); - Q_UNUSED(d);// only static members being used. - if (QApplicationPrivate::is_app_closing) - return d->inputContext; -#ifdef Q_WS_X11 - if (!X11) - return 0; - if (!d->inputContext) { - QApplication *that = const_cast<QApplication *>(this); - QInputContext *qic = QInputContextFactory::create(X11->default_im, that); - // fallback to default X Input Method. - if (!qic) - qic = QInputContextFactory::create(QLatin1String("xim"), that); - that->d_func()->inputContext = qic; - } -#elif defined(Q_OS_SYMBIAN) - if (!d->inputContext) { - QApplication *that = const_cast<QApplication *>(this); - const QStringList keys = QInputContextFactory::keys(); - // Try hbim and coefep first, then try others. - if (keys.contains(QLatin1String("hbim"))) { - that->d_func()->inputContext = QInputContextFactory::create(QLatin1String("hbim"), that); - } else if (keys.contains(QLatin1String("coefep"))) { - that->d_func()->inputContext = QInputContextFactory::create(QLatin1String("coefep"), that); - } else { - for (int c = 0; c < keys.size() && !d->inputContext; ++c) { - that->d_func()->inputContext = QInputContextFactory::create(keys[c], that); - } - } - } -#endif - return d->inputContext; + return QApplicationPrivate::inputContext; } #endif // QT_NO_IM diff --git a/src/widgets/inputmethod/qinputcontext.cpp b/src/widgets/kernel/qinputcontext.cpp index a3e73eb288..a3e73eb288 100644 --- a/src/widgets/inputmethod/qinputcontext.cpp +++ b/src/widgets/kernel/qinputcontext.cpp diff --git a/src/widgets/inputmethod/qinputcontext.h b/src/widgets/kernel/qinputcontext.h index fba0c7cf2c..fba0c7cf2c 100644 --- a/src/widgets/inputmethod/qinputcontext.h +++ b/src/widgets/kernel/qinputcontext.h diff --git a/src/widgets/inputmethod/qmacinputcontext_mac.cpp b/src/widgets/platforms/mac/qmacinputcontext_mac.cpp index a98cee714b..a98cee714b 100644 --- a/src/widgets/inputmethod/qmacinputcontext_mac.cpp +++ b/src/widgets/platforms/mac/qmacinputcontext_mac.cpp diff --git a/src/widgets/inputmethod/qmacinputcontext_p.h b/src/widgets/platforms/mac/qmacinputcontext_p.h index 4fb3eb57b6..4fb3eb57b6 100644 --- a/src/widgets/inputmethod/qmacinputcontext_p.h +++ b/src/widgets/platforms/mac/qmacinputcontext_p.h diff --git a/src/widgets/inputmethod/qcoefepinputcontext_p.h b/src/widgets/platforms/s60/qcoefepinputcontext_p.h index 148f092ac5..148f092ac5 100644 --- a/src/widgets/inputmethod/qcoefepinputcontext_p.h +++ b/src/widgets/platforms/s60/qcoefepinputcontext_p.h diff --git a/src/widgets/inputmethod/qcoefepinputcontext_s60.cpp b/src/widgets/platforms/s60/qcoefepinputcontext_s60.cpp index 8c215360d8..8c215360d8 100644 --- a/src/widgets/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/widgets/platforms/s60/qcoefepinputcontext_s60.cpp diff --git a/src/widgets/inputmethod/qwininputcontext_p.h b/src/widgets/platforms/win/qwininputcontext_p.h index c0a6ac6b6f..c0a6ac6b6f 100644 --- a/src/widgets/inputmethod/qwininputcontext_p.h +++ b/src/widgets/platforms/win/qwininputcontext_p.h diff --git a/src/widgets/inputmethod/qwininputcontext_win.cpp b/src/widgets/platforms/win/qwininputcontext_win.cpp index 9ec9942af8..9ec9942af8 100644 --- a/src/widgets/inputmethod/qwininputcontext_win.cpp +++ b/src/widgets/platforms/win/qwininputcontext_win.cpp diff --git a/src/widgets/inputmethod/qximinputcontext_p.h b/src/widgets/platforms/x11/qximinputcontext_p.h index 47c6f78ff9..47c6f78ff9 100644 --- a/src/widgets/inputmethod/qximinputcontext_p.h +++ b/src/widgets/platforms/x11/qximinputcontext_p.h diff --git a/src/widgets/inputmethod/qximinputcontext_x11.cpp b/src/widgets/platforms/x11/qximinputcontext_x11.cpp index de1212c556..de1212c556 100644 --- a/src/widgets/inputmethod/qximinputcontext_x11.cpp +++ b/src/widgets/platforms/x11/qximinputcontext_x11.cpp diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro index 0af43d6dd1..bff487bf3f 100644 --- a/src/widgets/widgets.pro +++ b/src/widgets/widgets.pro @@ -41,7 +41,6 @@ include(widgets/widgets.pri) include(dialogs/dialogs.pri) include(accessible/accessible.pri) include(itemviews/itemviews.pri) -include(inputmethod/inputmethod.pri) include(graphicsview/graphicsview.pri) include(util/util.pri) include(statemachine/statemachine.pri) |