File indexing completed on 2024-03-24 15:41:26

0001 /*
0002     SPDX-FileCopyrightText: 2011 Lamarque Souza <lamarque@kde.org>
0003     SPDX-FileCopyrightText: 2011 Will Stephenson <wstephenson@kde.org>
0004     SPDX-FileCopyrightText: 2011-2013 Lamarque V. Souza <lamarque@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "modemdevice.h"
0010 
0011 #ifndef NETWORKMANAGERQT_BLUETOOTH_DEVICE_H
0012 #define NETWORKMANAGERQT_BLUETOOTH_DEVICE_H
0013 
0014 #include <networkmanagerqt/networkmanagerqt_export.h>
0015 
0016 namespace NetworkManager
0017 {
0018 class BluetoothDevicePrivate;
0019 
0020 /**
0021  * A bluetooth device interface
0022  */
0023 class NETWORKMANAGERQT_EXPORT BluetoothDevice : public ModemDevice
0024 {
0025     Q_OBJECT
0026 
0027     Q_PROPERTY(uint bluetoothCapabilities READ bluetoothCapabilities)
0028     Q_PROPERTY(QString hardwareAddress READ hardwareAddress)
0029     Q_PROPERTY(QString name READ name)
0030 
0031 public:
0032     typedef QSharedPointer<BluetoothDevice> Ptr;
0033     typedef QList<Ptr> List;
0034     /**
0035      * Capabilities of the Bluetooth device
0036      */
0037     enum Capability {
0038         NoCapability = 0x0, /**< No special capability */
0039         Dun = 0x1, /**< Dial Up Networking profile */
0040         Pan = 0x2, /**< Personal Area Network profile */
0041     };
0042     Q_DECLARE_FLAGS(Capabilities, Capability)
0043     Q_FLAG(Capabilities)
0044     /**
0045      * Creates a new BluetoothDevice object.
0046      */
0047     explicit BluetoothDevice(const QString &path, QObject *parent = nullptr);
0048     /**
0049      * Destroys a BluetoothDevice object.
0050      */
0051     ~BluetoothDevice() override;
0052 
0053     /**
0054      * Retrieves the capabilities supported by this device.
0055      *
0056      * @return the capabilities of the device
0057      * @see NetworkManager::BluetoothDevice::Capability
0058      */
0059     Capabilities bluetoothCapabilities() const;
0060     /**
0061      * The hardware address assigned to the bluetooth interface
0062      */
0063     QString hardwareAddress() const;
0064     /**
0065      * Name of the bluetooth interface
0066      */
0067     QString name() const;
0068     /**
0069      * The NetworkInterface type.
0070      *
0071      * @return the NetworkManager::Device::Type.  This always returns NetworkManager::Device::Bluetooth
0072      */
0073     Type type() const override;
0074 
0075 Q_SIGNALS:
0076     /**
0077      * Emitted when the BT device @p name changes
0078      */
0079     void nameChanged(const QString &name);
0080 
0081 private:
0082     Q_DECLARE_PRIVATE(BluetoothDevice)
0083 };
0084 }
0085 #endif