#[cfg(feature = "api-20")]
impl super::EmbeddedComponent {
#[cfg(feature = "api-20")]
pub fn set_embedded_component_option<T: Into<crate::ArkUINodeAttributeItem>>(
&self,
value: T,
) -> crate::ArkUIResult<()> {
<Self as crate::ArkUICommonAttribute>::set_attribute(
self,
crate::ArkUINodeAttributeType::EmbeddedComponentOption,
value.into(),
)
}
#[cfg(feature = "api-20")]
pub fn get_embedded_component_option(
&self,
) -> crate::ArkUIResult<crate::ArkUINodeAttributeItem> {
<Self as crate::ArkUICommonAttribute>::get_attribute(
self,
crate::ArkUINodeAttributeType::EmbeddedComponentOption,
)
}
#[cfg(feature = "api-20")]
pub fn set_embedded_component_want<T: Into<crate::ArkUINodeAttributeItem>>(
&self,
value: T,
) -> crate::ArkUIResult<()> {
<Self as crate::ArkUICommonAttribute>::set_attribute(
self,
crate::ArkUINodeAttributeType::EmbeddedComponentWant,
value.into(),
)
}
#[cfg(feature = "api-20")]
pub fn get_embedded_component_want(&self) -> crate::ArkUIResult<crate::ArkUINodeAttributeItem> {
<Self as crate::ArkUICommonAttribute>::get_attribute(
self,
crate::ArkUINodeAttributeType::EmbeddedComponentWant,
)
}
}
#[cfg(feature = "api-20")]
impl super::EmbeddedComponent {
pub fn set_embedded_component_option_object(
&self,
option: &crate::EmbeddedComponentOption,
) -> crate::ArkUIResult<()> {
<Self as crate::ArkUICommonAttribute>::set_attribute(
self,
crate::ArkUINodeAttributeType::EmbeddedComponentOption,
crate::ArkUINodeAttributeItem::Object(option.raw().cast()),
)
}
pub fn get_embedded_component_option_object(
&self,
) -> crate::ArkUIResult<Option<crate::EmbeddedComponentOption>> {
match <Self as crate::ArkUICommonAttribute>::get_attribute(
self,
crate::ArkUINodeAttributeType::EmbeddedComponentOption,
)? {
crate::ArkUINodeAttributeItem::Object(ptr) => {
Ok(Some(crate::EmbeddedComponentOption::from_raw(ptr.cast())))
}
_ => Ok(None),
}
}
}