use ferroui_base::FerroObject;
pub trait ICommandBarElement {
fn is_compact(&self) -> bool;
fn set_is_compact(&self, value: bool);
fn is_in_overflow(&self) -> bool;
fn set_is_in_overflow(&self, value: bool);
fn as_object(&self) -> Option<&FerroObject> {
None
}
}
impl PartialEq for dyn ICommandBarElement {
fn eq(&self, other: &Self) -> bool {
match (self.as_object(), other.as_object()) {
(Some(a), Some(b)) => std::ptr::eq(a, b),
(None, None) => std::ptr::addr_eq(self, other),
_ => false,
}
}
}
impl std::fmt::Debug for dyn ICommandBarElement {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self.as_object() {
Some(object) => write!(f, "ICommandBarElement({})", object.get_type()),
None => f.write_str("ICommandBarElement"),
}
}
}