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)]
use crate::native_type::*;

/// Defines formatted string data objects supported by the text component.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
pub struct ArkUI_StyledString {
    _unused: [u8; 0],
}
extern "C" {
    /// Free the memory occupied by the ArkUI_StyledString object.
    ///
    /// # Arguments
    ///
    /// * `handle` - A pointer to the ArkUI_StyledString object.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_Destroy(handle: *mut ArkUI_StyledString);
    /// Sets the corresponding text content based on the current format string style.
    ///
    /// # Arguments
    ///
    /// * `handle` - A pointer to the ArkUI_StyledString object.
    ///
    /// * `content` - A pointer to the text content.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_AddText(
        handle: *mut ArkUI_StyledString,
        content: *const ::core::ffi::c_char,
    );
    /// Removes the top style from the stack in the current format string object.
    ///
    /// # Arguments
    ///
    /// * `handle` - A pointer to the ArkUI_StyledString object.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_PopTextStyle(handle: *mut ArkUI_StyledString);
    /// Creates an <b>ArkUI_StyledString_Descriptor</b> object.
    ///
    ///
    /// # Returns
    ///
    /// * Returns the pointer to the <b>ArkUI_StyledString_Descriptor</b> object created.
    ///
    /// Available since API-level: 14
    #[cfg(feature = "api-14")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
    pub fn OH_ArkUI_StyledString_Descriptor_Create() -> *mut ArkUI_StyledString_Descriptor;
    /// Destroys an <b>ArkUI_StyledString_Descriptor</b> object and reclaims the memory occupied by the object.
    ///
    /// # Arguments
    ///
    /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
    ///
    /// Available since API-level: 14
    #[cfg(feature = "api-14")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
    pub fn OH_ArkUI_StyledString_Descriptor_Destroy(descriptor: *mut ArkUI_StyledString_Descriptor);
    /// Converts styled string information into HTML.
    ///
    /// # Arguments
    ///
    /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
    ///
    /// # Returns
    ///
    /// * Returns the pointer to the resulting HTML string. This pointer is managed internally and should be destroyed
    /// by calling <b>OH_ArkUI_StyledString_Descriptor_Destroy()</b> when no longer needed to free the memory.
    ///
    /// Available since API-level: 14
    #[cfg(feature = "api-14")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
    pub fn OH_ArkUI_ConvertToHtml(
        descriptor: *mut ArkUI_StyledString_Descriptor,
    ) -> *const ::core::ffi::c_char;
    /// Deserializes a byte array containing styled string information into a styled string.
    ///
    /// # Arguments
    ///
    /// * `buffer` - Byte array to be deserialized.
    ///
    /// * `bufferSize` - Length of the byte array.
    ///
    /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
    ///
    /// # Returns
    ///
    /// * Returns the result code.
    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
    ///
    /// Available since API-level: 14
    #[cfg(feature = "api-14")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
    pub fn OH_ArkUI_UnmarshallStyledStringDescriptor(
        buffer: *mut u8,
        bufferSize: usize,
        descriptor: *mut ArkUI_StyledString_Descriptor,
    ) -> i32;
    /// Serializes the styled string information into a byte array.
    ///
    /// # Arguments
    ///
    /// * `buffer` - Byte array where the serialized data will be stored.
    ///
    /// * `bufferSize` - Length of the byte array.
    ///
    /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
    ///
    /// * `resultSize` - Actual length of the byte array.
    ///
    /// # Returns
    ///
    /// * Returns the result code.
    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
    /// Returns [`ARKUI_ERROR_CODE_INVALID_STYLED_STRING`] if the styled string is invalid.
    ///
    /// Available since API-level: 14
    #[cfg(feature = "api-14")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
    pub fn OH_ArkUI_MarshallStyledStringDescriptor(
        buffer: *mut u8,
        bufferSize: usize,
        descriptor: *mut ArkUI_StyledString_Descriptor,
        resultSize: *mut usize,
    ) -> i32;
}