#pragma once

#include <QString>

#include "ModalDialog.h"

class QLineEdit;

// The game's own name prompt (REQ-UI-MODAL-CHROME): a title, a prompt, a line edit, and
// Confirm and Cancel. It stands in for QInputDialog at the two places a blueprint is
// named -- the blueprint save dialog (REQ-UI-BLUEPRINT-CREATE) and the Create Blueprint
// dialog of the layout configuration dialog (REQ-MOD-UI-BLUEPRINT-CREATE).
//
// Neither Q nor a click outside dismisses it (ModalDialog::isDismissible stays false):
// Q is a character the player may be typing, and a half-typed name is work in progress
// that no stray gesture may discard (REQ-UI-DIALOG-DISMISS). Escape and Cancel remain.
// The caller decides what an empty name means; the dialog reports it trimmed.
class NameInputDialog : public ModalDialog
{
    Q_OBJECT

public:
    NameInputDialog(const QString& title, const QString& prompt,
                    QWidget* parent = nullptr);

    QString getName() const;

    QWidget* getInitialFocusWidget() const override;

private:
    QLineEdit* m_nameEdit;
};
