// SPDX-FileCopyrightText: 2021 Nicolas Fella // // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL #pragma once #include #include #include #include #include #include #include class ModemController : public QObject { Q_OBJECT public: static ModemController &instance(); void init(std::optional modemPath); std::optional> createMessage(ModemManager::ModemMessaging::Message m); void deleteMessage(const QString &uni); ModemManager::Sms::List messages(); QString ownNumber(); QString ifaceName; QString dnsServers; QString countryCode; Q_SIGNALS: void messageAdded(ModemManager::Sms::Ptr message); void modemConnected(); void modemDataConnectedChanged(const bool isConnected); void countryCodeChanged(const QString &code); private Q_SLOTS: void slotMessageAdded(const QString &uni, bool received); private: void initMessaging(); ModemController(); ModemManager::ModemDevice::Ptr m_modem; ModemManager::ModemMessaging::Ptr m_msgManager; ModemManager::Modem::Ptr m_interface; ModemManager::Bearer::Ptr m_bearer; ModemManager::Modem3gpp::Ptr m_modem3gpp; QString getDNS(QSharedPointer bearer); };