#ifndef NETWORKINTERFACE_H
#define NETWORKINTERFACE_H

#include <QObject>
#include <QNetworkInterface>

class NetworkInterface : public QObject
{
    Q_OBJECT

    Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged FINAL)
    Q_PROPERTY(QString address READ address WRITE setAddress NOTIFY addressChanged FINAL)
public:
    explicit NetworkInterface(int interfaceIndex, QObject *parent = nullptr);
    explicit NetworkInterface(QNetworkInterface iface, QObject *parent = nullptr);


    QString name() const;
    void setName(const QString &newName);

    QString address() const;
    void setAddress(const QString &newAddress);
    Q_INVOKABLE void shutdown();
signals:
    void nameChanged();
    void addressChanged();

private:

    QNetworkInterface m_qni;
    QString m_name;
    QString m_address;
};

#endif // NETWORKINTERFACE_H
