File indexing completed on 2024-04-28 15:32:56

0001 /*
0002     SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
0003     SPDX-FileCopyrightText: 2010 Lamarque Souza <lamarque@kde.org>
0004     SPDX-FileCopyrightText: 2013 Daniel Nicoletti <dantti12@gmail.com>
0005     SPDX-FileCopyrightText: 2013 Lukas Tinkl <ltinkl@redhat.com>
0006     SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
0007 
0008     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0009 */
0010 
0011 #ifndef MODEMMANAGERQT_MANAGER_H
0012 #define MODEMMANAGERQT_MANAGER_H
0013 
0014 #include <modemmanagerqt_export.h>
0015 
0016 #include <QDBusObjectPath>
0017 #include <QObject>
0018 #include <QSharedPointer>
0019 
0020 #include "modemdevice.h"
0021 
0022 /**
0023  * This namespace allows to query the underlying system to discover the available
0024  * modem interfaces
0025  * responsibility to notify when a modem interface or a modem appears or disappears.
0026  *
0027  * Note that it's implemented as a singleton and encapsulates the backend logic.
0028  */
0029 namespace ModemManager
0030 {
0031 class Modem;
0032 
0033 class MODEMMANAGERQT_EXPORT Notifier : public QObject
0034 {
0035     Q_OBJECT
0036 Q_SIGNALS:
0037     /**
0038      * This signal is emitted when a new modem interface is available.
0039      *
0040      * @param udi the network interface identifier
0041      */
0042     void modemAdded(const QString &udi);
0043     /**
0044      * This signal is emitted when a network interface is not available anymore.
0045      *
0046      * @param udi the network interface identifier
0047      */
0048     void modemRemoved(const QString &udi);
0049 
0050     /**
0051      * This signal is emitted when the ModemManager DBus service goes away
0052      */
0053     void serviceDisappeared();
0054     /**
0055      * This signal is emitted when the ModemManager DBus service appears
0056      */
0057     void serviceAppeared();
0058 };
0059 
0060 /**
0061  * Retrieves the list of all modem interfaces Unique Device Identifiers (UDIs)
0062  * in the system. This method is the equivalent of enumerateDevices described
0063  * in Modem Manager specification.
0064  *
0065  * Note: only HW modems are returned (Gsm or Cdma)
0066  *
0067  * @return the list of modem interfaces available in this system
0068  */
0069 MODEMMANAGERQT_EXPORT ModemDevice::List modemDevices();
0070 
0071 /**
0072  * Find a new ModemManagerInterface object given its UDI.
0073  *
0074  * Note: only Modem-inherited objects are returned (not SMS, SIM or Bearer objects)
0075  *
0076  * @param uni the identifier of the modem interface to find
0077  * @returns a valid Modem object if there's a device having the given UDI, an invalid one otherwise
0078  */
0079 MODEMMANAGERQT_EXPORT ModemDevice::Ptr findModemDevice(const QString &uni);
0080 
0081 /**
0082  * Start a new scan for connected modem devices.
0083  */
0084 MODEMMANAGERQT_EXPORT void scanDevices();
0085 
0086 MODEMMANAGERQT_EXPORT Notifier *notifier();
0087 }
0088 
0089 #endif