File indexing completed on 2024-04-28 04:44:21

0001 /*
0002    SPDX-FileCopyrightText: 2015 (c) Matthieu Gallien <matthieu_gallien@yahoo.fr>
0003 
0004    SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  */
0006 
0007 #ifndef UPNPDEVICESOAPSERVER_H
0008 #define UPNPDEVICESOAPSERVER_H
0009 
0010 #include "upnplibqt_export.h"
0011 
0012 #include <KDSoapServer/KDSoapServer.h>
0013 
0014 #include <QObject>
0015 
0016 #include <memory>
0017 
0018 class UpnpAbstractDevice;
0019 class UpnpDeviceSoapServerPrivate;
0020 
0021 /**
0022  * @brief The UpnpDeviceSoapServer class should be used to implement an UPnP device that will be providing services
0023  */
0024 class UPNPLIBQT_EXPORT UpnpDeviceSoapServer : public KDSoapServer
0025 {
0026     Q_OBJECT
0027 public:
0028     explicit UpnpDeviceSoapServer(QObject *parent = nullptr);
0029 
0030     ~UpnpDeviceSoapServer() override;
0031 
0032     int addDevice(UpnpAbstractDevice *device);
0033 
0034     void removeDevice(int index);
0035 
0036     QObject *createServerObject() override;
0037 
0038     [[nodiscard]] QUrl urlPrefix() const;
0039 
0040 private:
0041     std::unique_ptr<UpnpDeviceSoapServerPrivate> d;
0042 };
0043 
0044 #endif