1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include <QtVirtualKeyboard/qvirtualkeyboarddictionary.h>
5
6/*!
7 \class QVirtualKeyboardDictionary
8
9 \inmodule QtVirtualKeyboard
10 \ingroup qtvirtualkeyboard-cpp-for-apps
11
12 \brief An application-defined dictionary for virtual keyboard input methods.
13
14 This class defines a named dictionary that consists of words or phrases. The
15 dictionary can be enabled in the desired context and its usage depends on
16 the current input method of the virtual keyboard.
17*/
18
19QVirtualKeyboardDictionary::QVirtualKeyboardDictionary(const QString &name, QObject *parent) :
20 QObject(parent),
21 _name(name)
22{
23
24}
25
26QString QVirtualKeyboardDictionary::name() const
27{
28 return _name;
29}
30
31QStringList QVirtualKeyboardDictionary::contents() const
32{
33 return _wordList;
34}
35
36void QVirtualKeyboardDictionary::setContents(const QStringList &wordList)
37{
38 if (_wordList != wordList) {
39 _wordList = wordList;
40 emit contentsChanged();
41 }
42}
43
44/*!
45 \property QVirtualKeyboardDictionary::name
46 \brief name of the dictionary.
47
48 This property holds the name of the dictionary that was specified when
49 the dictionary was created. The name is necessary when referring to a
50 specific dictionary (for example when you activate it in the input context).
51
52 \note The dictionary name cannot be changed later.
53*/
54
55/*!
56 \property QVirtualKeyboardDictionary::contents
57 \brief contents of the dictionary.
58
59 This property holds the contents of the dictionary. Typically, the content
60 consists of words or phrases. Note that the dictionary is language neutral,
61 meaning it is the application's responsibility to localize the dictionary if
62 it contains language-dependent data.
63
64 The content can be set at any time, although it makes sense to set it when
65 the input method is not active.
66*/
67
68QT_BEGIN_NAMESPACE
69
70QT_END_NAMESPACE
71

source code of qtvirtualkeyboard/src/virtualkeyboard/qvirtualkeyboarddictionary.cpp