use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum AgentCapability {
Focusable,
Clickable,
Scrollable { vertical: bool, horizontal: bool },
TextInput {
multiline: bool,
max_length: Option<usize>,
},
Selectable {
multi_select: bool,
item_count: usize,
},
Expandable { expanded: bool },
Draggable,
DropTarget,
Resizable {
min_width: Option<f32>,
min_height: Option<f32>,
max_width: Option<f32>,
max_height: Option<f32>,
},
Animated { playing: bool },
RangeEditable {
min: f64,
max: f64,
step: Option<f64>,
},
Toggleable { state: bool },
Sortable { columns: Vec<String> },
Filterable,
Searchable,
Copyable,
HasTooltip,
HasKeyBindings { bindings: Vec<(String, String)> },
Minimizable,
Maximizable,
Closable,
Zoomable { min_zoom: f32, max_zoom: f32 },
Custom(String),
}
impl AgentCapability {
pub fn name(&self) -> &str {
match self {
Self::Focusable => "focusable",
Self::Clickable => "clickable",
Self::Scrollable { .. } => "scrollable",
Self::TextInput { .. } => "text-input",
Self::Selectable { .. } => "selectable",
Self::Expandable { .. } => "expandable",
Self::Draggable => "draggable",
Self::DropTarget => "drop-target",
Self::Resizable { .. } => "resizable",
Self::Animated { .. } => "animated",
Self::RangeEditable { .. } => "range-editable",
Self::Toggleable { .. } => "toggleable",
Self::Sortable { .. } => "sortable",
Self::Filterable => "filterable",
Self::Searchable => "searchable",
Self::Copyable => "copyable",
Self::HasTooltip => "has-tooltip",
Self::HasKeyBindings { .. } => "has-key-bindings",
Self::Minimizable => "minimizable",
Self::Maximizable => "maximizable",
Self::Closable => "closable",
Self::Zoomable { .. } => "zoomable",
Self::Custom(name) => name.as_str(),
}
}
}