1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2017 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the QtWaylandCompositor module of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:GPL$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU |
19 | ** General Public License version 3 or (at your option) any later version |
20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by |
21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 |
22 | ** included in the packaging of this file. Please review the following |
23 | ** information to ensure the GNU General Public License requirements will |
24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
25 | ** |
26 | ** $QT_END_LICENSE$ |
27 | ** |
28 | ****************************************************************************/ |
29 | |
30 | #include "qwaylandkeymap.h" |
31 | #include "qwaylandkeymap_p.h" |
32 | |
33 | QT_BEGIN_NAMESPACE |
34 | |
35 | QWaylandKeymap::QWaylandKeymap(const QString &layout, const QString &variant, const QString &options, const QString &model, const QString &rules, QObject *parent) |
36 | : QObject(*new QWaylandKeymapPrivate(layout, variant, options, model, rules), parent) |
37 | { |
38 | } |
39 | |
40 | QString QWaylandKeymap::layout() const { |
41 | Q_D(const QWaylandKeymap); |
42 | return d->m_layout; |
43 | } |
44 | |
45 | void QWaylandKeymap::setLayout(const QString &layout) |
46 | { |
47 | Q_D(QWaylandKeymap); |
48 | if (d->m_layout == layout) |
49 | return; |
50 | d->m_layout = layout; |
51 | emit layoutChanged(); |
52 | } |
53 | |
54 | QString QWaylandKeymap::variant() const |
55 | { |
56 | Q_D(const QWaylandKeymap); |
57 | return d->m_variant; |
58 | } |
59 | |
60 | void QWaylandKeymap::setVariant(const QString &variant) |
61 | { |
62 | Q_D(QWaylandKeymap); |
63 | if (d->m_variant == variant) |
64 | return; |
65 | d->m_variant = variant; |
66 | emit variantChanged(); |
67 | } |
68 | |
69 | QString QWaylandKeymap::options() const { |
70 | Q_D(const QWaylandKeymap); |
71 | return d->m_options; |
72 | } |
73 | |
74 | void QWaylandKeymap::setOptions(const QString &options) |
75 | { |
76 | Q_D(QWaylandKeymap); |
77 | if (d->m_options == options) |
78 | return; |
79 | d->m_options = options; |
80 | emit optionsChanged(); |
81 | } |
82 | |
83 | QString QWaylandKeymap::rules() const { |
84 | Q_D(const QWaylandKeymap); |
85 | return d->m_rules; |
86 | } |
87 | |
88 | void QWaylandKeymap::setRules(const QString &rules) |
89 | { |
90 | Q_D(QWaylandKeymap); |
91 | if (d->m_rules == rules) |
92 | return; |
93 | d->m_rules = rules; |
94 | emit rulesChanged(); |
95 | } |
96 | |
97 | QString QWaylandKeymap::model() const { |
98 | Q_D(const QWaylandKeymap); |
99 | return d->m_model; |
100 | } |
101 | |
102 | void QWaylandKeymap::setModel(const QString &model) |
103 | { |
104 | Q_D(QWaylandKeymap); |
105 | if (d->m_model == model) |
106 | return; |
107 | d->m_model = model; |
108 | emit modelChanged(); |
109 | } |
110 | |
111 | QWaylandKeymapPrivate::QWaylandKeymapPrivate(const QString &layout, const QString &variant, |
112 | const QString &options, const QString &model, |
113 | const QString &rules) |
114 | : m_layout(layout) |
115 | , m_variant(variant) |
116 | , m_options(options) |
117 | , m_rules(rules) |
118 | , m_model(model) |
119 | { |
120 | } |
121 | |
122 | QT_END_NAMESPACE |
123 | |