1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QKEYMAPPER_P_H
4#define QKEYMAPPER_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtGui/private/qtguiglobal_p.h>
18#include <qobject.h>
19#include <private/qobject_p.h>
20#include <qlist.h>
21#include <qlocale.h>
22#include <qevent.h>
23
24#include <QtCore/qnativeinterface.h>
25
26QT_BEGIN_NAMESPACE
27
28class QKeyMapperPrivate;
29class Q_GUI_EXPORT QKeyMapper : public QObject
30{
31 Q_OBJECT
32public:
33 explicit QKeyMapper();
34 ~QKeyMapper();
35
36 static QKeyMapper *instance();
37 static void changeKeyboard();
38 static QList<int> possibleKeys(QKeyEvent *e);
39
40 QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QKeyMapper)
41
42private:
43 friend QKeyMapperPrivate *qt_keymapper_private();
44 Q_DECLARE_PRIVATE(QKeyMapper)
45 Q_DISABLE_COPY_MOVE(QKeyMapper)
46};
47
48struct KeyboardLayoutItem;
49class QKeyEvent;
50
51class QKeyMapperPrivate : public QObjectPrivate
52{
53 Q_DECLARE_PUBLIC(QKeyMapper)
54public:
55 QKeyMapperPrivate();
56 ~QKeyMapperPrivate();
57
58 QList<int> possibleKeys(QKeyEvent *e);
59
60 QLocale keyboardInputLocale;
61 Qt::LayoutDirection keyboardInputDirection;
62};
63
64QKeyMapperPrivate *qt_keymapper_private(); // from qkeymapper.cpp
65
66// ----------------- QNativeInterface -----------------
67
68namespace QNativeInterface::Private {
69
70#if QT_CONFIG(evdev) || defined(Q_QDOC)
71struct Q_GUI_EXPORT QEvdevKeyMapper
72{
73 QT_DECLARE_NATIVE_INTERFACE(QEvdevKeyMapper, 1, QKeyMapper)
74 virtual void loadKeymap(const QString &filename) = 0;
75 virtual void switchLang() = 0;
76};
77#endif
78
79} // QNativeInterface::Private
80
81
82QT_END_NAMESPACE
83
84#endif // QKEYMAPPER_P_H
85

source code of qtbase/src/gui/kernel/qkeymapper_p.h