// SPDX-FileCopyrightText: 2021 Alexey Andreyev // // SPDX-License-Identifier: LicenseRef-KDE-Accepted-GPL #pragma once #include "modem-controller.h" #include #include #include #include #include #include #include #include #include "call-object.h" class ModemManagerController : public ModemController { Q_OBJECT public: explicit ModemManagerController(QObject *parent = nullptr); QString subsystem(); public Q_SLOTS: // Device QString equipmentIdentifier(const QString &deviceUni) override; // USSD void ussdInitiate(const QString &deviceUni, const QString &command) override; void ussdRespond(const QString &deviceUni, const QString &reply) override; void ussdCancel(const QString &deviceUni) override; // Calls QString callNumber(const QString &deviceUni, const QString &callUni) override; void createCall(const QString &deviceUni, const QString &callUni) override; void acceptCall(const QString &deviceUni, const QString &callUni) override; void hangUp(const QString &deviceUni, const QString &callUni) override; void sendDtmf(const QString &deviceUni, const QString &callUni, const QString &tones) override; DialerTypes::CallDataVector fetchCalls() override; DialerTypes::CallData getCall(const QString &deviceUni, const QString &callUni) override; void deleteCall(const QString &deviceUni, const QString &callUni) override; private Q_SLOTS: void onServiceAppeared(); void onServiceDisappeared(); void onModemAdded(const QString &udi); void onModemRemoved(const QString &udi); private: void init(); QVector m_calls; void removeCall(const QString &callId); QSharedPointer modem3gppInterface(const QSharedPointer modemDevice); QSharedPointer modem3gppUssdInterface(const QSharedPointer modemDevice); QSharedPointer voiceInterface(const QSharedPointer modemDevice); CallObject * voiceCallObject(const QSharedPointer &device, const QSharedPointer &call, QObject *parent = nullptr); DialerTypes::CallData voiceCallData(CallObject *callObject); void fetchModemCalls(); CallObject *getVoiceCallObject(const QString &deviceUni, const QString &callUni); void initAddedCall(const QSharedPointer &device, const QSharedPointer &call); };