/* Copyright (C) 2026 The Qt Company Ltd.
 *
 * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
*/

/*!
    \qmltype gui
    \inqmlmodule scripting
    \brief Enables interaction with the installer UI.
*/

/*!
    \qmlsignal gui::interrupted()

    This signal is emitted when the end user chooses to cancel the installation
    and quit the installer.
*/

/*!
    \qmlsignal gui::languageChanged()

    This signal is emitted when the application language changes.
*/

/*!
    \qmlsignal gui::finishButtonClicked()

    This signal is emitted when the \uicontrol Finish button is clicked.

*/

/*!
    \qmlsignal gui::gotRestarted()

    This signal is emitted when the installer is restarted.
*/

/*!
    \qmlsignal gui::aboutApplicationClicked()

    This signal is emitted when the about application menu and dialog
    on macOS are shown.
*/

/*!
    \qmlsignal gui::currentPageChanged(int oldId, int newId)

    This signal is emitted when the page transition from \a oldId to \a newId
    has been completed.
*/

/*!
    \qmlsignal gui::settingsButtonClicked()

    This signal is emitted when the \uicontrol Settings button is clicked.
*/

/*!
    \qmlmethod object gui::pageById(int id)

    Returns the installer page specified by \a id. The values of \c id for the
    available installer pages are provided by QInstaller::WizardPage.
*/

/*!
    \qmlmethod object gui::pageByObjectName(string name)

    Returns the installer page specified by \a name. The value of \c name is the
    object name set in the UI file that defines the installer page.
*/

/*!
    \qmlmethod object gui::currentPageWidget()

    Returns the current wizard page.
*/

/*!
    \qmlmethod object gui::pageWidgetByObjectName(string name)

    For dynamic pages, returns the widget specified by \a name read from the UI
    file.
*/

/*!
    \qmlmethod string gui::defaultButtonText(int wizardButton)

    Returns the default text for the button specified by \a wizardButton.
*/

/*!
    \qmlmethod void gui::clickButton(int wizardButton, int delayInMs)

    Automatically clicks the button specified by \a wizardButton after a delay
    in milliseconds specified by \a delayInMs.
*/

/*!
    \qmlmethod void gui::clickButton(string objectName, int delayInMs)

    Automatically clicks the button specified by \a objectName after a delay
    in milliseconds specified by \a delayInMs.
*/

/*!
    \qmlmethod boolean gui::isButtonEnabled(int wizardButton)

    Returns \c true if the button specified by \a wizardButton is enabled.
    Returns \c false if a button of the specified type is not found.

*/

/*!
    \qmlmethod void gui::setWizardPageButtonText(int pageId, int buttonId, string buttonText)

    Sets \a buttonText for button specified by \a buttonId to a installer page \a pageId.

    \note In some pages, installer will change the button text when entering
    the page. In that case, you need to connect to \c entered() -signal of the
    page to change the \a buttonText.

    \code
    function Component()
    {
        var page = gui.pageByObjectName("FinishedPage");
        page.entered.connect(Component.prototype.finishPageEntered);
    }
    Component.prototype.finishPageEntered = function()
    {
        gui.setWizardPageButtonText(QInstaller.InstallationFinished, buttons.CommitButton, "Commit");
    }
    \endcode
*/

/*!
    \qmlmethod void gui::showSettingsButton(boolean show)

    Shows the \uicontrol Settings button if \a show is \c true. This function
    overrides the visibility of the \uicontrol Settings button in all pages. Be
    careful when showing the settings button so that users cannot change network
    settings while downloading data in the background. Changing the
    settings will restart the wizard and switch back to the introduction page.
*/

/*!
    \qmlmethod void gui::setSettingsButtonEnabled(boolean enable)

    Enables the \uicontrol Settings button by setting \a enable to \c true.
*/

/*!
    \qmlmethod object gui::findChild(object parent, string objectName)

    Returns the first descendant of \a parent that has \a objectName as name.

    \sa QObject::findChild
*/

/*!
    \qmlmethod object[] gui::findChildren(object parent, string objectName)

    Returns all descendants of \a parent that have \a objectName as name.

    \sa QObject::findChildren
*/

/*!
    \qmlmethod void gui::cancelButtonClicked()

    Asks end users whether they want to cancel the operation and quit the
    installer, uninstaller, or package manager.
*/

/*!
    \qmlmethod void gui::reject()

    Quits the installer, uninstaller, or package manager.
*/

/*!
    \qmlmethod void gui::rejectWithoutPrompt()

    Quits the installer, uninstaller, or package manager without asking end
    users for confirmation.
*/

/*!
    \qmlmethod void gui::showFinishedPage()

    Shows the InstallationFinished page.
*/

/*!
    \qmlmethod void gui::setTextItems(object control, stringlist items)

    Updates the model of \a control (which must be a QComboBox or QAbstractItemView)
    such that it contains the given \a items.
*/
