UNPKG

@theia/core

Version:

Theia is a cloud & desktop IDE framework implemented in TypeScript.

87 lines • 4.82 kB
import { Command, CommandContribution, CommandRegistry, MenuModelRegistry, MenuContribution, PreferenceService } from '../../common/index.js'; import { KeybindingContribution, KeybindingRegistry, Widget, FrontendApplication, FrontendApplicationContribution, Message, ApplicationShell } from '../../browser/index.js'; import { ElectronMainMenuFactory } from './electron-main-menu-factory.js'; import { FrontendApplicationStateService } from '../../browser/frontend-application-state.js'; import { BrowserMenuBarContribution, MenuBarWidget } from '../../browser/menu/browser-menu-plugin.js'; import { WindowService } from '../../browser/window/window-service.js'; import { WindowTitleService } from '../../browser/window/window-title-service.js'; import { ElectronWindowTitleBarService } from './electron-window-title-bar-service.js'; import '../../../src/electron-browser/menu/electron-menu-style.css'; import { ThemeService } from '../../browser/theming.js'; import { ThemeChangeEvent } from '../../common/theme.js'; export declare namespace ElectronCommands { const TOGGLE_DEVELOPER_TOOLS: Command; const RELOAD: Command; const ZOOM_IN: Command; const ZOOM_OUT: Command; const RESET_ZOOM: Command; const CLOSE_WINDOW: Command; const TOGGLE_FULL_SCREEN: Command; } export declare namespace ElectronMenus { const VIEW_WINDOW: string[]; const VIEW_ZOOM: string[]; } export declare namespace ElectronMenus { const HELP_TOGGLE: string[]; } export declare namespace ElectronMenus { const FILE_CLOSE: string[]; } export declare const CustomTitleWidgetFactory: unique symbol; export type CustomTitleWidgetFactory = () => Widget | undefined; export declare class ElectronMenuContribution extends BrowserMenuBarContribution implements FrontendApplicationContribution, CommandContribution, MenuContribution, KeybindingContribution { protected readonly factory: ElectronMainMenuFactory; protected readonly stateService: FrontendApplicationStateService; protected readonly windowService: WindowService; protected readonly themeService: ThemeService; protected readonly customTitleWidgetFactory: CustomTitleWidgetFactory; protected readonly titleBarService: ElectronWindowTitleBarService; protected titleBarStyleChangeFlag: boolean; protected titleBarStyle?: string; constructor(factory: ElectronMainMenuFactory); onStart(app: FrontendApplication): void; protected attachWindowFocusListener(app: FrontendApplication): void; protected attachMenuBarVisibilityListener(): void; handleTitleBarStyling(app: FrontendApplication): void; handleToggleMaximized(): void; /** * Hides the `theia-top-panel` depending on the selected `titleBarStyle`. * The `theia-top-panel` is used as the container of the main, application menu-bar for the * browser. Native Electron has its own. * By default, this method is called on application `onStart`. */ protected hideTopPanel(app: FrontendApplication): void; protected setMenu(app: FrontendApplication): void; protected createCustomTitleBar(app: FrontendApplication): void; protected createCustomTitleWidget(app: FrontendApplication): void; protected handleWindowControls(): void; protected createControlButton(id: string, handler: () => void): HTMLElement; protected handleRequiredRestart(): Promise<void>; registerCommands(registry: CommandRegistry): void; registerKeybindings(registry: KeybindingRegistry): void; registerMenus(registry: MenuModelRegistry): void; protected toggleFullScreen(): void; protected handleFullScreen(menuBarVisibility: string): void; /** * Outside of full screen the top panel also carries the window controls, so it has to stay * visible and Alt toggles the menu widgets inside it. In full screen the panel is hidden * altogether, so Alt toggles the panel itself and the widgets inside it stay visible. */ protected applyElectronMenuBarVisibility(menu: MenuBarWidget, logo: Widget, pref: string): void; protected getElectronToggleTargets(menu: MenuBarWidget, logo: Widget): Widget[]; protected handleThemeChange(e: ThemeChangeEvent): void; } export declare class CustomTitleWidget extends Widget { protected readonly electronMenuContribution: ElectronMenuContribution; protected readonly windowTitleService: WindowTitleService; protected readonly applicationShell: ApplicationShell; protected readonly preferenceService: PreferenceService; constructor(); protected init(): void; protected onResize(msg: Widget.ResizeMessage): void; protected onAfterShow(msg: Message): void; protected updateTitle(title: string): void; protected adjustTitleToCenter(): void; } //# sourceMappingURL=electron-menu-contribution.d.ts.map