#ifndef IPPDISCOVERY_H #define IPPDISCOVERY_H #include #include #include #include #include #include #include #include #include "bytestream.h" class IppDiscovery : public QStringListModel, public QQuickImageProvider { Q_OBJECT public: static IppDiscovery* instance(); Q_PROPERTY(QStringList favourites MEMBER _favourites NOTIFY favouritesChanged) Q_INVOKABLE void discover(); Q_INVOKABLE void reset(); void resolve(QUrl& url); signals: void favouritesChanged(); void ignoreSslErrorsChanged(); public slots: void readPendingDatagrams(); void cleanUpdate(); void update(); protected: private: static IppDiscovery* m_Instance; quint16 _transactionid; IppDiscovery(); ~IppDiscovery(); IppDiscovery(const IppDiscovery &); IppDiscovery& operator=(const IppDiscovery &); void sendQuery(quint16 qtype, QStringList addr); void sendQuery(quint16 qtype, QStringList prefixes, QStringList suffixes); void updateAndQueryPtrs(QStringList& ptrs, QStringList new_ptrs); QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override; QStringList _ipp; QStringList _ipps; QMap _rps; QMap _ports; QMap _targets; QMultiMap _AAs; QMultiMap _AAAAs; QMap _outstandingQueries; QStringList _favourites; QUdpSocket* socket; }; #endif // IPPDISCOVERY_H