/** @packageDocumentation * @module UiItemsProvider */ import { BeEvent } from "@bentley/bentleyjs-core"; import { BackstageItem } from "./backstage/BackstageItem"; import { CommonStatusBarItem } from "./statusbar/StatusBarItem"; import { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from "./toolbars/ToolbarItem"; import { AbstractWidgetProps } from "./widget/AbstractWidgetProps"; import { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from "./widget/StagePanel"; /** Action taken by the application on item provided by a UiItemsProvider * @public */ export declare enum UiItemsApplicationAction { /** Allow the change to the item */ Allow = 0, /** Disallow the change to the item */ Disallow = 1, /** Update the item during the change */ Update = 2 } /** Describes interface of objects that want to provide UI component to the running IModelApp. * @public */ export interface UiItemsProvider { /** id of provider */ readonly id: string; /** UiItemsManager calls following method to get items to populate specific toolbars */ provideToolbarButtonItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation) => CommonToolbarItem[]; /** UiItemsManager calls following method to augment base statusbar for stages that allow it. */ provideStatusBarItems?: (stageId: string, stageUsage: string) => CommonStatusBarItem[]; /** UiItemsManager calls following method to augment backstage items. */ provideBackstageItems?: () => BackstageItem[]; /** UiItemsManager calls following method to augment Widget lists. * @note Returned widgets must provide unique `AbstractWidgetProps["id"]` to correctly save/restore App layout. */ provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation) => ReadonlyArray; /** Called if the application changed the Toolbar button item */ onToolbarButtonItemArbiterChange?: (item: CommonToolbarItem, action: UiItemsApplicationAction) => void; /** Called if the application changed the StatusBar item */ onStatusBarItemArbiterChange?: (item: CommonStatusBarItem, action: UiItemsApplicationAction) => void; /** Called if the application changed the Backstage item */ onBackstageItemArbiterChange?: (item: BackstageItem, action: UiItemsApplicationAction) => void; /** Called if the application changed the Widget */ onWidgetArbiterChange?: (widget: AbstractWidgetProps, action: UiItemsApplicationAction) => void; } /** UIProvider Registered Event Args interface. * @public */ export interface UiItemProviderRegisteredEventArgs { providerId: string; } /** * Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface. * @public */ export declare class UiItemsManager { private static _registeredUiItemsProviders; /** Event raised any time a UiProvider is registered or unregistered. */ static readonly onUiProviderRegisteredEvent: BeEvent<(ev: UiItemProviderRegisteredEventArgs) => void>; /** Return number of registered UiProvider. */ static get registeredProviderIds(): string[]; /** Return true if there is any registered UiProvider. */ static get hasRegisteredProviders(): boolean; /** * Retrieves a previously loaded UiItemsProvider. * @param providerId id of the UiItemsProvider to get */ static getUiItemsProvider(providerId: string): UiItemsProvider | undefined; private static sendRegisteredEvent; /** * Registers a UiItemsProvider with the UiItemsManager. * @param uiProvider the UI items provider to register. */ static register(uiProvider: UiItemsProvider): void; /** Remove a specific UiItemsProvider from the list of available providers. */ static unregister(uiProviderId: string): void; /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute * an action or specify a registered ToolId into toolbar. * @param stageId a string identifier the active stage. * @param stageUsage the StageUsage of the active stage. * @param toolbarUsage usage of the toolbar * @param toolbarOrientation orientation of the toolbar * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems. */ static getToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation): CommonToolbarItem[]; /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields * @param stageId a string identifier the active stage. * @param stageUsage the StageUsage of the active stage. * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar. */ static getStatusBarItems(stageId: string, stageUsage: string): CommonStatusBarItem[]; /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields * @returns An array of BackstageItem that will be used to create controls for the backstage menu. */ static getBackstageItems(): BackstageItem[]; /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets * @param stageId a string identifier the active stage. * @param stageUsage the StageUsage of the active stage. * @param location the location within the stage. * @param section the section within location. * @returns An array of AbstractWidgetProps that will be used to create widgets. */ static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation): ReadonlyArray; } //# sourceMappingURL=UiItemsManager.d.ts.map