File indexing completed on 2024-04-21 03:59:49
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 <QObject> 0017 #include <QSharedPointer> 0018 0019 #include "modemdevice.h" 0020 0021 /** 0022 * This namespace allows to query the underlying system to discover the available 0023 * modem interfaces 0024 * responsibility to notify when a modem interface or a modem appears or disappears. 0025 * 0026 * Note that it's implemented as a singleton and encapsulates the backend logic. 0027 */ 0028 namespace ModemManager 0029 { 0030 class Modem; 0031 0032 class MODEMMANAGERQT_EXPORT Notifier : public QObject 0033 { 0034 Q_OBJECT 0035 Q_SIGNALS: 0036 /** 0037 * This signal is emitted when a new modem interface is available. 0038 * 0039 * @param udi the network interface identifier 0040 */ 0041 void modemAdded(const QString &udi); 0042 /** 0043 * This signal is emitted when a network interface is not available anymore. 0044 * 0045 * @param udi the network interface identifier 0046 */ 0047 void modemRemoved(const QString &udi); 0048 0049 /** 0050 * This signal is emitted when the ModemManager DBus service goes away 0051 */ 0052 void serviceDisappeared(); 0053 /** 0054 * This signal is emitted when the ModemManager DBus service appears 0055 */ 0056 void serviceAppeared(); 0057 }; 0058 0059 /** 0060 * Retrieves the list of all modem interfaces Unique Device Identifiers (UDIs) 0061 * in the system. This method is the equivalent of enumerateDevices described 0062 * in Modem Manager specification. 0063 * 0064 * Note: only HW modems are returned (Gsm or Cdma) 0065 * 0066 * @return the list of modem interfaces available in this system 0067 */ 0068 MODEMMANAGERQT_EXPORT ModemDevice::List modemDevices(); 0069 0070 /** 0071 * Find a new ModemManagerInterface object given its UDI. 0072 * 0073 * Note: only Modem-inherited objects are returned (not SMS, SIM or Bearer objects) 0074 * 0075 * @param uni the identifier of the modem interface to find 0076 * @returns a valid Modem object if there's a device having the given UDI, an invalid one otherwise 0077 */ 0078 MODEMMANAGERQT_EXPORT ModemDevice::Ptr findModemDevice(const QString &uni); 0079 0080 /** 0081 * Start a new scan for connected modem devices. 0082 */ 0083 MODEMMANAGERQT_EXPORT void scanDevices(); 0084 0085 MODEMMANAGERQT_EXPORT Notifier *notifier(); 0086 } 0087 0088 #endif