File indexing completed on 2024-04-21 04:00:13

0001 /*
0002     SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
0003     SPDX-FileCopyrightText: 2011-2013 Lamarque V. Souza <lamarque@kde.org>
0004     SPDX-FileCopyrightText: 2013 Jan Grulich <jgrulich@redhat.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef NETWORKMANAGERQT_MODEMDEVICE_H
0010 #define NETWORKMANAGERQT_MODEMDEVICE_H
0011 
0012 #include "device.h"
0013 #include <networkmanagerqt/networkmanagerqt_export.h>
0014 
0015 namespace NetworkManager
0016 {
0017 class ModemDevicePrivate;
0018 
0019 /**
0020  * Represents a generic modem device, generally defined by the modemCapabilities() it exposes and at
0021  * the current point in time by the currentCapabilities().
0022  */
0023 class NETWORKMANAGERQT_EXPORT ModemDevice : public Device
0024 {
0025     Q_OBJECT
0026 public:
0027     typedef QSharedPointer<ModemDevice> Ptr;
0028     typedef QList<Ptr> List;
0029     enum Capability {
0030         NoCapability = 0x0,
0031         Pots = 0x1,
0032         CdmaEvdo = 0x2,
0033         GsmUmts = 0x4,
0034         Lte = 0x8,
0035     };
0036     Q_DECLARE_FLAGS(Capabilities, Capability)
0037     explicit ModemDevice(const QString &path, QObject *parent = nullptr);
0038     ~ModemDevice() override;
0039     /**
0040      * Return the type
0041      */
0042     Type type() const override;
0043     /**
0044      * The generic family of access technologies the modem supports. Not all capabilities are
0045      * available at the same time however; some modems require a firmware reload or other
0046      * reinitialization to switch between eg CDMA/EVDO and GSM/UMTS.
0047      */
0048     Capabilities modemCapabilities() const;
0049     /**
0050      * The generic family of access technologies the modem currently supports without a firmware
0051      * reload or reinitialization.
0052      */
0053     Capabilities currentCapabilities() const;
0054 
0055 Q_SIGNALS:
0056     /**
0057      * This signal is emitted when the capabilities of the device change
0058      */
0059     void currentCapabilitiesChanged(Capabilities);
0060 
0061 protected:
0062     NETWORKMANAGERQT_NO_EXPORT explicit ModemDevice(ModemDevicePrivate &dd, QObject *parent = nullptr);
0063 
0064 private:
0065     Q_DECLARE_PRIVATE(ModemDevice)
0066 };
0067 
0068 Q_DECLARE_OPERATORS_FOR_FLAGS(ModemDevice::Capabilities)
0069 
0070 } // namespace NetworkManager
0071 
0072 #endif