1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QVIRTUALKEYBOARDDICTIONARYMANAGER_H
5#define QVIRTUALKEYBOARDDICTIONARYMANAGER_H
6
7#include <QtVirtualKeyboard/qvirtualkeyboard_global.h>
8#include <QtCore/QStringList>
9#include <QtCore/QObject>
10
11QT_BEGIN_NAMESPACE
12
13class QVirtualKeyboardDictionary;
14class QVirtualKeyboardDictionaryManagerPrivate;
15
16class Q_VIRTUALKEYBOARD_EXPORT QVirtualKeyboardDictionaryManager : public QObject
17{
18 Q_OBJECT
19 Q_DISABLE_COPY(QVirtualKeyboardDictionaryManager)
20 Q_DECLARE_PRIVATE(QVirtualKeyboardDictionaryManager)
21 Q_PROPERTY(QStringList availableDictionaries READ availableDictionaries NOTIFY availableDictionariesChanged)
22 Q_PROPERTY(QStringList baseDictionaries READ baseDictionaries WRITE setBaseDictionaries NOTIFY baseDictionariesChanged)
23 Q_PROPERTY(QStringList extraDictionaries READ extraDictionaries WRITE setExtraDictionaries NOTIFY extraDictionariesChanged)
24 Q_PROPERTY(QStringList activeDictionaries READ activeDictionaries NOTIFY activeDictionariesChanged)
25
26 explicit QVirtualKeyboardDictionaryManager(QObject *parent = nullptr);
27 friend struct QVirtualKeyboardDictionaryManagerSingleton;
28
29public:
30 static QVirtualKeyboardDictionaryManager *instance();
31
32 QStringList availableDictionaries() const;
33
34 QStringList baseDictionaries() const;
35 void setBaseDictionaries(const QStringList &baseDictionaries);
36
37 QStringList extraDictionaries() const;
38 void setExtraDictionaries(const QStringList &extraDictionaries);
39
40 QStringList activeDictionaries() const;
41
42 QVirtualKeyboardDictionary *createDictionary(const QString &name);
43 QVirtualKeyboardDictionary *dictionary(const QString &name) const;
44
45Q_SIGNALS:
46 void availableDictionariesChanged();
47 void baseDictionariesChanged();
48 void extraDictionariesChanged();
49 void activeDictionariesChanged();
50};
51
52QT_END_NAMESPACE
53
54#endif // QVIRTUALKEYBOARDDICTIONARYMANAGER_H
55

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