kwin/src/virtualkeyboard_dbus.h
Aleix Pol 006ee8b87a inputmethod: Allow forcing the display of the input method
This makes it possible to show the input method when using a client that
doesn't support Wayland input methods (e.g. Xwayland).

This adds 2 dbus API entry points:
- activeClientSupported property: That tells us if the current client
doesn't support text-input-v*
- forceActivate method: forces the activation of the input method. This
configures the input method in a state that we can use to forward the
input method's keystrokes to the client, emulating a hardware keyboard.

BUG: 4399911
2022-09-08 23:30:16 +02:00

52 lines
1.5 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "inputmethod.h"
#include <QObject>
namespace KWin
{
class KWIN_EXPORT VirtualKeyboardDBus : public QObject
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.VirtualKeyboard")
Q_PROPERTY(bool available READ isAvailable NOTIFY availableChanged)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
Q_PROPERTY(bool visible READ isVisible NOTIFY visibleChanged)
Q_PROPERTY(bool activeClientSupportsTextInput READ activeClientSupportsTextInput NOTIFY activeClientSupportsTextInputChanged)
public:
explicit VirtualKeyboardDBus(InputMethod *inputMethod);
~VirtualKeyboardDBus() override;
bool isEnabled() const;
bool activeClientSupportsTextInput() const;
bool isVisible() const;
bool isActive() const;
bool isAvailable() const;
void setEnabled(bool enabled);
void setActive(bool active);
Q_SCRIPTABLE bool willShowOnActive() const;
Q_SCRIPTABLE void forceActivate();
Q_SIGNALS:
Q_SCRIPTABLE void enabledChanged();
Q_SCRIPTABLE void activeChanged();
Q_SCRIPTABLE void visibleChanged();
Q_SCRIPTABLE void availableChanged();
Q_SCRIPTABLE void activeClientSupportsTextInputChanged();
private:
InputMethod *const m_inputMethod;
};
}