1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QVIRTUALKEYBOARDDICTIONARY_H
5#define QVIRTUALKEYBOARDDICTIONARY_H
6
7#include <QtVirtualKeyboard/qvirtualkeyboard_global.h>
8#include <QtCore/QStringList>
9#include <QtCore/QObject>
10
11QT_BEGIN_NAMESPACE
12
13class Q_VIRTUALKEYBOARD_EXPORT QVirtualKeyboardDictionary : public QObject
14{
15 Q_OBJECT
16 Q_PROPERTY(QString name READ name CONSTANT)
17 Q_PROPERTY(QStringList contents READ contents WRITE setContents NOTIFY contentsChanged RESET resetContents)
18
19 explicit QVirtualKeyboardDictionary(const QString &name, QObject *parent = nullptr);
20 friend class QVirtualKeyboardDictionaryManager;
21
22public:
23 QString name() const;
24
25 QStringList contents() const;
26 void setContents(const QStringList &contents);
27 void resetContents() { setContents({}); }
28
29Q_SIGNALS:
30 void contentsChanged();
31
32private:
33 const QString _name;
34 QStringList _wordList;
35};
36
37QT_END_NAMESPACE
38
39#endif // QVIRTUALKEYBOARDDICTIONARY_H
40

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