// Copyright (c) 2009-2026 SAP SE, All Rights Reserved

/**
 * @fileoverview This file contains the ApplicationContainerRenderer.
 * It provides the base rendering logic for application containers.
 */
sap.ui.define([
], (
) => {
    "use strict";

    /**
     * ApplicationContainerRenderer provides the base rendering functionality.
     *
     * @alias sap.ushell.appIntegration.ApplicationContainerRenderer
     * @namespace
     *
     * @private
     */
    const ApplicationContainerRenderer = {
        apiVersion: 2
    };

    /**
     * Renders the placeholder for the application container.
     * This is the base rendering executed when the application is not ready for rendering.
     * Subclasses render the actual content once ready.
     *
     * @param {sap.ui.core.RenderManager} oRenderManager The render manager.
     * @param {sap.ushell.appIntegration.ApplicationContainer} oContainer The container to render.
     *
     * @private
     */
    ApplicationContainerRenderer.render = function (oRenderManager, oContainer) {
        /*
         * This is only a placeholder rendering, the actual rendering is done by the sub classes.
         * It is executed when the application is not ready for rendering.
         * Once it is ready, the application will be rendered by the sub classes and any further
         * rendering will be suppressed.
         */

        oRenderManager.openStart("div", oContainer);
        oRenderManager.accessibilityState(oContainer);
        oRenderManager.attr("data-help-id", oContainer.getDataHelpId());
        oRenderManager.attr("data-sap-ushell-active", oContainer.getActive());
        oRenderManager.attr("data-sap-ushell-initial-app-id", oContainer.getInitialAppId());
        oRenderManager.attr("data-sap-ushell-current-app-id", oContainer.getCurrentAppId());
        oRenderManager.attr("data-sap-ushell-stateful-type", oContainer.getStatefulType());
        oRenderManager.attr("data-sap-ushell-framework-id", oContainer.getFrameworkId());
        oRenderManager.class("sapUShellApplicationContainer");
        oRenderManager.style("height", oContainer.getHeight());
        oRenderManager.style("width", oContainer.getWidth());
        oRenderManager.openEnd();

        oRenderManager.close("div");
    };

    return ApplicationContainerRenderer;
});
