pub enum WidgetKind {
Show 42 variants
Column,
Row,
Container,
Scrollable,
Stack,
Text,
Image,
Svg,
Button,
TextInput,
Checkbox,
Slider,
PickList,
Toggler,
Space,
Rule,
Radio,
ComboBox,
ProgressBar,
Tooltip,
Grid,
Canvas,
CanvasRect,
CanvasCircle,
CanvasLine,
CanvasText,
CanvasGroup,
DatePicker,
TimePicker,
ColorPicker,
Menu,
MenuItem,
MenuSeparator,
ContextMenu,
Float,
DataTable,
DataColumn,
TreeView,
TreeNode,
For,
If,
Custom(String),
}Expand description
Enumeration of all supported widget types
Variants§
Column
Row
Container
Scrollable
Stack
Text
Image
Svg
Button
TextInput
Checkbox
Slider
PickList
Toggler
Space
Rule
Radio
ComboBox
ProgressBar
Tooltip
Grid
Canvas
CanvasRect
CanvasCircle
CanvasLine
CanvasText
CanvasGroup
DatePicker
Date selection widget with calendar overlay
TimePicker
Time selection widget with hour/minute/second picker
ColorPicker
Color selection widget with color picker overlay
Menu
MenuItem
MenuSeparator
ContextMenu
Float
DataTable
DataColumn
TreeView
TreeNode
For
If
Custom(String)
Implementations§
Source§impl WidgetKind
impl WidgetKind
Sourcepub fn all_standard() -> &'static [&'static str]
pub fn all_standard() -> &'static [&'static str]
Returns a list of all standard widget tag names.
Sourcepub fn minimum_version(&self) -> SchemaVersion
pub fn minimum_version(&self) -> SchemaVersion
Returns the minimum schema version required for this widget type.
This method provides infrastructure for version-gating widgets in future releases. Currently, all widgets return version 1.0 as they are part of the initial release.
§Future Usage
When new widgets are added in future schema versions (e.g., 1.1, 1.2), this method will be updated to return the appropriate minimum version for those widgets. The parser can then validate that documents declaring older schema versions do not use widgets that were introduced in later versions.
§Examples
use dampen_core::{WidgetKind, SchemaVersion};
let column = WidgetKind::Column;
assert_eq!(column.minimum_version(), SchemaVersion { major: 1, minor: 0 });§Returns
The minimum SchemaVersion required to use this widget type.
Sourcepub fn schema(&self) -> WidgetSchema
pub fn schema(&self) -> WidgetSchema
Returns the validation schema for this widget type.
Trait Implementations§
Source§impl Clone for WidgetKind
impl Clone for WidgetKind
Source§fn clone(&self) -> WidgetKind
fn clone(&self) -> WidgetKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more