2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2017-10-06 19:22:50 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
|
2017-10-06 19:22:50 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2017-10-06 19:22:50 +00:00
|
|
|
#include "virtualkeyboard_dbus.h"
|
|
|
|
#include <QDBusConnection>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2021-02-26 15:16:45 +00:00
|
|
|
VirtualKeyboardDBus::VirtualKeyboardDBus(InputMethod *parent)
|
2017-10-06 19:22:50 +00:00
|
|
|
: QObject(parent)
|
2021-02-26 15:16:45 +00:00
|
|
|
, m_inputMethod(parent)
|
2017-10-06 19:22:50 +00:00
|
|
|
{
|
|
|
|
QDBusConnection::sessionBus().registerObject(QStringLiteral("/VirtualKeyboard"), this,
|
2021-02-23 15:12:38 +00:00
|
|
|
QDBusConnection::ExportAllProperties |
|
|
|
|
QDBusConnection::ExportScriptableSignals | //qdbuscpp2xml doesn't support yet properties with NOTIFY
|
2017-10-06 19:22:50 +00:00
|
|
|
QDBusConnection::ExportAllSlots);
|
2021-02-26 15:16:45 +00:00
|
|
|
connect(parent, &InputMethod::activeChanged, this, &VirtualKeyboardDBus::activeChanged);
|
|
|
|
connect(parent, &InputMethod::enabledChanged, this, &VirtualKeyboardDBus::enabledChanged);
|
2017-10-06 19:22:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VirtualKeyboardDBus::~VirtualKeyboardDBus() = default;
|
|
|
|
|
2021-02-23 15:12:38 +00:00
|
|
|
bool VirtualKeyboardDBus::isActive() const
|
|
|
|
{
|
2021-02-26 15:16:45 +00:00
|
|
|
return m_inputMethod->isActive();
|
2021-02-23 15:12:38 +00:00
|
|
|
}
|
|
|
|
|
2021-02-26 15:16:45 +00:00
|
|
|
void VirtualKeyboardDBus::setEnabled(bool enabled)
|
2021-02-23 15:12:38 +00:00
|
|
|
{
|
2021-02-26 15:16:45 +00:00
|
|
|
m_inputMethod->setEnabled(enabled);
|
2021-02-23 15:12:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void VirtualKeyboardDBus::setActive(bool active)
|
|
|
|
{
|
2021-02-26 15:16:45 +00:00
|
|
|
m_inputMethod->setActive(active);
|
2021-02-23 15:12:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool VirtualKeyboardDBus::isEnabled() const
|
|
|
|
{
|
2021-02-26 15:16:45 +00:00
|
|
|
return m_inputMethod->isEnabled();
|
2021-02-23 15:12:38 +00:00
|
|
|
}
|
|
|
|
|
2017-10-06 19:22:50 +00:00
|
|
|
}
|