2022-12-28 01:06:22 +00:00
|
|
|
/**
|
|
|
|
* SPDX-FileCopyrightText: 2013 Albert Vaca <albertvaka@gmail.com>
|
|
|
|
* SPDX-FileCopyrightText: 2018 Simon Redman <simon@ergotech.com>
|
|
|
|
* SPDX-FileCopyrightText: 2019 Richard Liebscher <richard.liebscher@gmail.com>
|
|
|
|
* SPDX-FileCopyrightText: 2022 Yoram Bar Haim <bhyoram@protonmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
|
|
*/
|
|
|
|
|
2023-07-21 19:22:59 +01:00
|
|
|
#pragma once
|
2022-12-28 01:06:22 +00:00
|
|
|
|
|
|
|
#include <KPluginFactory>
|
|
|
|
#include <ModemManagerQt/Call>
|
|
|
|
#include <ModemManagerQt/Manager>
|
|
|
|
#include <ModemManagerQt/Modem>
|
|
|
|
#include <ModemManagerQt/ModemVoice>
|
|
|
|
#include <QList>
|
|
|
|
#include <QMap>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSet>
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
|
|
#include <core/kdeconnectplugin.h>
|
|
|
|
|
|
|
|
class QDBusPendingCallWatcher;
|
|
|
|
class QDBusInterface;
|
|
|
|
class QDBusError;
|
|
|
|
class QDBusObjectPath;
|
|
|
|
class QDBusVariant;
|
|
|
|
|
|
|
|
class MMTelephonyPlugin : public KdeConnectPlugin
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.telephony")
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MMTelephonyPlugin(QObject *parent, const QVariantList &args);
|
|
|
|
|
2023-07-31 08:25:45 +01:00
|
|
|
void receivePacket(const NetworkPacket &np) override;
|
2022-12-28 01:06:22 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void onCallAdded(ModemManager::Call::Ptr call);
|
|
|
|
void onCallRemoved(ModemManager::Call::Ptr call);
|
|
|
|
void onModemAdded(const QString &path);
|
2023-07-28 08:11:43 +01:00
|
|
|
void onCallStateChanged(ModemManager::Call *call, MMCallState newState, MMCallState oldState);
|
2022-12-28 01:06:22 +00:00
|
|
|
void sendMMTelephonyPacket(ModemManager::Call *call, const QString &state);
|
|
|
|
void sendCancelMMTelephonyPacket(ModemManager::Call *call, const QString &lastState);
|
|
|
|
static QString stateName(MMCallState state);
|
|
|
|
};
|