diff options
Diffstat (limited to 'src/virtualkeyboard/doc')
25 files changed, 681 insertions, 216 deletions
diff --git a/src/virtualkeyboard/doc/QtVirtualKeyboard_pch.h b/src/virtualkeyboard/doc/QtVirtualKeyboard_pch.h deleted file mode 100644 index 298f0f60..00000000 --- a/src/virtualkeyboard/doc/QtVirtualKeyboard_pch.h +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifdef Q_CLANG_QDOC -#include "abstractinputmethod.h" -#include "abstractinputpanel.h" -#include "inputcontext.h" -#include "inputengine.h" -#include "selectionlistmodel.h" -#include "shifthandler.h" -#endif // Q_CLANG_QDOC diff --git a/src/virtualkeyboard/doc/doc.pri b/src/virtualkeyboard/doc/doc.pri index 9fb8fcf3..4da77d1f 100644 --- a/src/virtualkeyboard/doc/doc.pri +++ b/src/virtualkeyboard/doc/doc.pri @@ -3,5 +3,6 @@ OTHER_FILES += \ $$PWD/src/qtvirtualkeyboard-index.qdoc \ $$PWD/src/deployment-guide.qdoc \ $$PWD/src/technical-guide.qdoc \ + $$PWD/src/user-guide.qdoc \ $$PWD/src/build.qdoc \ $$PWD/src/snippets/CustomInputMethod.qml diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-en_US.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-en_US.png Binary files differnew file mode 100644 index 00000000..d3d761a2 --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-en_US.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-es_MX.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-es_MX.png Binary files differnew file mode 100644 index 00000000..62c2734b --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-es_MX.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-fr_CA.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-fr_CA.png Binary files differnew file mode 100644 index 00000000..03cb10c2 --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-fr_CA.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-id_ID.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-id_ID.png Binary files differnew file mode 100644 index 00000000..535c6c2a --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-id_ID.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-ms_MY.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-ms_MY.png Binary files differnew file mode 100644 index 00000000..0b31e24c --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-ms_MY.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-pt_BR.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-pt_BR.png Binary files differnew file mode 100644 index 00000000..a0b97e06 --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-pt_BR.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-sk_SK.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-sk_SK.png Binary files differnew file mode 100644 index 00000000..6f9ba0f6 --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-sk_SK.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-sl_SI.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-sl_SI.png Binary files differnew file mode 100644 index 00000000..9b2767b2 --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-sl_SI.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-sq_AL.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-sq_AL.png Binary files differnew file mode 100644 index 00000000..c8b6ca62 --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-sq_AL.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-th_TH.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-th_TH.png Binary files differnew file mode 100644 index 00000000..ce5baf0f --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-th_TH.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-tr_TR.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-tr_TR.png Binary files differnew file mode 100644 index 00000000..4d35661e --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-tr_TR.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-uk_UA.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-uk_UA.png Binary files differnew file mode 100644 index 00000000..df2f1ec7 --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-uk_UA.png diff --git a/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-vi_VN.png b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-vi_VN.png Binary files differnew file mode 100644 index 00000000..658ff346 --- /dev/null +++ b/src/virtualkeyboard/doc/images/layouts/qtvirtualkeyboard-layout-vi_VN.png diff --git a/src/virtualkeyboard/doc/qtvirtualkeyboard.qdocconf b/src/virtualkeyboard/doc/qtvirtualkeyboard.qdocconf index d70883d3..456d400d 100644 --- a/src/virtualkeyboard/doc/qtvirtualkeyboard.qdocconf +++ b/src/virtualkeyboard/doc/qtvirtualkeyboard.qdocconf @@ -6,26 +6,29 @@ version = $QT_VERSION buildversion = Qt Virtual Keyboard | Commercial or GPLv3 # Custom module header passed to clang -moduleheader = QtVirtualKeyboard_pch.h - -# Additional include paths passed to clang -includepaths = -I . +moduleheader = QtVirtualKeyboard.h headerdirs += .. -sourcedirs += .. -excludedirs += ../content/layouts \ - ../3rdparty +sourcedirs += .. ../../styles/ +excludedirs += ../content/layouts +excludefiles += "*_p.h" # Specify the install path under QT_INSTALL_EXAMPLES exampledirs += ../../../examples/virtualkeyboard \ snippets examplesinstallpath = virtualkeyboard +Cpp.ignoretokens += \ + QVIRTUALKEYBOARD_EXPORT +Cpp.ignoredirectives += \ + Q_DECLARE_LOGGING_CATEGORY \ + VIRTUALKEYBOARD_DEBUG + manifestmeta.highlighted.names = "QtVirtualKeyboard/Qt Quick Virtual Keyboard - Basic Example" imagedirs += images -depends += qtdoc qtcore qtgui qtwidgets qtwayland qtqml qtquick +depends += qtdoc qtcore qtgui qtwidgets qtwayland qtqml qtquick qtquickcontrols2 qhp.projects = QtVirtualKeyboard @@ -39,23 +42,23 @@ qhp.QtVirtualKeyboard.filterAttributes = qtvirtualkeyboard $QT_ qhp.QtVirtualKeyboard.customFilters.Qt.name = QtVirtualKeyboard $QT_VERSION qhp.QtVirtualKeyboard.customFilters.Qt.filterAttributes = qtvirtualkeyboard $QT_VERSION -qhp.QtVirtualKeyboard.subprojects = qmltypes examples # classes +qhp.QtVirtualKeyboard.subprojects = classes qmltypes examples -# qhp.QtVirtualKeyboard.subprojects.classes.title = C++ Classes -# qhp.QtVirtualKeyboard.subprojects.classes.indexTitle = Qt Virtual Keyboard C++ Classes -# qhp.QtVirtualKeyboard.subprojects.classes.selectors = class -# qhp.QtVirtualKeyboard.subprojects.classes.sortPages = true +qhp.QtVirtualKeyboard.subprojects.classes.title = C++ Classes +qhp.QtVirtualKeyboard.subprojects.classes.indexTitle = Qt Virtual Keyboard C++ Classes +qhp.QtVirtualKeyboard.subprojects.classes.selectors = class doc:headerfile +qhp.QtVirtualKeyboard.subprojects.classes.sortPages = true qhp.QtVirtualKeyboard.subprojects.qmltypes.title = QML Types qhp.QtVirtualKeyboard.subprojects.qmltypes.indexTitle = Qt Virtual Keyboard QML Types -qhp.QtVirtualKeyboard.subprojects.qmltypes.selectors = fake:qmlclass +qhp.QtVirtualKeyboard.subprojects.qmltypes.selectors = qmlclass qhp.QtVirtualKeyboard.subprojects.qmltypes.sortPages = true qhp.QtVirtualKeyboard.subprojects.examples.title = Examples qhp.QtVirtualKeyboard.subprojects.examples.indexTitle = Qt Virtual Keyboard Examples -qhp.QtVirtualKeyboard.subprojects.examples.selectors = fake:example +qhp.QtVirtualKeyboard.subprojects.examples.selectors = doc:example qhp.QtVirtualKeyboard.subprojects.examples.sortPages = true navigation.landingpage = "Qt Virtual Keyboard" navigation.qmltypespage = "Qt Virtual Keyboard QML Types" -# navigation.cppclassespage = "Qt Virtual Keyboard C++ Classes" +navigation.cppclassespage = "Qt Virtual Keyboard C++ Classes" diff --git a/src/virtualkeyboard/doc/src/build.qdoc b/src/virtualkeyboard/doc/src/build.qdoc index d72236fa..4968759a 100644 --- a/src/virtualkeyboard/doc/src/build.qdoc +++ b/src/virtualkeyboard/doc/src/build.qdoc @@ -42,34 +42,26 @@ The project is split into the following subprojects: \li \e examples/virtualkeyboard/basic/basic.pro \li Qt Virtual Keyboard Demo application \row - \li \e src/virtualkeyboard/virtualkeyboard.pro - \li Qt Virtual Keyboard plugin -\row - \li \e src/virtualkeyboard/styles/styles.pro - \li Qt Virtual Keyboard Style plugin that enables style decorations for the - keyboard + \li \e src/virtualkeyboard/import/ + \li Qt Virtual Keyboard QML plugin (QtQuick.VirtualKeyboard) \row - \li \e src/virtualkeyboard/3rdparty/hunspell/hunspell.pro - \li A project file for compiling the Hunspell library. - \note This project is used if the Hunspell library is built from - sources rather than depending on the system library. The project - will be activated when the source code is extracted to this - directory. + \li \e src/virtualkeyboard/plugin/ + \li Qt Virtual Keyboard platform input context plugin. This plugin + provides the QPlatformInputContext interface for the Qt and is + also responsible for loading the Virtual Keyboard Plugins + (QtQuick.VirtualKeyboard.Plugins). \row - \li \e src/virtualkeyboard/3rdparty/lipi-toolkit/lipi-toolkit.pro - \li A project file for compiling the lipi-toolkit library. + \li \e src/virtualkeyboard/plugins/ + \li A directory containing Qt Virtual Keyboard plugins, such as the Hunspell plugin \row - \li \e src/virtualkeyboard/3rdparty/openwnn/openwnn.pro - \li A project file for compiling the OpenWNN library. + \li \e src/virtualkeyboard/settings/ + \li Qt Virtual Keyboard Settings QML plugin (QtQuick.VirtualKeyboard.Settings) \row - \li \e src/virtualkeyboard/3rdparty/pinyin/pinyin.pro - \li A project file for compiling the PinyinIME library. -\row - \li \e src/virtualkeyboard/3rdparty/t9write/t9write.pro - \li A project file for including T9 Write dictionaries as resources. + \li \e src/virtualkeyboard/styles/styles.pro + \li Qt Virtual Keyboard Styles QML plugin (QtQuick.VirtualKeyboard.Styles) \row - \li \e src/virtualkeyboard/3rdparty/tcime/tcime.pro - \li A project file for compiling the TCIME library. + \li \e src/virtualkeyboard/virtualkeyboard.pro + \li Qt Virtual Keyboard module, QML components and layouts \endtable The input methods are implemented either in C++ or QML. @@ -128,7 +120,7 @@ keyboard features. \li \e handwriting \li Enables handwriting input \li This flag enables handwriting input using the first engine available at - build time in the following order: \c t9write, \c lipi-toolkit. To enable handwriting + build time in the following order: \c myscript, \c t9write, \c lipi-toolkit. To enable handwriting input using a specific engine, use the feature-specific configuration instead. For example, \c CONFIG+=lipi-toolkit. \row @@ -188,6 +180,18 @@ the preferred input method to the configuration, e.g., \c CONFIG+="lang-zh_TW zh system, or if it is built using the local project file. Integration can be disabled using this option. \row + \li \e no-bundle-pinyin + \li \e n/a + \li Disables bundling of pinyin resources + \li This option excludes pinyin resources from the plugin binary. This option may be + used to reduce the plugin binary size. +\row + \li \e no-bundle-tcime + \li \e n/a + \li Disables bundling of tcime resources + \li This option excludes tcime resources from the plugin binary. This option may be + used to reduce the plugin binary size. +\row \li \e static \li Enables static builds of the virtual keyboard \li This option enables \l {Static builds}{static builds}. @@ -199,6 +203,11 @@ the preferred input method to the configuration, e.g., \c CONFIG+="lang-zh_TW zh included in the package, but this option allows you to change the built-in default style. \row + \li \e no-builtin-style + \li \e n/a + \li Disables bunding of styles + \li This option excludes styles from the plugin binary. +\row \li \e pinyin \li \e lang-zh_CN \li Enables the Pinyin input method for Simplified Chinese. @@ -254,6 +263,11 @@ the preferred input method to the configuration, e.g., \c CONFIG+="lang-zh_TW zh \li \e handwriting \li Enables the handwriting input method using T9 Write. \li Handwriting recognition is based on the commercial T9 Write product from Nuance Communications. +\row + \li \e myscript + \li \e handwriting + \li Enables the handwriting input method using MyScript Text SDK. + \li Handwriting recognition is based on the most recent commercial Text Recognition SDK product from MyScript. \endtable \section2 Building Documentation @@ -270,10 +284,10 @@ By default, \e HunspellInputMethod will not be available unless the Hunspell library and development headers are found. For Linux/X11 targets, the Hunspell library can be provided by installing the libhunspell-dev package. Alternatively, the Hunspell sources can be extracted into the -\e src/virtualkeyboard/3rdparty/hunspell directory. If Hunspell sources are used, -then the dictionary files must also be copied into the -\e src/virtualkeyboard/3rdparty/hunspell/data directory. Furthermore, if Hunspell -sources are used, \e hunspell.pro will be used for all targets. +\e src/plugins/hunspell/3rdparty/hunspell directory. The sources are automatically +detected by the qmake and the project will be configured to use the local Hunspell. +If Hunspell sources are used, then the dictionary files must also be +copied into the \e src/plugins/hunspell/3rdparty/hunspell/data directory. An example of how the directory structure should look after copying in the Hunspell sources and dictionary files is listed below: @@ -313,7 +327,7 @@ described below, or by using the \e unpack.py script found in the t9write direct To unpack the SDK using the script: \badcode -$ cd src/virtualkeyboard/3rdparty/t9write/ +$ cd src/plugins/t9write/3rdparty/t9write/ $ python unpack.py T9Write_Alpha_v7-8-0_SDK.zip . \endcode @@ -426,6 +440,143 @@ Where the contents of each directory are: Finally, the SDK is included in the build by adding CONFIG+=t9write to the qmake command line. +\section2 MyScript Text SDK Integration + +MyScript Text is designed for building applications that enable the recognition of +handwritten text. MyScript Text supports the recognition of isolated characters, cursive, +print and superimposed writing. +MyScript superimposed writing is integrated into Qt Virtual Keyboard. It enables +the recognition of letters, words or parts of words written one over the other, +without any explicit separation between consecutive fragments. It is capable of running +on memory and CPU constrained devices. + +\section3 Input handwriting styles of MyScript Text SDK + +The end-user can write one word fragment over the other, or one character over the other, +as depicted below. Space between two written words are automatically added, so that there +is no need for an explicit gesture. + +\raw HTML +<div align="center"><figure><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="21.057215mm" height="23.094498mm" viewbox="0 0 74.612178 81.830896" id="svg4891" version="1.1"> <defs id="defs4893"></defs> <metadata id="metadata4896"> </metadata> <g id="layer1" transform="translate(523.68284,-132.09962)"> <filter id="dropshadow" height="130%"> <fegaussianblur in="SourceAlpha" stddeviation="3"></fegaussianblur> <feoffset dx="2" dy="2" result="offsetblur"></feoffset> <fecomponenttransfer xmlns="http://www.w3.org/2000/svg"> <fefunca type="linear" slope="0.5"></fefunca> </fecomponenttransfer> <femerge> <femergenode></femergenode> <femergenode in="SourceGraphic"></femergenode> </femerge></filter> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="300" stroke-dashoffset="300" d="m -523.25902,200.29853 c 6.95139,11.10595 25.78874,3.22177 32.32488,-4.04061 11.79865,-13.1096 17.63403,-31.02787 14.14214,-48.48732 -0.50587,-2.52933 -5.5167,-18.22189 -9.09137,-14.64721 -5.55428,5.55427 -5.5673,24.06358 -6.06092,30.80965 -0.76585,10.46668 -2.8203,20.43699 -4.04061,30.80965 -0.6416,5.45361 -0.50508,9.28437 -0.50508,14.64722 0,1.34687 1.34687,4.04061 0,4.04061 -0.61968,0 0.23734,-4.20009 2.52539,-10.60661 3.69589,-10.34851 8.06488,-17.115 18.68782,-21.71828 2.1627,-0.93717 6.32571,-2.23606 7.07106,0 1.75433,5.26298 -3.71882,27.10875 8.08123,24.74874 1.4766,-0.29532 3.0107,-0.92173 4.04061,-2.0203 1.59968,-1.70633 2.42154,-4.00433 3.53553,-6.06092 1.07581,-1.98612 2.0203,-4.04061 3.03046,-6.06091" id="path4899"> <animate begin="0s;hOpacityFinal.end" attributename="stroke-dashoffset" from="300px" to="0px" dur="2s" fill="freeze" id="h"></animate> <animate begin="h.end" attributename="opacity" from="1" to="0.2" dur="2s" fill="freeze" id="hOpacity"></animate> <animate begin="oOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="hOpacityFinal"></animate> <set begin="hOpacityFinal.end" attributename="opacity" to="1"></set> </path> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="150" stroke-dashoffset="150" d="m -503.05597,187.16655 c 6.30156,1.57539 7.48006,2.26745 14.64721,2.0203 4.68337,-0.16149 7.79914,-1.02611 11.11168,-4.54568 10.51043,-11.16733 -11.38898,-18.31643 -18.18274,-3.03046 -0.77578,1.7455 -0.56279,12.84339 0,14.14214 6.50612,15.01414 20.7593,7.81972 27.77919,-2.52539 1.4399,-2.12194 2.02031,-4.71404 3.03046,-7.07106" id="path4901"> <animate begin="h.end+0.01s" attributename="stroke-dashoffset" from="150px" to="0px" dur="2s" fill="freeze" id="e"></animate> <animate begin="e.end" attributename="opacity" from="1" to="0.2" dur="2s" fill="freeze" id="eOpacity"></animate> <animate begin="oOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="eOpacityFinal"></animate> <set begin="h.end" attributename="opacity" to="1"></set> </path> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="200" stroke-dashoffset="200" d="m -501.03566,200.80361 c 11.64322,7.6781 20.14867,-6.67932 24.24366,-16.16244 1.65295,-3.82789 5.7942,-16.09995 4.54568,-21.71828 -0.76783,-3.45526 -2.7246,-6.56132 -4.54568,-9.59645 -10.0858,-16.80967 -16.78281,-1.60069 -18.68782,10.10152 -1.35371,8.31563 -3.14678,22.86131 -0.50508,31.31473 4.4811,14.33953 15.24399,22.1694 26.76904,8.5863 3.22845,-3.80496 5.30918,-10.30708 7.07107,-15.15229" id="path4903"> <animate begin="e.end+0.01s" attributename="stroke-dashoffset" from="200px" to="0px" dur="2s" fill="freeze" id="l"></animate> <animate begin="l.end" attributename="opacity" from="1" to="0.2" dur="2s" fill="freeze" id="lOpacity"></animate> <animate begin="oOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="lOpacityFinal"></animate> <set begin="e.end" attributename="opacity" to="1"></set> </path> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="220" stroke-dashoffset="220" d="m -507.60165,205.3493 c 1.53719,3.07439 0.25722,2.0203 4.54568,2.0203 11.013,0 16.92189,-7.83289 21.21321,-17.67767 1.48054,-3.39653 3.24098,-15.42468 3.03045,-18.68782 -0.31004,-4.80567 -4.96262,-9.4326 -7.57614,-12.62691 -5.01521,-6.1297 -7.93642,-7.18375 -11.61676,1.51523 -3.61721,8.54979 -5.0193,26.86342 -2.0203,35.86042 3.71905,11.15714 12.82566,21.08507 24.74874,11.61675 3.11162,-2.47099 4.71404,-6.39763 7.07106,-9.59645" id="path4905"> <animate begin="l.end+0.01s" attributename="stroke-dashoffset" from="220px" to="0px" dur="2s" fill="freeze" id="l2"></animate> <animate begin="l2.end" attributename="opacity" from="1" to="0.2" dur="2s" fill="freeze" id="l2Opacity"></animate> <animate begin="oOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="l2OpacityFinal"></animate> <set begin="l.end" attributename="opacity" to="1"></set> </path> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="120" stroke-dashoffset="120" d="m -483.86307,185.14624 c -4.91638,-10.38229 -25.09874,-2.01585 -21.71828,9.09138 4.18358,13.74606 25.60472,15.81949 31.31473,2.0203 8.05585,-19.4683 -24.24366,-20.3309 -24.24366,-12.12183" id="path4907"> <animate begin="l2.end+0.01s" attributename="stroke-dashoffset" from="100px" to="0px" dur="2s" fill="freeze" id="o"></animate> <animate begin="o.end" attributename="opacity" from="1" to="0" dur="2s" fill="freeze" id="oOpacity"></animate> <set begin="l2.end" attributename="opacity" to="1"></set> </path> </g></svg><figcaption>Writing one character over the other</figcaption></figure></div> +<div align="center"><figure><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg2" viewbox="0 0 156.63411 96.840738" height="27.330608mm" width="44.205627mm"> <defs id="defs4"></defs> <metadata id="metadata7"> </metadata> <g transform="translate(-19.991064,-156.76845)" id="layer1"> <path id="path3338" stroke-dasharray="700" stroke-dashoffset="700" d="m 20.203051,228.07773 c 7.019038,3.28583 18.296996,2.19868 25.253814,2.0203 27.834023,-0.71369 42.825541,-21.91043 41.416254,-47.98224 -0.323001,-5.97553 -7.191269,-26.45641 -10.606602,-24.74874 -10.259596,5.1298 -9.124503,41.18434 -7.576144,52.02286 1.430314,10.01219 2.165272,8.95563 3.030458,20.20305 0.514408,6.68731 0.563751,12.53255 1.515229,19.19289 0.191958,1.34371 0.355181,2.69156 0.505076,4.04061 0.01859,0.16733 0,0.67344 0,0.50508 0,-2.49868 0.106479,0.64925 -1.010153,-4.04061 -1.138171,-4.78032 -2.879899,-14.31543 -2.525381,-18.68782 0.215131,-2.65328 1.334905,-5.19519 2.525381,-7.57615 1.190476,-2.38095 2.750791,-4.60015 4.545687,-6.56599 2.880061,-3.15435 5.631315,-6.15186 10.101525,-5.55584 7.218425,0.96246 9.158962,18.77507 9.596449,24.24367 0.312712,3.90889 -0.730173,4.84918 1.010153,8.08122 2.037193,3.78335 3.387013,4.88523 8.081223,5.55583 5.47716,0.78246 9.60547,-2.86344 13.63706,-6.06091 2.23856,-1.77541 4.56788,-3.62491 6.06091,-6.06092 4.94323,-8.06526 6.7262,-26.15308 -6.06091,-28.28427 -20.629129,-3.43819 -15.11782,36.04559 11.11167,35.35534 3.30658,-0.087 6.53787,-1.26596 9.59645,-2.52538 25.47885,-10.49129 20.89279,-45.3686 11.61676,-65.65992 -1.54311,-3.37554 -5.32932,-11.06285 -9.09137,-13.13198 -1.47519,-0.81135 -3.36718,0 -5.05077,0 -1.01015,0 -2.08112,-0.34521 -3.03046,0 -9.66282,3.51375 -12.01346,27.64821 -11.11167,36.36549 0.68611,6.63247 4.06851,21.716 8.08122,26.76905 8.89766,11.20446 20.90822,13.3675 34.34518,14.64721 4.58435,0.4366 7.15182,0.9294 10.10153,-2.02031" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;"> <animate begin="0s;helOpacityFinal.end" attributename="stroke-dashoffset" from="700px" to="0px" dur="2s" fill="freeze" id="hel"></animate> <animate begin="hel.end" attributename="opacity" from="1" to="0.2" dur="3s" fill="freeze" id="helOpacity"></animate> <animate begin="loOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="helOpacityFinal"></animate> <set begin="helOpacityFinal.end" attributename="opacity" to="1"></set> </path> <path id="path3344" stroke-dasharray="500" stroke-dashoffset="500" d="m 41.416254,231.61326 c 3.094802,7.92585 11.797035,7.22396 19.192898,7.57614 31.260076,1.48858 50.776938,-24.97346 43.436558,-55.55839 -2.10376,-8.76565 -7.342388,-19.06976 -17.172591,-20.70812 -0.664273,-0.11071 -1.494441,-0.42069 -2.020305,0 -0.542049,0.43364 -0.354492,1.34267 -0.505077,2.0203 -0.522917,2.35313 -1.164511,4.68619 -1.515229,7.07107 -2.708747,18.41948 0.296465,32.36077 6.565992,49.49747 2.682486,7.33213 5.639357,17.22468 15.15229,17.67767 13.38648,0.63746 15.45757,-25.2821 7.07106,-32.82995 -1.55953,-1.40358 -5.88665,6.03367 -4.54568,15.15228 1.46349,9.95173 11.80613,17.40505 21.71828,15.15229 4.41964,-1.00446 11.43406,-9.0399 12.6269,-11.11167 7.10359,-12.33781 -9.7499,-22.51604 -18.18274,-26.26397 -11.05732,-4.91436 -18.5283,7.61904 -12.62691,11.61675 9.07281,6.1461 23.89173,1.97435 32.32488,-1.51523 4.27171,-1.7676 7.7445,-5.05076 11.61676,-7.57614" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4"> <animate begin="hel.end" attributename="stroke-dashoffset" from="500px" to="0px" dur="3s" fill="freeze" id="lo"></animate> <animate begin="lo.end" attributename="opacity" from="1" to="0" dur="2s" fill="freeze" id="loOpacity"></animate> <set begin="hel.end" attributename="opacity" to="1"></set> </path> </g></svg><figcaption>Writing fragments of word over the others</figcaption></figure></div> +\endraw + +\section3 Language coverage of MyScript Text SDK + +MyScript Superimposed supports 70 languages. + +\section3 MyScript Text SDK Packages Installation + +The MyScript delivery team can provide you the packages with various \c .zip archives. +To access all the code, tools, and resources needed for building your own +handwriting application, \b {extract all the packages in the same destination folder} as +\c src/plugins/myscript/3rdparty/myscript. + +The file hierarchy should look like below: + +\badcode +3rdparty +└── myscript + ├─── conf + ├─── doc + ├─── edk + ├─── engine + │ └─── bin + │ ├─── lin-arm64 + │ │ └─── *.so + │ ├─── lin-armv7 + │ │ └─── *.so + │ ├─── lin-x64 + │ │ └─── *.so + │ ├─── lin-x86 + │ │ └─── *.so + │ ├─── win-x64 + │ │ └─── *.dll + │ ├─── win-x86 + │ │ └─── *.dll + │ (etc.) + ├─── rdk + ├─── resources + │ ├─── ar + │ │ └─── *.res + │ ├─── en_GB + │ │ └─── *.res + │ ├─── ja_JP + │ │ └─── *.res + │ ├─── ko_KR + │ │ └─── *.res + │ ├─── zh_CN + │ │ └─── *.res + │ (etc.) + ├─── tools + └─── voim + ├─── api + ├─── bin + │ ├─── lin-arm64 + │ │ └─── *.so + │ ├─── lin-armv7 + │ │ └─── *.so + │ ├─── lin-x64 + │ │ └─── *.so + │ ├─── lin-x86 + │ │ └─── *.so + │ ├─── win-x64 + │ │ └─── *.dll + │ ├─── win-x86 + │ │ └─── *.dll + │ (etc.) + └─── conf +\endcode + +The description for the contents of each directory are: + +\table +\header + \li Directory + \li Description +\row + \li \e conf + \li Contains the language configuration files that the Engine uses to configure language resources. +\row + \li \e doc + \li Contains the HTML documentation files. The file \c index.html displays the main page. +\row + \li \e edk + \li Contains the Engine Development Kit and handwriting programming elements for each supported programming language API, including code samples. +\row + \li \e engine + \li Contains libraries of each engine object, depending on the target platforms it could be SO, A, or DLL. +\row + \li \e rdk + \li Contains the Resource Development Kit, i.e. tools and examples for creating custom resources. +\row + \li \e resources + \li Contains resource files with the /c .res extension. They are binary assets used at run time by the different MyScript technologies to achieve the various recognition tasks. +\row + \li \e tools + \li Contains useful programmer tools including InkTool for ink testing. +\row + \li \e voim + \li Contains libraries of MyScript Text Input Method. It is an extension SDK to the MyScript Text recognition system and designed for building input methods using handwriting recognition easily and quickly. +\endtable + +\section3 Setting the Certificate of MyScript Text SDK + +\b {A valid certificate is mandatory to use the MyScript Text SDK.} This is a +security measure that uniquely identifies you as a legitimate customer of MyScript +technologies. The certificate helps MyScript trace customers' identify and the products +that have been purchased. + +The certificate is delivered in the /c [your_login].vo.zip package. When you unzip +this package, the certificate is automatically put in the appropriate location. +This ensure that the certificate is instantly working within the services and code +samples that you have been provided with. + +\section3 How to build Qt Virtual Keyboard with MyScript Text SDK + +The MyScript Text SDK is included in the build of Qt Virtual Keyboard by either +adding \c CONFIG+=handwriting or \c CONFIG+=myscript to the qmake command line. + \section2 Static builds The virtual keyboard can be built and linked statically against the application. diff --git a/src/virtualkeyboard/doc/src/deployment-guide.qdoc b/src/virtualkeyboard/doc/src/deployment-guide.qdoc index 01823e15..6e1a2642 100644 --- a/src/virtualkeyboard/doc/src/deployment-guide.qdoc +++ b/src/virtualkeyboard/doc/src/deployment-guide.qdoc @@ -52,6 +52,10 @@ locations: \li \c $$[QT_INSTALL_PLUGINS]/platforminputcontexts \li \c /system/plugins/platforminputcontexts \row + \li qtvirtualkeyboardextensionplugin + \li \c $$[QT_INSTALL_PLUGINS]/virtualkeyboard + \li \c /system/plugins/virtualkeyboard +\row \li qtvirtualkeyboardplugin QML files \li \c $$[QT_INSTALL_QML]/QtQuick/VirtualKeyboard \li \c /system/qml/QtQuick/VirtualKeyboard @@ -200,32 +204,44 @@ There are several environment variables defined by the module that are listed be \li QT_VIRTUALKEYBOARD_PINYIN_DICTIONARY \li Overrides the location of the Pinyin dictionary. - The default location depends on the value of - \c {QLibraryInfo::location(QLibraryInfo::DataPath)}. + By default, the dictionary is bundled into the plugin's resources. + + To disable resource bundling, add \c CONFIG+=no-bundle-pinyin in the + plugin's qmake command line. In this scenario, the default location + depends on the value of \c {QLibraryInfo::location(QLibraryInfo::DataPath)}. For example, for Qt libraries built from source, it could be \c {qtbase/qtvirtualkeyboard/pinyin/dict_pinyin.dat}. \row \li QT_VIRTUALKEYBOARD_CANGJIE_DICTIONARY \li Overrides the location of the Cangjie dictionary. - The default location depends on the value of - \c {QLibraryInfo::location(QLibraryInfo::DataPath)}. + By default, the dictionary is bundled into the plugin's resources. + + To disable resource bundling, add \c CONFIG+=no-bundle-tcime in the + plugin's qmake command line. In this scenario, the default location + depends on the value of \c {QLibraryInfo::location(QLibraryInfo::DataPath)}. For example, for Qt libraries built from source, it could be \c {qtbase/qtvirtualkeyboard/tcime/dict_cangjie.dat}. \row \li QT_VIRTUALKEYBOARD_ZHUYIN_DICTIONARY \li Overrides the location of the Zhuyin dictionary. - The default location depends on the value of - \c {QLibraryInfo::location(QLibraryInfo::DataPath)}. + By default, the dictionary is bundled into the plugin's resources. + + To disable resource bundling, add \c CONFIG+=no-bundle-tcime in the + plugin's qmake command line. In this scenario, the default location + depends on the value of \c {QLibraryInfo::location(QLibraryInfo::DataPath)}. For example, for Qt libraries built from source, it could be \c {qtbase/qtvirtualkeyboard/tcime/dict_zhuyin.dat}. \row \li QT_VIRTUALKEYBOARD_PHRASE_DICTIONARY \li Overrides the location of the phrase dictionary. - The default location depends on the value of - \c {QLibraryInfo::location(QLibraryInfo::DataPath)}. + By default, the dictionary is bundled into the plugin's resources. + + To disable resource bundling, add \c CONFIG+=no-bundle-tcime in the + plugin's qmake command line. In this scenario, the default location + depends on the value of \c {QLibraryInfo::location(QLibraryInfo::DataPath)}. For example, for Qt libraries built from source, it could be \c {qtbase/qtvirtualkeyboard/tcime/dict_phrases.dat}. \row diff --git a/src/virtualkeyboard/doc/src/handwriting.qdoc b/src/virtualkeyboard/doc/src/handwriting.qdoc index f9408f02..d1376868 100644 --- a/src/virtualkeyboard/doc/src/handwriting.qdoc +++ b/src/virtualkeyboard/doc/src/handwriting.qdoc @@ -60,35 +60,146 @@ is a commercial handwriting recognition engine. T9 Write supports handwriting written in the following languages: -\list -\li Arabic -\li Bulgarian -\li Croatian -\li Czech -\li Danish -\li Dutch -\li English -\li Estonian -\li Finnish -\li French -\li German -\li Greek -\li Hebrew -\li Hungarian -\li Italian -\li Japanese -\li Korean -\li Norwegian -\li Persian/Farsi -\li Polish -\li Portugese -\li Romanian -\li Russian -\li Serbian -\li Simplified Chinese -\li Spanish -\li Swedish -\li Traditional Chinese +\table +\row +\li \list + \li Arabic + \li Bulgarian + \li Croatian + \li Czech + \li Danish + \li Dutch + \li English \endlist +\li \list + \li Estonian + \li Finnish + \li French + \li German + \li Greek + \li Hebrew + \li Hungarian +\endlist +\li \list + \li Italian + \li Japanese + \li Korean + \li Norwegian + \li Persian/Farsi + \li Polish + \li Portugese +\endlist +\li \list + \li Romanian + \li Russian + \li Serbian + \li Simplified Chinese + \li Spanish + \li Swedish + \li Traditional Chinese +\endlist +\endtable + +\section1 MyScript + +\l {https://www.myscript.com}{MyScript} +SDK is a commercial handwriting recognition engine. + +\MyScript SDK supports 71 handwriting recognition languages: + +\table +\row +\li \list + \li Afrikaans + \li Albanian + \li Arabic + \li Armenian + \li Azeri, Azerbaijani + \li Basque + \li Belarusian (Cyrillic) + \li Bosnian (Latin) + \li Bulgarian + \li Catalan + \li Cebuano + \li Chinese Simplified + \li Chinese Traditional - Hong Kong + \li Chinese Traditional - Taiwan + \li Croatian + \li Czech + \li Danish +\endlist +\li \list + \li Dutch, Flemish + \li Dutch + \li English - Canada + \li English - Philippines + \li English - United Kingdom + \li English - United States + \li Estonian + \li Farsi, Persian + \li Filipino, Pilipino, Tagalog + \li Finnish + \li French - Canada + \li French - France + \li Galician + \li Georgian + \li German - Austria + \li German - Germany + \li Greek + \li Hebrew +\endlist +\li \list + \li Hindi + \li Hungarian + \li Icelandic + \li Indonesian + \li Irish, Ireland Gaelic + \li Italian + \li Japanese + \li Kazakh + \li Korean + \li Latvian + \li Lithuanian + \li Macedonian + \li Malagasy + \li Malay + \li Mongolian + \li Norwegian, Nordic Bokmal + \li Polish + \li Portuguese - Brazil +\endlist +\li \list + \li Portuguese - Portugal + \li Romanian + \li Russian + \li Serbian (Cyrillic) + \li Serbian (Latin) + \li Slovak + \li Slovenian, Slovene + \li Spanish - Colombia + \li Spanish - Spain + \li Spanish - Mexico + \li Swahili (Latin) + \li Swedish + \li Tatar (Cyrillic) + \li Thai + \li Turkish + \li Ukrainian + \li Urdu + \li Vietnamese +\endlist +\endtable + +\MyScript is integrated into Qt Virtual Keyboard with identical coverage of supported languages. + + \list + \li \l {Qt Virtual Keyboard#Supported Languages}{Supported Languages} + \endlist + +However, with minor modifications to the Qt Virtual Keyboard source code, it is easy to add handwriting panels for other languages supported by \MyScript. + +To get the \MyScript SDK or additional information, please contact \MyScript at \l {mailto:contactus@myscript.com}{contactus@myscript.com}. + +\b {See also}: \l {MyScript Text SDK Integration} */ diff --git a/src/virtualkeyboard/doc/src/includes/layouts.qdocinc b/src/virtualkeyboard/doc/src/includes/layouts.qdocinc index 272f7e9c..47649df5 100644 --- a/src/virtualkeyboard/doc/src/includes/layouts.qdocinc +++ b/src/virtualkeyboard/doc/src/includes/layouts.qdocinc @@ -2,7 +2,10 @@ The Virtual Keyboard supports the following languages: -\list +\table +\row +\li \list + \li \l {Albanian Layout}{Albanian} \li \l {Arabic Layout}{Arabic} \li \l {Bulgarian Layout}{Bulgarian} \li \l {Bulgarian Layout (Latin)}{Bulgarian (Latin)} @@ -10,10 +13,14 @@ The Virtual Keyboard supports the following languages: \li \l {Czech Layout}{Czech} \li \l {Danish Layout}{Danish} \li \l {Dutch Layout}{Dutch} - \li \l {English Layout}{English} + \li \l {English (British) Layout}{English (British)} + \li \l {English (American) Layout}{English (American)} \li \l {Estonian Layout}{Estonian} +\endlist +\li \list \li \l {Finnish Layout}{Finnish} \li \l {French Layout}{French} + \li \l {French Layout (Canadian)}{French (Canadian)} \li \l {German Layout}{German} \li \l {Greek Layout}{Greek} \li \l {Greek Layout (Latin)}{Greek (Latin)} @@ -21,26 +28,39 @@ The Virtual Keyboard supports the following languages: \li \l {Hebrew Layout (Latin)}{Hebrew (Latin)} \li \l {Hindi Layout}{Hindi} \li \l {Hungarian Layout}{Hungarian} + \li \l {Indonesian Layout}{Indonesian} \li \l {Italian Layout}{Italian} +\endlist +\li \list \li \l {Japanese Layout (Hiragana)}{Japanese (Hiragana)} \li \l {Japanese Layout (Katakana)}{Japanese (Katakana)} \li \l {Japanese Layout (Full Width Latin)}{Japanese (Full Width Latin)} \li \l {Japanese Layout (Latin)}{Japanese (Latin)} \li \l {Korean Layout}{Korean} + \li \l {Malay Layout}{Malay} \li \l {Norwegian Layout}{Norwegian} \li \l {Persian/Farsi Layout}{Persian/Farsi} \li \l {Polish Layout}{Polish} \li \l {Portugese Layout}{Portugese} \li \l {Romanian Layout}{Romanian} \li \l {Russian Layout}{Russian} +\endlist +\li \list \li \l {Serbian Layout}{Serbian} \li \l {Serbian Layout (Latin)}{Serbian (Latin)} \li \l {Simplified Chinese Layout}{Simplified Chinese} \li \l {Traditional Chinese Layout (Zhuyin)}{Traditional Chinese (Zhuyin)} \li \l {Traditional Chinese Layout (Cangjie)}{Traditional Chinese (Cangjie)} + \li \l {Slovak Layout}{Slovak} + \li \l {Slovenian Layout}{Slovenian} \li \l {Spanish Layout}{Spanish} \li \l {Swedish Layout}{Swedish} + \li \l {Thai Layout}{Thai} + \li \l {Turkish Layout}{Turkish} + \li \l {Ukrainian Layout}{Ukrainian} + \li \l {Vietnamese Layout}{Vietnamese} \endlist +\endtable To add support for an additional language, see \l {Adding New Keyboard Layouts}. diff --git a/src/virtualkeyboard/doc/src/layouts.qdoc b/src/virtualkeyboard/doc/src/layouts.qdoc index 044732f1..70ab2f05 100644 --- a/src/virtualkeyboard/doc/src/layouts.qdoc +++ b/src/virtualkeyboard/doc/src/layouts.qdoc @@ -36,6 +36,10 @@ The next sections illustrate each layout. +\section2 Albanian Layout + +\image layouts/qtvirtualkeyboard-layout-sq_AL.png + \section2 Arabic Layout \image layouts/qtvirtualkeyboard-layout-ar_AR.png @@ -64,10 +68,14 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-nl_NL.png -\section2 English Layout +\section2 English (British) Layout \image layouts/qtvirtualkeyboard-layout-en_GB.png +\section2 English (American) Layout + +\image layouts/qtvirtualkeyboard-layout-en_US.png + \section2 Estonian Layout \image layouts/qtvirtualkeyboard-layout-et_EE.png @@ -80,6 +88,10 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-fr_FR.png +\section2 French Layout (Canadian) + +\image layouts/qtvirtualkeyboard-layout-fr_CA.png + \section2 German Layout \image layouts/qtvirtualkeyboard-layout-de_DE.png @@ -108,6 +120,10 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-hu_HU.png +\section2 Indonesian Layout + +\image layouts/qtvirtualkeyboard-layout-id_ID.png + \section2 Italian Layout \image layouts/qtvirtualkeyboard-layout-it_IT.png @@ -132,6 +148,10 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-ko_KR.png +\section2 Malay Layout + +\image layouts/qtvirtualkeyboard-layout-ms_MY.png + \section2 Norwegian Layout \image layouts/qtvirtualkeyboard-layout-nb_NO.png @@ -148,6 +168,10 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-pt_PT.png +\section2 Portugese Layout (Brazil) + +\image layouts/qtvirtualkeyboard-layout-pt_BR.png + \section2 Romanian Layout \image layouts/qtvirtualkeyboard-layout-ro_RO.png @@ -176,12 +200,40 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-zh_TW-cangjie.png +\section2 Slovak Layout + +\image layouts/qtvirtualkeyboard-layout-sk_SK.png + +\section2 Slovenian Layout + +\image layouts/qtvirtualkeyboard-layout-sl_SI.png + \section2 Spanish Layout \image layouts/qtvirtualkeyboard-layout-es_ES.png +\section2 Spanish Layout (Mexican) + +\image layouts/qtvirtualkeyboard-layout-es_MX.png + \section2 Swedish Layout \image layouts/qtvirtualkeyboard-layout-sv_SE.png +\section2 Thai Layout + +\image layouts/qtvirtualkeyboard-layout-th_TH.png + +\section2 Turkish Layout + +\image layouts/qtvirtualkeyboard-layout-tr_TR.png + +\section2 Ukrainian Layout + +\image layouts/qtvirtualkeyboard-layout-uk_UA.png + +\section2 Vietnamese Layout + +\image layouts/qtvirtualkeyboard-layout-vi_VN.png + */ diff --git a/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc b/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc index 4b42bb7a..353afe6d 100644 --- a/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc +++ b/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc @@ -63,6 +63,17 @@ \include layouts.qdocinc layout-list + \section1 Third-party Plugins + + The Qt Virtual Keyboard supports third-party plugins from the following vendors: + \list + \li \l {Handwriting Recognition#T9 Write}{T9 Write} handwriting text input. + \li \l {Handwriting Recognition#MyScript}{MyScript} Text handwriting recognition + \endlist + + \l {Building Qt Virtual Keyboard} describes how to integrate these plugins + into the Qt Virtual Keyboard. + \section1 Guides \list @@ -76,6 +87,7 @@ \list \li \l{Qt Virtual Keyboard QML Types}{QML Types} + \li \l{Qt Virtual Keyboard C++ Classes}{C++ Classes} \endlist \section1 Examples @@ -97,7 +109,7 @@ */ /*! -\qmlmodule QtQuick.VirtualKeyboard 2.3 +\qmlmodule QtQuick.VirtualKeyboard 2.4 \title Qt Virtual Keyboard QML Types \ingroup qmlmodules \brief Provides QML types for an input framework and a reference keyboard front @@ -107,7 +119,7 @@ end. import statements in your .qml file: \code - import QtQuick.VirtualKeyboard 2.3 + import QtQuick.VirtualKeyboard 2.4 import QtQuick.VirtualKeyboard.Styles 2.2 import QtQuick.VirtualKeyboard.Settings 2.2 \endcode diff --git a/src/virtualkeyboard/doc/src/qtvirtualkeyboard-module-cpp.qdoc b/src/virtualkeyboard/doc/src/qtvirtualkeyboard-module-cpp.qdoc index a0514fe9..eeb62dac 100644 --- a/src/virtualkeyboard/doc/src/qtvirtualkeyboard-module-cpp.qdoc +++ b/src/virtualkeyboard/doc/src/qtvirtualkeyboard-module-cpp.qdoc @@ -30,14 +30,13 @@ \title Qt Virtual Keyboard C++ Classes \brief Provides classes to implement input methods for virtual keyboards. - \internal - + \ingroup modules \qtvariable virtualkeyboard To include the definitions of the module's classes, use the following directive: \code - #include <QVirtualKeyboard> + #include <QtVirtualKeyboard> \endcode To link against the module, add this line to your qmake .pro file: diff --git a/src/virtualkeyboard/doc/src/technical-guide.qdoc b/src/virtualkeyboard/doc/src/technical-guide.qdoc index e8ae300a..10e0beea 100644 --- a/src/virtualkeyboard/doc/src/technical-guide.qdoc +++ b/src/virtualkeyboard/doc/src/technical-guide.qdoc @@ -44,21 +44,33 @@ These interfaces allow the plugin to be used as a platform input context plugin in Qt 5 applications. The plugin itself provides an input framework supporting multiple -input methods as well as a QML UI for the virtual keyboard. +input methods as well as a QML UI for the virtual keyboard. The input +framework is extensible through a plugin interface, which allows third-party +input methods and keyboard layouts to be loaded at runtime. The input framework provides the following main interfaces: \list - \li InputContext: provides contextual information for the virtual keyboard - and other input components. - \li InputEngine: exposes an API to integrate user input events (key + \li QVirtualKeyboardInputContext: provides contextual information for the virtual keyboard + and other input components. Acts as an interface to the underlying + text input component. + \li QVirtualKeyboardInputEngine: exposes an API to integrate user input events (key presses, etc.) and acts as a host for input methods. - \li InputMethod: a base type for QML based input methods. + \li QVirtualKeyboardAbstractInputMethod: a base type for C++-based input methods. The input method + usually handles key events, but can also handle mouse and touch input + events. + \li InputMethod: a base type for QML-based input methods. The input method + usually handles key events, but can also handle mouse and touch input + events. + \li QVirtualKeyboardExtensionPlugin: a plugin interface for virtual keyboard + extensions that provide additional functionality. \endlist -\section1 The Input Context +\section1 Input Context -The input context is used by the keyboard as well as concrete input methods. +The input context is used by the keyboard as well as concrete input methods. InputContext +is a singleton instance hosted by QML. An application should not directly interact with +the input context. \section2 Contextual Information @@ -78,7 +90,20 @@ from the application. This information includes, but is not limited to: The list of supported locales is specified by the existence of a locale specific layout directory in "layouts/*". Each layout directory may contain one -or more layouts, for example fi_FI/main.qml or symbols.qml. +or more layouts, for example fi_FI/main.qml or symbols.qml. If the locale specific +layout is not different from the fallback locale, then a place holder file \c +<layout type>.fallback can be added for the layout. This will specify the virtual +keyboard that a fallback layout can be used instead. + +At minimum the layout directory must contain the files: + +\list + \li \c dialpad.fallback + \li \c digits.fallback + \li \c main.fallback + \li \c numbers.fallback + \li \c symbols.fallback +\endlist The application can specify the initial layout by changing the default locale. However, this needs to be done before the application is initialized and the @@ -88,8 +113,8 @@ current system locale is used. The keyboard locale matching is performed in the following sequence: \list - \li layouts/language_country - \li layouts/language_* + \li layouts/<language>_<country> + \li layouts/<language>_* \li layouts/en_GB \endlist @@ -101,26 +126,21 @@ After the locale selection is done, the keyboard updates the input locale and input direction to match the current layout. The application can receive this information through the QInputMethod interface. -Internally, the current input locale is also updated to the InputEngine -and the current InputMethod instances. - -\section2 UI Animations +Internally, the current input locale is also updated to the QVirtualKeyboardInputEngine +and the current input method instances. -The keyboard should notify the input context about UI transitions and -animations. The InputContext::animating property sets the animating property of -the input context. - -\section1 The Input Engine +\section1 Input Engine -The input engine object is owned by InputContext. The input engine contains -API functions which the keyboard can use to map user interactions such as key -press and key release events. +The input engine object is owned by InputContext. Like the InputContext, there is +only one instance of the QVirtualKeyboardInputEngine. The input engine contains API functions which +the keyboard uses to map user interactions, such as key press and release events, +to the input method. -The input events are mapped through the following methods: +For example, virtual keyboard key events are mapped through the following methods: \list - \li InputEngine::virtualKeyPress - \li InputEngine::virtualKeyRelease + \li QVirtualKeyboardInputEngine::virtualKeyPress + \li QVirtualKeyboardInputEngine::virtualKeyRelease \endlist The above-mentioned methods are intended for the integration of the virtual @@ -129,21 +149,137 @@ the methods are not suitable for mapping the physical keystrokes. This is a consequence of the fact that the actual action is performed only when the key is released. -If the user releases the key without having to perform the actual action, the -key can be interrupted by using the InputEngine::virtualKeyCancel method. +If the key press is interrupted before the key release event, the keyboard invokes +the QVirtualKeyboardInputEngine::virtualKeyCancel method. + +\section2 Input Method + +The input method is a concrete implementation of the keypress handler. It's main +function is to handle keypress events and maintain state information for the +user input. It interacts with the text editor through \l QVirtualKeyboardInputContext via +pre-edit text or key events. + +The input method instance can be created in various ways, depending on the use +case: + +\list + \li \c {KeyboardLayout::inputMethod}: the keyboard layout can create an input method + instance solely for this keyboard layout. It should be noted that this + instance will be destroyed when the keyboard layout changes. Therefore, + this method is usually limited to very narrow use cases. + \li \c {KeyboardLayout::createInputMethod()}: the keyboard layout can dynamically + create an input method that can be used with this layout and also with the + \l {KeyboardLayout::sharedLayouts} {shared layouts} (e.g. symbol layout). + This is the preferred way for creating specialized input methods, such as + those involving complex languages or handwriting. + \li \c {DefaultInputMethod}: the virtual keyboard attempts to create this type of + input method at startup. This instance will be used as the default input + method across all keyboard layouts, unless the keyboard layout uses a + custom input method. This instance outlives keyboard layout changes across + languages and is the preferred way of creating and overriding the default + input method. +\endlist -\section2 Activating an Input Method +\section1 Virtual Keyboard Extension Plugin -Activating an input method is straightforward. The required steps are: +An extension plugin allows third-party providers to enhance the functionality +of the virtual keyboard without recompiling it. Currently the extension plugin +can provide keyboard layouts and custom input methods. Creating a plugin for +Qt Virtual Keyboard is similar to the standard way of creating a Qt plugin: \list - \li Instantiate a concrete implementation of InputMethod - \li Assign the instance to InputEngine::inputMethod - \li Set the proper input mode with InputEngine::inputMode + \li \b {Link against the virtualkeyboard library}. + + The virtualkeyboard module must be linked against the plugin: + + \badcode + QT += virtualkeyboard + \endcode + + This allows the plugin to access \l QVirtualKeyboardInputContext and other interfaces. + \li \b {Implement a subclass of QVirtualKeyboardExtensionPlugin.} + + The plugin provides the virtual keyboard with the necessary metadata, + which allows it to sort and load the plugins. \endlist -When the input method is active, it receives key events from the input engine -and can produce text. +\section2 Adding Keyboard Layouts + +The plugin can add keyboard layouts for the virtual keyboard by including +the layout files in the Qt resources of the plugin binary. + +The virtual keyboard searches for the keyboard layouts (per language) from a specific +path \e /QtQuick/VirtualKeyboard/content/layouts/<language_COUNTRY>, so it is essential +to use this exact path also in the plugin. Qt resource paths can be overlapped, however, +the plugin cannot override the existing layouts in the virtual keyboard plugin. + +If the extension plugin needs to override the built-in keyboard layout, the virtual +keyboard must be recompiled with only specific languages (e.g. \e CONFIG+=lang-en) or without +keyboard layouts at (e.g. \e CONFIG+=disable-layouts). Alternatively, if recompiling is not an +option, it is possible to override the built-in keyboard layouts and have them loaded directly +from the file system by using the \e QT_VIRTUALKEYBOARD_LAYOUT_PATH environment variable. + +\section2 Adding Input Method + +The plugin can register an input method that other keyboard layouts can use by +default (such as \c DefaultInputMethod) or an input method that is used privately +in the plugin. + +The input method must implement \l {QVirtualKeyboardAbstractInputMethod} (C++) or InputMethod (QML) +interface and the plugin must register it as a QML type in +{QVirtualKeyboardExtensionPlugin::registerTypes} method. + +\section2 Metadata for the Extension Plugin + +Metadata allows the virtual keyboard to inspect the plugin before loading +the actual library. It also prevents the virtual keyboard from loading +conflicting extension plugins, for example, two handwriting extensions. + +\table + \row + \li \c Name + \li \c Required + \li This field defines the plugin name. There are several built-in + plugins available by default: + + \list + \li \c hangul + \li \c default (Hunspell) + \li \c handwriting (T9 Write, Lipi-Toolkit) + \li \c japanese (OpenWNN) + \li \c pinyin + \li \c traditional_chinese + \endlist + \row + \li \c Provider + \li \c Optional + \li An informative name of the plugin provider. Used mainly for diagnostics. + \row + \li \c InputMethod + \li \c Optional + \li This field tells the virtual keyboard the plugin contains an input method. + When this field is defined, the virtual keyboard will invoke the + \l {QVirtualKeyboardExtensionPlugin::registerTypes} {interface} + for registering the QML types. + Similar to the \c Name, there can be only one provider for each input method. + \row + \li \c Version + \li \c Required + \li An integer defining the version number of the plugin. If there are two or more + plugins available of the same \c Name, the one with greatest version number is + preferred. +\endtable + +The following metadata example is from the Lipi-Toolkit extension plugin (lipi.json): + +\badcode +{ + "Name": "handwriting", + "Provider": "Qt Lipi-Toolkit Extension", + "InputMethod": "HandwritingInputMethod", + "Version": 100 +} +\endcode \section1 Implementing a Custom Input Method @@ -170,7 +306,7 @@ InputMethod::update() is called when the input context is updated and the input state is possibly out of sync. The input method should commit the current text. -The keystorke events are handled in InputMethod::keyEvent(). This method handles +The keystroke events are handled in InputMethod::keyEvent(). This method handles a single keystroke event and returns \c true if the event was processed. Otherwise the keystroke is handled by the default input method. @@ -191,7 +327,7 @@ list types: \code function selectionLists() { - return [SelectionListModel.WordCandidateList]; + return [SelectionListModel.Type.WordCandidateList]; } \endcode @@ -206,8 +342,8 @@ the input method requires the UI to highlight an item in the list, it will emit the InputMethod::selectionListActiveItemChanged signal. \code -selectionListChanged(SelectionListModel.WordCandidateList) -selectionListActiveItemChanged(SelectionListModel.WordCandidateList, wordIndex) +selectionListChanged(SelectionListModel.Type.WordCandidateList) +selectionListActiveItemChanged(SelectionListModel.Type.WordCandidateList, wordIndex) \endcode \section3 Populating Items in the Selection Lists @@ -220,7 +356,7 @@ items in the list identified by the given type. \code function selectionListItemCount(type) { - if (type == SelectionListModel.WordCandidateList) { + if (type == SelectionListModel.Type.WordCandidateList) { return wordList.length } return 0 @@ -232,9 +368,9 @@ The InputMethod::selectionListData callback requests the data for items. \code function selectionListData(type, index, role) { var result = null - if (type == SelectionListModel.WordCandidateList) { + if (type == SelectionListModel.Type.WordCandidateList) { switch (role) { - case SelectionListModel.DisplayRole: + case SelectionListModel.Role.Display: result = wordList[index] break default: @@ -246,7 +382,7 @@ function selectionListData(type, index, role) { \endcode The \a role parameter identifies which data is requested for an item. For -example, the SelectionListModel.DisplayRole requests the display text data. +example, the SelectionListModel.Role.Display requests the display text data. \section3 Responding to User Actions @@ -255,74 +391,68 @@ event in the InputMethod::selectionListItemSelected method callback. \code function selectionListItemSelected(type, index) { - if (type == SelectionListModel.WordCandidateList) { + if (type == SelectionListModel.Type.WordCandidateList) { inputContext.commit(wordlist[index]) update() } } \endcode -\section1 Integrating Selection Lists into the UI - -The input engine provides a list model for each selection list type. -The model is null while the list is not allocated, allowing the UI -to hide the list if necessary. - -The list model's word candidate list is provided by the -InputEngine::wordCandidateListModel property. - \section1 Integrating Handwriting Recognition Since version 2.0 of the virtual keyboard, input methods can consume -touch input data from touch screens or other input devices. - -Handwriting recognition works on the same principle as handling of -normal keyboard input, i.e. input data is collected by the keyboard layout -and transferred by the input engine to the input method for further processing. - -In case of a regular keyboard, the amount of data transferred from the keyboard -to input method is minimal (namely the keycode and text), but in the case of -handwriting recognition the data volume is much bigger. Therefore, the touch -input is stored in a particular data model. - -The input method does not participate in the actual collection of touch data. -However, the input method has full control over touch input since it can -either accept or reject touch. This allows for precise control over how many -fingers can be used simultaneously. - -The input method can collect as many traces as it deems necessary and begin -processing them at will. The processing can even be performed in parallel with -the touch input, although it is not recommended because of the potential side -effects. A recommended way is to start processing in a background thread -after a suitable delay, so that it does not negatively affect the performance -of the user interface. - -\section2 Data Model for the Handwriting Input - -The data collected from the input source is stored in an object named QtVirtualKeyboard::Trace (C++) or \l Trace (QML). - -By definition, \e trace is a set of data collected in one touch. In addition to -the basic coordinate data, it can also include other types of data, such as -the time of each data point. The input method can define the desired input channels -at the beginning of a touch event. +touch input data from touch screens or other input devices. This allows +integration of a handwriting recognition engine seamlessly to the virtual +keyboard, without any changes to the existing keyboard layouts (as +the virtual keyboard already provides the handwriting keyboard layouts for +most languages). + +Towards an input method, handwriting recognition works on the same principle +as handling of normal keyboard input, i.e. input data is collected by the +keyboard layout and transferred by the input engine to the input method for +processing. + +\section2 Data Model for Handwriting Input + +Virtual keyboard collects the handwriting data in a special data model QVirtualKeyboardTrace. +Each trace represents a collection of data sampled from one touch (e.g. +a swipe on the screen). There will be as many instances of QVirtualKeyboardTrace as there are +touches on the handwriting input area. + +By definition, \e trace is a set of data sampled from one touch. In addition to +the basic point data, it can also include other types of data, such as +the time of each point. The input method can define the desired input channels +in the beginning of a trace event. + +The input method does not participate in the actual collection of trace data. +However, the input method has full control over the input since it can +either accept or reject a QVirtualKeyboardTrace (e.g. if there are too many instances to handle). +This also allows for precise control over how many fingers can be used simultaneously. + +The input method can collect as many traces as it sees fit and it can begin +processing them when necessary. The processing can even be performed in parallel while +sampling the data, although it is not recommended because of the potential performance +issues. The recommended way is to start processing in a background thread +after a suitable delay from the last input, so that the processing does not affect +negatively to the user interface. \section2 Trace API for Input Methods The trace API consists of the following virtual methods, which the input method -must implement in order to receive and process touch input data. +must implement in order to receive and process trace input data. \list - \li \l { QtVirtualKeyboard::AbstractInputMethod::patternRecognitionModes } { patternRecognitionModes } - \li \l { QtVirtualKeyboard::AbstractInputMethod::traceBegin } { traceBegin } - \li \l { QtVirtualKeyboard::AbstractInputMethod::traceEnd } { traceEnd } + \li \l { QVirtualKeyboardAbstractInputMethod::patternRecognitionModes } { patternRecognitionModes } + \li \l { QVirtualKeyboardAbstractInputMethod::traceBegin } { traceBegin } + \li \l { QVirtualKeyboardAbstractInputMethod::traceEnd } { traceEnd } \endlist By implementing these methods, the input method can receive and process data -from a variety of input sources. +from a variety of input sources (e.g. keyboard layout or full screen). The patternRecognitionModes method returns a list of pattern recognition modes, which are supported by the input method. A pattern recognition mode, such as -\l { QtVirtualKeyboard::InputEngine::HandwritingRecoginition } { HandwritingRecoginition }, +\l { QVirtualKeyboardInputEngine::PatternRecognitionMode::Handwriting } { HandwritingRecognition }, defines the method by which the input method processes the data. The trace interaction is started when an input source detects a new contact point, and diff --git a/src/virtualkeyboard/doc/src/user-guide.qdoc b/src/virtualkeyboard/doc/src/user-guide.qdoc index b784178b..0a5e8235 100644 --- a/src/virtualkeyboard/doc/src/user-guide.qdoc +++ b/src/virtualkeyboard/doc/src/user-guide.qdoc @@ -65,30 +65,37 @@ The handwriting mode can be activated by pressing the handwriting key: \li Gesture \li Lipi Toolkit \li T9 Write + \li MyScript Text SDK \row \li Backspace \li \image gesture-single-left.png \li \image gesture-single-left.png + \li \image gesture-single-left.png \row \li Space \li \image gesture-single-right.png \li \image gesture-single-right.png + \li \image gesture-single-left.png \row \li Enter \li Gesture not available \li \image gesture-single-down-left.png + \li \image gesture-single-down-left.png \row \li Reset word \li \image gesture-double-left.png \li Gesture not available + \li Gesture not available \row \li Toggle input mode \li \image gesture-single-up.png \li Gesture not available + \li Gesture not available \row \li Toggle text case \li \image gesture-double-up.png \li Gesture not available + \li Gesture not available \endtable */ |