/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module StandardUiItemsProvider
 */
import { ToolbarOrientation, ToolbarUsage, } from "@itwin/appui-abstract";
import { ToolbarHelper } from "../toolbar/ToolbarHelper";
import { CoreTools } from "../tools/CoreToolDefinitions";
/**
 * Provide standard tools for the ViewNavigationWidgetComposer.
 * @beta
 */
export class StandardNavigationToolsUiItemsProvider {
    constructor(defaultNavigationTools) {
        this.defaultNavigationTools = defaultNavigationTools;
    }
    get id() { return "appui-react:StandardNavigationToolsUiItemsProvider"; }
    provideToolbarButtonItems(_stageId, _stageUsage, toolbarUsage, toolbarOrientation, _stageAppData) {
        const items = [];
        if (toolbarUsage === ToolbarUsage.ViewNavigation && toolbarOrientation === ToolbarOrientation.Horizontal) { // eslint-disable-line deprecation/deprecation
            if (!this.defaultNavigationTools || !this.defaultNavigationTools.horizontal || this.defaultNavigationTools.horizontal.rotateView)
                items.push(ToolbarHelper.createToolbarItemFromItemDef(10, CoreTools.rotateViewCommand));
            if (!this.defaultNavigationTools || !this.defaultNavigationTools.horizontal || this.defaultNavigationTools.horizontal.panView)
                items.push(ToolbarHelper.createToolbarItemFromItemDef(20, CoreTools.panViewCommand));
            if (!this.defaultNavigationTools || !this.defaultNavigationTools.horizontal || this.defaultNavigationTools.horizontal.fitView) {
                items.push(ToolbarHelper.createToolbarItemFromItemDef(30, CoreTools.fitViewCommand));
            }
            if (!this.defaultNavigationTools || !this.defaultNavigationTools.horizontal || this.defaultNavigationTools.horizontal.windowArea) {
                items.push(ToolbarHelper.createToolbarItemFromItemDef(40, CoreTools.windowAreaCommand));
            }
            if (!this.defaultNavigationTools || !this.defaultNavigationTools.horizontal || this.defaultNavigationTools.horizontal.viewUndoRedo) {
                items.push(ToolbarHelper.createToolbarItemFromItemDef(50, CoreTools.viewUndoCommand));
                items.push(ToolbarHelper.createToolbarItemFromItemDef(60, CoreTools.viewRedoCommand));
            }
        }
        else /* istanbul ignore else */ if (toolbarUsage === ToolbarUsage.ViewNavigation && toolbarOrientation === ToolbarOrientation.Vertical) { // eslint-disable-line deprecation/deprecation
            if (!this.defaultNavigationTools || !this.defaultNavigationTools.vertical || this.defaultNavigationTools.vertical.setupWalkCamera)
                items.push(ToolbarHelper.createToolbarItemFromItemDef(5, CoreTools.setupCameraWalkTool));
            if (!this.defaultNavigationTools || !this.defaultNavigationTools.vertical || this.defaultNavigationTools.vertical.walk)
                items.push(ToolbarHelper.createToolbarItemFromItemDef(10, CoreTools.walkViewCommand));
            if (!this.defaultNavigationTools || !this.defaultNavigationTools.vertical || this.defaultNavigationTools.vertical.toggleCamera)
                items.push(ToolbarHelper.createToolbarItemFromItemDef(20, CoreTools.toggleCameraViewCommand));
        }
        return items;
    }
}
//# sourceMappingURL=StandardNavigationToolsUiItemsProvider.js.map