1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef VIRTUALKEYBOARDSETTINGS_H
5#define VIRTUALKEYBOARDSETTINGS_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtVirtualKeyboard/private/qvirtualkeyboardnamespace_p.h>
19#include <QtQml/qqml.h>
20#include <QtCore/private/qglobal_p.h>
21
22QT_BEGIN_NAMESPACE
23namespace QtVirtualKeyboard {
24
25class QQuickWordCandidateListSettings;
26class QQuickVirtualKeyboardSettingsPrivate;
27
28class QQuickVirtualKeyboardSettings : public QObject
29{
30 Q_OBJECT
31 Q_DECLARE_PRIVATE(QQuickVirtualKeyboardSettings)
32 Q_PROPERTY(QUrl style READ style NOTIFY styleChanged)
33 Q_PROPERTY(QUrl layoutPath READ layoutPath WRITE setLayoutPath NOTIFY layoutPathChanged)
34 Q_PROPERTY(QString styleName READ styleName WRITE setStyleName NOTIFY styleNameChanged)
35 Q_PROPERTY(QString locale READ locale WRITE setLocale NOTIFY localeChanged)
36 Q_PROPERTY(QStringList availableLocales READ availableLocales NOTIFY availableLocalesChanged)
37 Q_PROPERTY(QStringList activeLocales READ activeLocales WRITE setActiveLocales NOTIFY activeLocalesChanged)
38 Q_PROPERTY(QQuickWordCandidateListSettings *wordCandidateList READ wordCandidateList CONSTANT)
39 Q_PROPERTY(bool fullScreenMode READ fullScreenMode WRITE setFullScreenMode NOTIFY fullScreenModeChanged)
40 Q_PROPERTY(QString userDataPath READ userDataPath WRITE setUserDataPath NOTIFY userDataPathChanged REVISION(6, 1))
41 Q_PROPERTY(int hwrTimeoutForAlphabetic READ hwrTimeoutForAlphabetic WRITE setHwrTimeoutForAlphabetic NOTIFY hwrTimeoutForAlphabeticChanged REVISION(6, 1))
42 Q_PROPERTY(int hwrTimeoutForCjk READ hwrTimeoutForCjk WRITE setHwrTimeoutForCjk NOTIFY hwrTimeoutForCjkChanged REVISION(6, 1))
43 Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints NOTIFY inputMethodHintsChanged REVISION(6, 1))
44 Q_PROPERTY(bool handwritingModeDisabled READ isHandwritingModeDisabled WRITE setHandwritingModeDisabled NOTIFY handwritingModeDisabledChanged REVISION(6, 1))
45 Q_PROPERTY(bool defaultInputMethodDisabled READ isDefaultInputMethodDisabled WRITE setDefaultInputMethodDisabled NOTIFY defaultInputMethodDisabledChanged REVISION(6, 1))
46 Q_PROPERTY(bool defaultDictionaryDisabled READ isDefaultDictionaryDisabled WRITE setDefaultDictionaryDisabled NOTIFY defaultDictionaryDisabledChanged REVISION(6, 1))
47 Q_PROPERTY(QtVirtualKeyboard::KeyboardFunctionKeys visibleFunctionKeys READ visibleFunctionKeys WRITE setVisibleFunctionKeys NOTIFY visibleFunctionKeysChanged REVISION(6, 6))
48 Q_PROPERTY(bool closeOnReturn READ closeOnReturn WRITE setCloseOnReturn NOTIFY closeOnReturnChanged REVISION(6, 8))
49 QML_NAMED_ELEMENT(VirtualKeyboardSettings)
50 QML_SINGLETON
51 QML_ADDED_IN_VERSION(1, 0)
52 QML_EXTRA_VERSION(2, 0)
53
54 explicit QQuickVirtualKeyboardSettings(QQmlEngine *engine, QObject *parent = nullptr);
55
56public:
57 static QQuickVirtualKeyboardSettings *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine);
58 QString style() const;
59
60 QUrl layoutPath() const;
61 void setLayoutPath(const QUrl &layoutPath);
62
63 QString styleName() const;
64 void setStyleName(const QString &styleName);
65
66 QString locale() const;
67 void setLocale(const QString &locale);
68
69 QStringList availableLocales() const;
70
71 void setActiveLocales(const QStringList &activeLocales);
72 QStringList activeLocales() const;
73
74 QQuickWordCandidateListSettings *wordCandidateList() const;
75
76 bool fullScreenMode() const;
77 void setFullScreenMode(bool fullScreenMode);
78
79 QString userDataPath() const;
80 void setUserDataPath(const QString &userDataPath);
81
82 int hwrTimeoutForAlphabetic() const;
83 void setHwrTimeoutForAlphabetic(int hwrTimeoutForAlphabetic);
84
85 int hwrTimeoutForCjk() const;
86 void setHwrTimeoutForCjk(int hwrTimeoutForCjk);
87
88 Qt::InputMethodHints inputMethodHints() const;
89 void setInputMethodHints(const Qt::InputMethodHints &inputMethodHints);
90
91 bool isHandwritingModeDisabled() const;
92 void setHandwritingModeDisabled(bool handwritingModeDisabled);
93
94 bool isDefaultInputMethodDisabled() const;
95 void setDefaultInputMethodDisabled(bool defaultInputMethodDisabled);
96
97 bool isDefaultDictionaryDisabled() const;
98 void setDefaultDictionaryDisabled(bool defaultDictionaryDisabled);
99
100 QtVirtualKeyboard::KeyboardFunctionKeys visibleFunctionKeys() const;
101 void setVisibleFunctionKeys(QtVirtualKeyboard::KeyboardFunctionKeys newVisibleFunctionKeys);
102
103 bool closeOnReturn() const;
104 void setCloseOnReturn(bool enable);
105
106signals:
107 void styleChanged();
108 void styleNameChanged();
109 void localeChanged();
110 void availableLocalesChanged();
111 void activeLocalesChanged();
112 void layoutPathChanged();
113 void fullScreenModeChanged();
114 Q_REVISION(6, 1) void userDataPathChanged();
115 Q_REVISION(6, 1) void userDataReset();
116 Q_REVISION(6, 1) void hwrTimeoutForAlphabeticChanged();
117 Q_REVISION(6, 1) void hwrTimeoutForCjkChanged();
118 Q_REVISION(6, 1) void inputMethodHintsChanged();
119 Q_REVISION(6, 1) void handwritingModeDisabledChanged();
120 Q_REVISION(6, 1) void defaultInputMethodDisabledChanged();
121 Q_REVISION(6, 1) void defaultDictionaryDisabledChanged();
122 Q_REVISION(6, 6) void visibleFunctionKeysChanged();
123 Q_REVISION(6, 8) void closeOnReturnChanged();
124
125private:
126 void resetStyle();
127 void resetLayoutPath();
128};
129
130class QQuickWordCandidateListSettings : public QObject
131{
132 Q_OBJECT
133 Q_PROPERTY(int autoHideDelay READ autoHideDelay WRITE setAutoHideDelay NOTIFY autoHideDelayChanged)
134 Q_PROPERTY(bool alwaysVisible READ alwaysVisible WRITE setAlwaysVisible NOTIFY alwaysVisibleChanged)
135 Q_PROPERTY(bool autoCommitWord READ autoCommitWord WRITE setAutoCommitWord NOTIFY autoCommitWordChanged)
136 QML_ANONYMOUS
137
138 explicit QQuickWordCandidateListSettings(QObject *parent = nullptr);
139 friend class QQuickVirtualKeyboardSettingsPrivate;
140
141public:
142 int autoHideDelay() const;
143 void setAutoHideDelay(int autoHideDelay);
144
145 bool alwaysVisible() const;
146 void setAlwaysVisible(bool alwaysVisible);
147
148 bool autoCommitWord() const;
149 void setAutoCommitWord(bool autoCommitWord);
150
151signals:
152 void autoHideDelayChanged();
153 void alwaysVisibleChanged();
154 void autoCommitWordChanged();
155};
156
157} // namespace QtVirtualKeyboard
158QT_END_NAMESPACE
159
160#endif // VIRTUALKEYBOARDSETTINGS_H
161

Provided by KDAB

Privacy Policy
Learn Advanced QML with KDAB
Find out more

source code of qtvirtualkeyboard/src/settings/qquickvirtualkeyboardsettings_p.h