/**
 * @file dlg_load_deck_from_website.h
 * @ingroup RemoteDeckStorageDialogs
 * @ingroup Lobby
 */
//! \todo Document this file.

#ifndef DLG_LOAD_DECK_FROM_WEBSITE_H
#define DLG_LOAD_DECK_FROM_WEBSITE_H

#include "../client/network/parsers/deck_link_to_api_transformer.h"
#include "../client/network/parsers/interface_json_deck_parser.h"

#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QLoggingCategory>
#include <QNetworkAccessManager>
#include <QVBoxLayout>

inline Q_LOGGING_CATEGORY(DlgLoadDeckFromWebsiteLog, "dlg_load_deck_from_website");

class DlgLoadDeckFromWebsite : public QDialog
{
    Q_OBJECT
public:
    explicit DlgLoadDeckFromWebsite(QWidget *parent);
    void retranslateUi();
    bool testValidUrl();
    DeckList deck;

    const DeckList &getDeck() const
    {
        return deck;
    }

private:
    QNetworkAccessManager *nam;
    QVBoxLayout *layout;
    QLabel *instructionLabel;
    QLineEdit *urlEdit;

public slots:
    void accept() override;
    QSharedPointer<IJsonDeckParser> createParserForProvider(DeckProvider provider);
};

#endif // DLG_LOAD_DECK_FROM_WEBSITE_H
