/****************************************************************************
**
** Copyright (C) 2012 - 2014 Jolla Ltd.
** Contact: http://jolla.com/
**
** This file is part of Qt Creator.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Digia.
**
****************************************************************************/

#ifndef NXTDEVICEXMLPARSER_H
#define NXTDEVICEXMLPARSER_H

#include <QMetaType>
#include <QObject>

namespace Utils { class FileName; }

namespace Nxt {

class NxtDeviceData;
class NxtEngineData;
class NxtDevicesXmlReaderPrivate;
class NxtDevicesXmlReader : public QObject
{
public:
    NxtDevicesXmlReader(const QString &fileName, QObject *parent = 0);
    ~NxtDevicesXmlReader() override;

    bool hasError() const;
    QString errorString() const;

    QList<NxtDeviceData> deviceData() const;
    NxtEngineData engineData() const;

private:
    NxtDevicesXmlReaderPrivate *d;

};

class NxtDevicesXmlWriterPrivate;
class NxtDevicesXmlWriter : public QObject
{
public:
    NxtDevicesXmlWriter(const QString &fileName, const QList<NxtDeviceData> &deviceData, const NxtEngineData &engineData, QObject *parent = 0);
    ~NxtDevicesXmlWriter() override;

    bool hasError() const;
    QString errorString() const;
private:
    NxtDevicesXmlWriterPrivate *d;

};

class NxtDeviceData
{
public:
    void clear();

    QString m_ip;
    QString m_sshKeyPath;
    QString m_mac;
    QString m_subNet;
    QString m_name;
    QString m_type;
    QString m_index;
};

class NxtEngineData
{
public:
    void clear();
    QString m_name;
    QString m_type;
    QString m_subNet;
};

} // namespace Nxt

Q_DECLARE_METATYPE(Nxt::NxtDeviceData)

#endif
