arkui_sys/styled_string/
styled_string_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6use crate::native_type::*;
7
8/// Defines formatted string data objects supported by the text component.
9///
10///
11/// Available since API-level: 12
12#[cfg(feature = "api-12")]
13#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
14#[repr(C)]
15pub struct ArkUI_StyledString {
16    _unused: [u8; 0],
17}
18extern "C" {
19    /// Free the memory occupied by the ArkUI_StyledString object.
20    ///
21    /// # Arguments
22    ///
23    /// * `handle` - A pointer to the ArkUI_StyledString object.
24    ///
25    /// Available since API-level: 12
26    #[cfg(feature = "api-12")]
27    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
28    pub fn OH_ArkUI_StyledString_Destroy(handle: *mut ArkUI_StyledString);
29    /// Sets the corresponding text content based on the current format string style.
30    ///
31    /// # Arguments
32    ///
33    /// * `handle` - A pointer to the ArkUI_StyledString object.
34    ///
35    /// * `content` - A pointer to the text content.
36    ///
37    /// Available since API-level: 12
38    #[cfg(feature = "api-12")]
39    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
40    pub fn OH_ArkUI_StyledString_AddText(
41        handle: *mut ArkUI_StyledString,
42        content: *const ::core::ffi::c_char,
43    );
44    /// Removes the top style from the stack in the current format string object.
45    ///
46    /// # Arguments
47    ///
48    /// * `handle` - A pointer to the ArkUI_StyledString object.
49    ///
50    /// Available since API-level: 12
51    #[cfg(feature = "api-12")]
52    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
53    pub fn OH_ArkUI_StyledString_PopTextStyle(handle: *mut ArkUI_StyledString);
54    /// Creates an <b>ArkUI_StyledString_Descriptor</b> object.
55    ///
56    ///
57    /// # Returns
58    ///
59    /// * Returns the pointer to the <b>ArkUI_StyledString_Descriptor</b> object created.
60    ///
61    /// Available since API-level: 14
62    #[cfg(feature = "api-14")]
63    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
64    pub fn OH_ArkUI_StyledString_Descriptor_Create() -> *mut ArkUI_StyledString_Descriptor;
65    /// Destroys an <b>ArkUI_StyledString_Descriptor</b> object and reclaims the memory occupied by the object.
66    ///
67    /// # Arguments
68    ///
69    /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
70    ///
71    /// Available since API-level: 14
72    #[cfg(feature = "api-14")]
73    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
74    pub fn OH_ArkUI_StyledString_Descriptor_Destroy(descriptor: *mut ArkUI_StyledString_Descriptor);
75    /// Converts styled string information into HTML.
76    ///
77    /// # Arguments
78    ///
79    /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
80    ///
81    /// # Returns
82    ///
83    /// * Returns the pointer to the resulting HTML string. This pointer is managed internally and should be destroyed
84    /// by calling <b>OH_ArkUI_StyledString_Descriptor_Destroy()</b> when no longer needed to free the memory.
85    ///
86    /// Available since API-level: 14
87    #[cfg(feature = "api-14")]
88    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
89    pub fn OH_ArkUI_ConvertToHtml(
90        descriptor: *mut ArkUI_StyledString_Descriptor,
91    ) -> *const ::core::ffi::c_char;
92    /// Deserializes a byte array containing styled string information into a styled string.
93    ///
94    /// # Arguments
95    ///
96    /// * `buffer` - Byte array to be deserialized.
97    ///
98    /// * `bufferSize` - Length of the byte array.
99    ///
100    /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
101    ///
102    /// # Returns
103    ///
104    /// * Returns the result code.
105    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
106    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
107    ///
108    /// Available since API-level: 14
109    #[cfg(feature = "api-14")]
110    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
111    pub fn OH_ArkUI_UnmarshallStyledStringDescriptor(
112        buffer: *mut u8,
113        bufferSize: usize,
114        descriptor: *mut ArkUI_StyledString_Descriptor,
115    ) -> i32;
116    /// Serializes the styled string information into a byte array.
117    ///
118    /// # Arguments
119    ///
120    /// * `buffer` - Byte array where the serialized data will be stored.
121    ///
122    /// * `bufferSize` - Length of the byte array.
123    ///
124    /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
125    ///
126    /// * `resultSize` - Actual length of the byte array.
127    ///
128    /// # Returns
129    ///
130    /// * Returns the result code.
131    /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
132    /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
133    /// Returns [`ARKUI_ERROR_CODE_INVALID_STYLED_STRING`] if the styled string is invalid.
134    ///
135    /// Available since API-level: 14
136    #[cfg(feature = "api-14")]
137    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
138    pub fn OH_ArkUI_MarshallStyledStringDescriptor(
139        buffer: *mut u8,
140        bufferSize: usize,
141        descriptor: *mut ArkUI_StyledString_Descriptor,
142        resultSize: *mut usize,
143    ) -> i32;
144}