import { DropBehavior, IControl, IShellData } from "../UiControl"; import { DpiSize_2, IconCache, IconSource, IIconManager, InputModifier, KbKey, ProgressBarState, Rect, StringKey } from "../UiCommon"; import { Theme, UiThemeInfection } from "../Theme/UiTheme"; import { ICommonUi } from "../UiCommonUi"; import { Vec2, Vec4 } from "../../Math/Vector"; import { IPlatform } from "../UiPlatform"; import { IWindowFrame } from "./UiWindowFrame"; import { IIcon } from "../Visual/UiIcon"; export declare enum WindowFlag { MainWindow = 1, FullScreen = 2, Sizable = 4, Minimum = 8, TopMost = 16, Layered = 64, ToolWindow = 128, Indicator = 2048, Transparent = 4096, WindowSize = 65536, Default = 13 } export declare enum WindowDevice { Default2D = 0, Default3D = 1, GDI = 100, D2D1 = 101, D3D11 = 200, D3D12 = 201, CG = 300, Metal = 400 } export declare enum WindowScale { SystemDefault = 0, MonitorOptimized = 1, Percent100 = 2, Percent125 = 3, Percent150 = 4, Percent175 = 5, Percent200 = 6, Percent225 = 7, Percent250 = 8, Percent300 = 9, Percent350 = 10, Percent400 = 11 } export declare enum WindowSizeState { Normal = 0, Minimized = 1, Maximized = 2 } export interface IWindowExtension { GetWindow(): Window; } export interface IWindowDragDrop extends IWindowExtension { BeginDragDrop(pData: IShellData, n: DropBehavior): DropBehavior; } export interface IWindowSysTray extends IWindowExtension { SetVisible(b: boolean): IWindowSysTray; GetVisible(): boolean; SetText(b: string): IWindowSysTray; GetText(): string; OnClick(fn: (sender: Window) => void): IWindowSysTray; OnRightClick(fn: (sender: Window) => void): IWindowSysTray; } export interface IWindowDeviceNotification extends IWindowExtension { OnChange(fn: (sender: Window) => void): IWindowDeviceNotification; } export interface IWindowTaskbar { SetState(n: ProgressBarState): IWindowTaskbar; GetState(): ProgressBarState; SetMaximum(n: number): IWindowTaskbar; GetMaximum(): number; SetValue(n: number): IWindowTaskbar; GetValue(): number; SetStep(n: number): IWindowTaskbar; GetStep(): number; Step(): IWindowTaskbar; SetForceBigIconSize100(n: number): IWindowTaskbar; GetForceBigIconSize100(): number; } export interface IWindowControlManager { AddControl(c: IControl, key: string | number | StringKey): boolean; RemoveControl(c: IControl): boolean; } export declare class WindowCreation { Title: string; Icon: string; Layout: Rect; Flag: WindowFlag; ParentWindow: Window; Theme: Theme; Device: WindowDevice; } export declare class WindowPlacementLayout { Virtual: Rect; WorkPos: Vec2; Percent: Vec4; static FromNative(raw: WindowPlacementLayout): WindowPlacementLayout; } export declare class WindowPlacement { State: WindowSizeState; StateNonMin: WindowSizeState; LayoutNormal: WindowPlacementLayout; LayoutMin: WindowPlacementLayout; LayoutMax: WindowPlacementLayout; VirtualRect: Rect; MonitorLayoutChecksum: number; MonitorLayoutWithoutWorkAreaChecksum: number; static FromNative(raw: WindowPlacement): WindowPlacement; } export interface IWindowConstructor { new (cp: WindowCreation): IWindow & IControl & Internal; } export declare type IWindow = { IsWindowCreated(): boolean; GetDeviceType(): WindowDevice; Activate(): T; IsActive(): boolean; SetTitle(s: string): T; GetTitle(): string; SetPosition(vPos: Vec2): T; SetSize(vSize: Vec2): T; SetClientPosition(vPos: Vec2): T; GetClientPosition(): Vec2; SetClientSize(vSize: Vec2): T; GetClientSize(): Vec2; SetMinimumSize(vSize: DpiSize_2): T; SetMinimumSize(): DpiSize_2; SetSizeState(n: WindowSizeState): T; GetSizeState(): WindowSizeState; IsMinimizable(): boolean; IsSizeable(): boolean; SetTopMost(b: boolean): T; GetTopMost(): boolean; SetIme(b: boolean): T; GetIme(): boolean; SetBackground(b: boolean): T; GetBackground(): boolean; SetRtl(b: boolean): T; GetRtl(): boolean; SetScale(n: WindowScale): T; GetScale(): WindowScale; SetKeyTipEnable(b: boolean): T; GetKeyTipEnable(): boolean; SetDirectKeyTip(b: boolean): T; GetDirectKeyTip(): boolean; SetContent(c: IControl): IControl; GetContent(): IControl; SetIcon(nResId: number): T; GetIcon(): number; SetPlacement(wp: WindowPlacement): boolean; GetPlacement(): WindowPlacement; SetInfectionOverride(b: boolean): T; GetInfectionOverride(): boolean; SetInfection(infection: UiThemeInfection): T; GetInfection(): UiThemeInfection; SetImportantRender(b: boolean): T; GetImportantRender(): boolean; SetManualRender(b: boolean): T; GetManualRender(): boolean; ManualRender(): void; Update(): void; SetAppId(s: string): T; SetDeviceNotification(b: boolean): T; GetDeviceNotification(): boolean; GetTheme(): Theme; GetFrame(): IWindowFrame; GetControlManager(): IWindowControlManager; GetIconManager(): IIconManager; GetCommonUi(): ICommonUi; GetDragDrop(): IWindowDragDrop; GetSysTray(): IWindowSysTray; GetTaskbar(): IWindowTaskbar; GetPlatform(): IPlatform; GetTime(): number; CacheIcon(icon: IconSource): IconCache; CreateManagedIcon(icon: IconSource): IIcon; HotkeyRegister(key: KbKey, n: InputModifier): number; HotkeyDeregister(nId: number): boolean; HotkeySetEnable(b: boolean): T; HotkeyGetEnable(): boolean; HotkeyClear(): T; OnCreateContent(fn: (sender: T) => boolean): T; OnClosing(fn: (sender: T) => boolean): T; OnClose(fn: (sender: T) => void): T; OnWindowOk(fn: (sender: T) => void): T; OnWindowCancel(fn: (sender: T) => void): T; OnWindowHotkey(fn: (sender: T, nId: number, key: KbKey, n: InputModifier) => void): T; OnScaleChange(fn: (sender: T) => void): T; OnLanguageChange(fn: (sender: T) => void): T; OnDeviceChange(fn: (sender: T) => void): T; }; export declare type WindowLike = Window | Dialog; interface IWindowInternal { CreateWindow(pByoLinker: WindowLike, bIndependent?: boolean): boolean; CloseWindow(): void; } declare const Window_base: IWindowConstructor; export declare class Window extends Window_base { CreateWindow(pByoLinker?: Window, bIndependent?: boolean): boolean; CloseWindow(): void; } interface IDialogInternal { ShowDialog(pByoLinker?: WindowLike): Promise; CloseDialog(nCode: number): void; } declare const Dialog_base: IWindowConstructor; export declare class Dialog extends Dialog_base { ShowDialog(pByoLinker: WindowLike): Promise; CloseDialog(nCode: number): void; } export {};