1 | // Copyright (C) 2017 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #include "qwaylandkeymap.h" |
5 | #include "qwaylandkeymap_p.h" |
6 | |
7 | QT_BEGIN_NAMESPACE |
8 | |
9 | QWaylandKeymap::QWaylandKeymap(const QString &layout, const QString &variant, const QString &options, const QString &model, const QString &rules, QObject *parent) |
10 | : QObject(*new QWaylandKeymapPrivate(layout, variant, options, model, rules), parent) |
11 | { |
12 | } |
13 | |
14 | QString QWaylandKeymap::layout() const { |
15 | Q_D(const QWaylandKeymap); |
16 | return d->m_layout; |
17 | } |
18 | |
19 | void QWaylandKeymap::setLayout(const QString &layout) |
20 | { |
21 | Q_D(QWaylandKeymap); |
22 | if (d->m_layout == layout) |
23 | return; |
24 | d->m_layout = layout; |
25 | emit layoutChanged(); |
26 | } |
27 | |
28 | QString QWaylandKeymap::variant() const |
29 | { |
30 | Q_D(const QWaylandKeymap); |
31 | return d->m_variant; |
32 | } |
33 | |
34 | void QWaylandKeymap::setVariant(const QString &variant) |
35 | { |
36 | Q_D(QWaylandKeymap); |
37 | if (d->m_variant == variant) |
38 | return; |
39 | d->m_variant = variant; |
40 | emit variantChanged(); |
41 | } |
42 | |
43 | QString QWaylandKeymap::options() const { |
44 | Q_D(const QWaylandKeymap); |
45 | return d->m_options; |
46 | } |
47 | |
48 | void QWaylandKeymap::setOptions(const QString &options) |
49 | { |
50 | Q_D(QWaylandKeymap); |
51 | if (d->m_options == options) |
52 | return; |
53 | d->m_options = options; |
54 | emit optionsChanged(); |
55 | } |
56 | |
57 | QString QWaylandKeymap::rules() const { |
58 | Q_D(const QWaylandKeymap); |
59 | return d->m_rules; |
60 | } |
61 | |
62 | void QWaylandKeymap::setRules(const QString &rules) |
63 | { |
64 | Q_D(QWaylandKeymap); |
65 | if (d->m_rules == rules) |
66 | return; |
67 | d->m_rules = rules; |
68 | emit rulesChanged(); |
69 | } |
70 | |
71 | QString QWaylandKeymap::model() const { |
72 | Q_D(const QWaylandKeymap); |
73 | return d->m_model; |
74 | } |
75 | |
76 | void QWaylandKeymap::setModel(const QString &model) |
77 | { |
78 | Q_D(QWaylandKeymap); |
79 | if (d->m_model == model) |
80 | return; |
81 | d->m_model = model; |
82 | emit modelChanged(); |
83 | } |
84 | |
85 | QWaylandKeymapPrivate::QWaylandKeymapPrivate(const QString &layout, const QString &variant, |
86 | const QString &options, const QString &model, |
87 | const QString &rules) |
88 | : m_layout(layout) |
89 | , m_variant(variant) |
90 | , m_options(options) |
91 | , m_rules(rules) |
92 | , m_model(model) |
93 | { |
94 | } |
95 | |
96 | QT_END_NAMESPACE |
97 | |
98 | #include "moc_qwaylandkeymap.cpp" |
99 | |