/****************************************************************************
**
** 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 NXTHARDWAREDEVICEWIZARDPAGES_H
#define NXTHARDWAREDEVICEWIZARDPAGES_H

#include <projectexplorer/abi.h>

#include <QWizardPage>
#include <QNetworkReply>

namespace QSsh {
    class SshConnectionParameters;
}

namespace Nxt {
namespace Internal {

namespace Ui {
    class NxtHardwareDeviceWizardSelectionPage;
    class NxtHardwareDeviceWizardSetupPage;
}

class NxtHardwareDeviceWizardSelectionPage : public QWizardPage
{
    Q_OBJECT
public:
    explicit NxtHardwareDeviceWizardSelectionPage(QWidget *parent = 0);

    QString hostName() const;
    QString userName() const;
    QString password() const;
#if 0 /* ssh */
    int timeout() const;
    int sshPort() const;
#endif /* ssh */

    ProjectExplorer::Abi::Architecture architecture() const;
    QString deviceName() const;
    QString deviceType() const;

    bool isComplete() const override;

private slots:
    void handleTestConnectionClicked();
    void replyFinished(QNetworkReply *response);

private:
#if 0 /* ssh */
    static ProjectExplorer::Abi::Architecture detectArchitecture(const QSsh::SshConnectionParameters &sshParams, bool *ok);
    static QString detectDeviceName(const QSsh::SshConnectionParameters &sshParams, bool *ok);
#endif /* ssh */
    Ui::NxtHardwareDeviceWizardSelectionPage *m_ui;
    ProjectExplorer::Abi::Architecture m_architecture;
    QString m_deviceName;
    QString m_deviceType;
    bool m_isIdle;
    bool m_connectionTestOk;
};

class NxtHardwareDeviceWizardSetupPage : public QWizardPage
{
    Q_OBJECT
public:
    explicit NxtHardwareDeviceWizardSetupPage(QWidget *parent = 0);

    void initializePage() override;

    QString configName() const;
#if 0 /* ssh */
    QString freePorts() const;
    QString publicKeyFilePath() const;
    QString privateKeyFilePath() const;
    bool isNewSshKeysRquired() const;
#endif /* ssh */
    QString sharedSshPath() const;

    bool isComplete() const override;

private slots:
    void handleSdkVmChanged(const QString &vmName);

private:
    Ui::NxtHardwareDeviceWizardSetupPage *m_ui;
};

} // namespace Internal
} // namespace Nxt

#endif // NXTHARDWAREDEVICEPAGES_H
