Mountain/ApplicationState/DTO/
WebViewStateDTO.rs

1//! # WebViewStateDTO
2//!
3//! Defines the Data Transfer Object for storing the state of a single active
4//! WebView panel.
5
6#![allow(non_snake_case, non_camel_case_types)]
7
8use Common::WebView::DTO::WebViewContentOptionsDTO::WebViewContentOptionsDTO;
9use serde::{Deserialize, Serialize};
10// For PanelOptions, etc.
11use serde_json::Value;
12
13/// A struct that holds the complete state for a single WebView panel instance.
14/// This is stored in `ApplicationState` to track all active WebViews managed by
15/// the host.
16#[derive(Serialize, Deserialize, Debug, Clone)]
17#[serde(rename_all = "PascalCase")]
18pub struct WebViewStateDTO {
19	/// A unique UUID handle for this WebView instance.
20	pub Handle:String,
21
22	/// The view type of this WebView panel, as defined by the extension.
23	pub ViewType:String,
24
25	/// The current title of the WebView panel.
26	pub Title:String,
27
28	/// The content and security options for the WebView's content.
29	pub ContentOptions:WebViewContentOptionsDTO,
30
31	/// The options controlling the behavior of the WebView panel itself.
32	// DTO: WebViewPanelOptionsDTO
33	pub PanelOptions: Value,
34
35	/// The identifier of the sidecar process that owns this WebView.
36	pub SideCarIdentifier:String,
37
38	/// The identifier of the extension that owns this WebView.
39	pub ExtensionIdentifier:String,
40
41	/// A flag indicating if the WebView panel currently has focus.
42	pub IsActive:bool,
43
44	/// A flag indicating if the WebView panel is currently visible in the UI.
45	pub IsVisible:bool,
46}