using ElectronNET.Converter; using System.ComponentModel; using System.Text.Json.Serialization; namespace ElectronNET.API.Entities { /// /// /// public class BrowserWindowOptions { /// /// Window's width in pixels. Default is 800. /// public int Width { get; set; } = 800; /// /// Window's height in pixels. Default is 600. /// public int Height { get; set; } = 600; /// /// ( if y is used) Window's left offset from screen. Default is to center the /// window. /// public int X { get; set; } = -1; /// /// ( if x is used) Window's top offset from screen. Default is to center the /// window. /// public int Y { get; set; } = -1; /// /// The width and height would be used as web page's size, which means the actual /// window's size will include window frame's size and be slightly larger. Default /// is false. /// public bool UseContentSize { get; set; } /// /// Show window in the center of the screen. /// public bool Center { get; set; } /// /// Window's minimum width. Default is 0. /// public int MinWidth { get; set; } /// /// Window's minimum height. Default is 0. /// public int MinHeight { get; set; } /// /// Window's maximum width. Default is no limit. /// public int MaxWidth { get; set; } /// /// Window's maximum height. Default is no limit. /// public int MaxHeight { get; set; } /// /// Whether window is resizable. Default is true. /// [DefaultValue(true)] public bool Resizable { get; set; } = true; /// /// Whether window is movable. This is not implemented on Linux. Default is true. /// [DefaultValue(true)] public bool Movable { get; set; } = true; /// /// Whether window is minimizable. This is not implemented on Linux. Default is true. /// [DefaultValue(true)] public bool Minimizable { get; set; } = true; /// /// Whether window is maximizable. This is not implemented on Linux. Default is true. /// [DefaultValue(true)] public bool Maximizable { get; set; } = true; /// /// Whether window is closable. This is not implemented on Linux. Default is true. /// [DefaultValue(true)] public bool Closable { get; set; } = true; /// /// Whether the window can be focused. Default is true. On Windows setting /// focusable: false also implies setting skipTaskbar: true. On Linux setting /// focusable: false makes the window stop interacting with wm, so the window will /// always stay on top in all workspaces. /// [DefaultValue(true)] public bool Focusable { get; set; } = true; /// /// Whether the window should always stay on top of other windows. Default is false. /// public bool AlwaysOnTop { get; set; } /// /// Whether the window should show in fullscreen. When explicitly set to false the /// fullscreen button will be hidden or disabled on macOS.Default is false. /// public bool Fullscreen { get; set; } /// /// Whether the window can be put into fullscreen mode. On macOS, also whether the /// maximize/zoom button should toggle full screen mode or maximize window.Default /// is true. /// public bool Fullscreenable { get; set; } /// /// Whether to show the window in taskbar. Default is false. /// public bool SkipTaskbar { get; set; } /// /// Determines if Blazor is used. Will disable "module" and "process" globals. Default is false. /// public bool IsRunningBlazor { get; set; } /// /// The kiosk mode. Default is false. /// public bool Kiosk { get; set; } /// /// Default window title. Default is "Electron.NET". /// public string Title { get; set; } = "Electron.NET"; /// /// The window icon. On Windows it is recommended to use ICO icons to get best /// visual effects, you can also leave it undefined so the executable's icon will be used. /// public string Icon { get; set; } /// /// Whether window should be shown when created. Default is true. /// [DefaultValue(true)] public bool Show { get; set; } = true; /// /// Specify false to create a . Default is true. /// [DefaultValue(true)] public bool Frame { get; set; } = true; /// /// Whether this is a modal window. This only works when the window is a child /// window.Default is false. /// public bool Modal { get; set; } /// /// Whether the web view accepts a single mouse-down event that simultaneously /// activates the window.Default is false. /// public bool AcceptFirstMouse { get; set; } /// /// Whether to hide cursor when typing. Default is false. /// public bool DisableAutoHideCursor { get; set; } /// /// Auto hide the menu bar unless the Alt key is pressed. Default is false. /// public bool AutoHideMenuBar { get; set; } /// /// Enable the window to be resized larger than screen. Default is false. /// public bool EnableLargerThanScreen { get; set; } /// /// Window's background color as Hexadecimal value, like #66CD00 or #FFF or /// #80FFFFFF (alpha is supported). Default is #FFF (white). /// public string BackgroundColor { get; set; } /// /// Whether window should have a shadow. This is only implemented on macOS. Default /// is true. /// public bool HasShadow { get; set; } /// /// Forces using dark theme for the window, only works on some GTK+3 desktop /// environments.Default is false. /// public bool DarkTheme { get; set; } /// /// Makes the window transparent. Default is false. /// public bool Transparent { get; set; } /// /// The type of window, default is normal window. /// public string Type { get; set; } /// /// The style of window title bar. Default is default. Possible values are: /// 'default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover' /// public TitleBarStyle TitleBarStyle { get; set; } /// /// Configures the window's title bar overlay when using a frameless window. /// Can be either: /// - false: No title bar overlay. /// - true: Enables the default title bar overlay. /// - An object defining custom overlay options (such as height, color, etc.). /// /// Default is false. /// [JsonConverter(typeof(TitleBarOverlayConverter))] public TitleBarOverlay TitleBarOverlay { get; set; } /// /// Shows the title in the tile bar in full screen mode on macOS for all /// titleBarStyle options.Default is false. /// public bool FullscreenWindowTitle { get; set; } /// /// Use WS_THICKFRAME style for frameless windows on Windows, which adds standard /// window frame.Setting it to false will remove window shadow and window /// animations. Default is true. /// [DefaultValue(true)] public bool ThickFrame { get; set; } = true; /// /// Whether frameless window should have rounded corners. Default is true. Setting this /// property to false will prevent the window from being fullscreenable on macOS. On /// Windows versions older than Windows 11 Build 22000 this property has no effect, and /// frameless windows will not have rounded corners. /// [DefaultValue(true)] public bool RoundedCorners { get; set; } = true; /// /// Add a type of vibrancy effect to the window, only on macOS. Can be /// appearance-based, light, dark, titlebar, selection, menu, popover, sidebar, /// medium-light or ultra-dark. /// public Vibrancy Vibrancy { get; set; } /// /// Controls the behavior on macOS when option-clicking the green stoplight button /// on the toolbar or by clicking the Window > Zoom menu item.If true, the window /// will grow to the preferred width of the web page when zoomed, false will cause /// it to zoom to the width of the screen.This will also affect the behavior when /// calling maximize() directly.Default is false. /// public bool ZoomToPageWidth { get; set; } /// /// Tab group name, allows opening the window as a native tab on macOS 10.12+. /// Windows with the same tabbing identifier will be grouped together.This also /// adds a native new tab button to your window's tab bar and allows your app and /// window to receive the new-window-for-tab event. /// public string TabbingIdentifier { get; set; } /// /// Settings of web page's features. /// public WebPreferences WebPreferences { get; set; } /// /// A proxy to set on creation in the format host:port. /// The proxy can be alternatively set using the BrowserWindow.WebContents.SetProxyAsync function. /// public string Proxy { get; set; } /// /// The credentials of the Proxy in the format username:password. /// These will only be used if the Proxy field is also set. /// public string ProxyCredentials { get; set; } } }