"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module ConfigurableUi
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigurableUiControl = exports.ConfigurableUiControlType = exports.ConfigurableBase = exports.ConfigurableCreateInfo = void 0;
/** Information for creating a ConfigurableUi element
 * @public
 */
class ConfigurableCreateInfo {
    constructor(classId, uniqueId, id) {
        this.classId = classId;
        this.uniqueId = uniqueId;
        this.id = id;
    }
}
exports.ConfigurableCreateInfo = ConfigurableCreateInfo;
/** The base class for all ConfigurableUi elements
 * @public
 */
class ConfigurableBase {
    constructor(info, options) {
        this._uniqueId = info.uniqueId;
        this._classId = info.classId;
        this._name = (options && options.hasOwnProperty("name")) ? options.name : info.uniqueId;
        this._appDataOptions = options;
    }
    /** @internal */
    get uniqueId() { return this._uniqueId; }
    /** allow options set via appData to be seen by API calls */
    get applicationData() { return this._appDataOptions; }
    /** Gets the class Id of configurable element */
    get classId() { return this._classId; }
    /** Get internal name of configurable element. If no name is defined in configuration
     * then the name will match the UniqueId.
     */
    get name() { return this._name; }
}
exports.ConfigurableBase = ConfigurableBase;
/** The type of the ConfigurableUiControl.
 * @public
 */
var ConfigurableUiControlType;
(function (ConfigurableUiControlType) {
    ConfigurableUiControlType["Content"] = "ContentControl";
    ConfigurableUiControlType["NavigationAid"] = "NavigationAidControl";
    ConfigurableUiControlType["StatusBarWidget"] = "StatusBarWidgetControl";
    ConfigurableUiControlType["ToolUiProvider"] = "ToolUiProvider";
    ConfigurableUiControlType["Viewport"] = "ViewportContentControl";
    ConfigurableUiControlType["Widget"] = "WidgetControl";
})(ConfigurableUiControlType = exports.ConfigurableUiControlType || (exports.ConfigurableUiControlType = {}));
/** The abstract base class for all Frontstage controls.
 * @public
 *
 * @note This is an abstract class which should not be derived from by the applications.
 * Instead, applications should derive from one of
 * [[ContentControl]],
 * [[ViewportContentControl]],
 * [[WidgetControl]],
 * [[StatusBarWidgetControl]] or
 * [[NavigationAidControl]].
 */
class ConfigurableUiControl extends ConfigurableBase {
    /** Creates an instance of ConfigurableUiControl.
     * @param info         An object that the subclass must pass to this base class.
     * @param options      Options provided to the control
     * @note Subclasses must pass all arguments to the base class and not add themselves
     * to any container - the control is added automatically by the [[FrontstageComposer]].
     * @protected
     */
    constructor(info, options) {
        super(info, options);
        this._cid = info.id;
    }
    /** @internal
     */
    initialize() { this.onInitialize(); }
    /** Called to initialize the ConfigurableUiControl. */
    onInitialize() { }
    /** Called when Frontstage is deactivated. */
    onFrontstageDeactivated() { }
    /** Called when Frontstage is ready. */
    onFrontstageReady() { }
    /** Returns the ID of this ConfigurableUiControl.
     */
    get controlId() { return this._cid; }
    /** Returns a promise that resolves when the control is ready for usage.
     */
    get isReady() { return Promise.resolve(); }
}
exports.ConfigurableUiControl = ConfigurableUiControl;
//# sourceMappingURL=ConfigurableUiControl.js.map