| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2025 Martin Rodriguez Reboredo <yakoyoku@gmail.com> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 5 | */ |
| 6 | |
| 7 | #ifndef NETWORKMANAGERQT_WIFIP2PDEVICE_H |
| 8 | #define NETWORKMANAGERQT_WIFIP2PDEVICE_H |
| 9 | |
| 10 | #include <networkmanagerqt/networkmanagerqt_export.h> |
| 11 | |
| 12 | #include "device.h" |
| 13 | #include "wifip2ppeer.h" |
| 14 | |
| 15 | #include <QVariantMap> |
| 16 | |
| 17 | namespace NetworkManager |
| 18 | { |
| 19 | class WifiP2PDevicePrivate; |
| 20 | |
| 21 | /*! |
| 22 | * \class NetworkManager::WifiP2PDevice |
| 23 | * \inheaderfile NetworkManagerQt/WifiP2PDevice |
| 24 | * \inmodule NetworkManagerQt |
| 25 | * |
| 26 | * \brief WiFi P2P device. |
| 27 | * \since 6.20 |
| 28 | */ |
| 29 | class NETWORKMANAGERQT_EXPORT WifiP2PDevice : public Device |
| 30 | { |
| 31 | Q_OBJECT |
| 32 | |
| 33 | /*! |
| 34 | * \property NetworkManager::WifiP2PDevice::hardwareAddress |
| 35 | */ |
| 36 | Q_PROPERTY(QString hardwareAddress READ hardwareAddress NOTIFY hardwareAddressChanged) |
| 37 | |
| 38 | /*! |
| 39 | * \property NetworkManager::WifiP2PDevice::peers |
| 40 | */ |
| 41 | Q_PROPERTY(QStringList peers READ peers NOTIFY peersChanged) |
| 42 | |
| 43 | public: |
| 44 | /*! |
| 45 | * \typedef NetworkManager::WifiP2PDevice::Ptr |
| 46 | */ |
| 47 | using Ptr = QSharedPointer<WifiP2PDevice>; |
| 48 | |
| 49 | /*! |
| 50 | * |
| 51 | */ |
| 52 | explicit WifiP2PDevice(const QString &path, QObject *parent = nullptr); |
| 53 | ~WifiP2PDevice() override; |
| 54 | |
| 55 | /*! |
| 56 | * |
| 57 | */ |
| 58 | Type type() const override; |
| 59 | |
| 60 | QString hardwareAddress() const; |
| 61 | QStringList peers() const; |
| 62 | |
| 63 | /*! |
| 64 | * |
| 65 | */ |
| 66 | Q_INVOKABLE WifiP2PPeer::Ptr findPeer(const QString &uni); |
| 67 | |
| 68 | public Q_SLOTS: |
| 69 | /*! |
| 70 | * |
| 71 | */ |
| 72 | QDBusPendingReply<> startFind(const QVariantMap &options = {}); |
| 73 | |
| 74 | /*! |
| 75 | * |
| 76 | */ |
| 77 | QDBusPendingReply<> stopFind(); |
| 78 | |
| 79 | Q_SIGNALS: |
| 80 | void hardwareAddressChanged(const QString &hardwareAddress); |
| 81 | void peersChanged(const QStringList &peers); |
| 82 | |
| 83 | /*! |
| 84 | * |
| 85 | */ |
| 86 | void peerAppeared(const QString &peer); |
| 87 | |
| 88 | /*! |
| 89 | * |
| 90 | */ |
| 91 | void peerDisappeared(const QString &peer); |
| 92 | |
| 93 | private: |
| 94 | Q_DECLARE_PRIVATE(WifiP2PDevice) |
| 95 | }; |
| 96 | |
| 97 | } |
| 98 | |
| 99 | #endif /* NETWORKMANAGERQT_WIFIP2PDEVICE_H */ |
| 100 | |