arkui-sys 0.3.3

Bindings to the native ArkUI API of OpenHarmony
Documentation
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
pub use super::ArkUI_StyledString;
pub use ohos_drawing_sys::text_declaration::{
    OH_Drawing_FontCollection, OH_Drawing_TextStyle, OH_Drawing_Typography,
    OH_Drawing_TypographyStyle,
};
pub use ohos_drawing_sys::text_typography::OH_Drawing_PlaceholderSpan;

extern "C" {
    /// Creates a pointer to the ArkUI_StyledString object.
    ///
    /// # Arguments
    ///
    /// * `style` - A pointer to OH_Drawing_TypographyStyle, obtained by [`OH_Drawing_CreateTypographyStyle`].
    ///
    /// * `collection` - A pointer to OH_Drawing_FontCollection, obtained by [`OH_Drawing_CreateFontCollection`].
    ///
    /// # Returns
    ///
    /// * Creates a pointer to the ArkUI_StyledString object. If the object returns a null pointer,
    /// the creation failed, either because the address space was full,
    /// or because the style, collection parameter was an exception such as a null pointer.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_Create(
        style: *mut OH_Drawing_TypographyStyle,
        collection: *mut OH_Drawing_FontCollection,
    ) -> *mut ArkUI_StyledString;
    /// Sets the new layout style to the top of the current format string style stack.
    ///
    /// # Arguments
    ///
    /// * `handle` - A pointer to the ArkUI_StyledString object.
    ///
    /// * `style` - A pointer to the OH_Drawing_TextStyle object.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_PushTextStyle(
        handle: *mut ArkUI_StyledString,
        style: *mut OH_Drawing_TextStyle,
    );
    /// Creates a pointer to an OH_Drawing_Typography object based on a format string object
    /// for advanced text estimation and typography.
    ///
    /// # Arguments
    ///
    /// * `handle` - A pointer to the ArkUI_StyledString object.
    ///
    /// # Returns
    ///
    /// * A pointer to the OH_Drawing_Typography object. If the object returns a null pointer,
    /// the creation fails because the handle parameter is abnormal, such as a null pointer.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_CreateTypography(
        handle: *mut ArkUI_StyledString,
    ) -> *mut OH_Drawing_Typography;
    /// Set the placeholder.
    ///
    /// # Arguments
    ///
    /// * `handle` - A pointer to the ArkUI_StyledString object.
    ///
    /// * `placeholder` - A pointer to the OH_Drawing_PlaceholderSpan object.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_AddPlaceholder(
        handle: *mut ArkUI_StyledString,
        placeholder: *mut OH_Drawing_PlaceholderSpan,
    );
}