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}
18/// Defines the layout manager of text.
19///
20///
21/// Available since API-level: 22
22#[cfg(feature = "api-22")]
23#[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
24#[repr(C)]
25pub struct ArkUI_TextLayoutManager {
26 _unused: [u8; 0],
27}
28extern "C" {
29 /// Free the memory occupied by the ArkUI_StyledString object.
30 ///
31 /// # Arguments
32 ///
33 /// * `handle` - A pointer to the ArkUI_StyledString object.
34 ///
35 /// Available since API-level: 12
36 #[cfg(feature = "api-12")]
37 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
38 pub fn OH_ArkUI_StyledString_Destroy(handle: *mut ArkUI_StyledString);
39 /// Sets the corresponding text content based on the current format string style.
40 ///
41 /// # Arguments
42 ///
43 /// * `handle` - A pointer to the ArkUI_StyledString object.
44 ///
45 /// * `content` - A pointer to the text content.
46 ///
47 /// Available since API-level: 12
48 #[cfg(feature = "api-12")]
49 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
50 pub fn OH_ArkUI_StyledString_AddText(
51 handle: *mut ArkUI_StyledString,
52 content: *const ::core::ffi::c_char,
53 );
54 /// Removes the top style from the stack in the current format string object.
55 ///
56 /// # Arguments
57 ///
58 /// * `handle` - A pointer to the ArkUI_StyledString object.
59 ///
60 /// Available since API-level: 12
61 #[cfg(feature = "api-12")]
62 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
63 pub fn OH_ArkUI_StyledString_PopTextStyle(handle: *mut ArkUI_StyledString);
64 /// Creates an <b>ArkUI_StyledString_Descriptor</b> object.
65 ///
66 ///
67 /// # Returns
68 ///
69 /// * Returns the pointer to the <b>ArkUI_StyledString_Descriptor</b> object created.
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_Create() -> *mut ArkUI_StyledString_Descriptor;
75 /// Destroys an <b>ArkUI_StyledString_Descriptor</b> object and reclaims the memory occupied by the object.
76 ///
77 /// # Arguments
78 ///
79 /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
80 ///
81 /// Available since API-level: 14
82 #[cfg(feature = "api-14")]
83 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
84 pub fn OH_ArkUI_StyledString_Descriptor_Destroy(descriptor: *mut ArkUI_StyledString_Descriptor);
85 /// Converts styled string information into HTML.
86 ///
87 /// # Arguments
88 ///
89 /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
90 ///
91 /// # Returns
92 ///
93 /// * Returns the pointer to the resulting HTML string. This pointer is managed internally and should be destroyed
94 /// by calling <b>OH_ArkUI_StyledString_Descriptor_Destroy()</b> when no longer needed to free the memory.
95 ///
96 /// Available since API-level: 14
97 #[cfg(feature = "api-14")]
98 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
99 pub fn OH_ArkUI_ConvertToHtml(
100 descriptor: *mut ArkUI_StyledString_Descriptor,
101 ) -> *const ::core::ffi::c_char;
102 /// Deserializes a byte array containing styled string information into a styled string.
103 ///
104 /// # Arguments
105 ///
106 /// * `buffer` - Byte array to be deserialized.
107 ///
108 /// * `bufferSize` - Length of the byte array.
109 ///
110 /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
111 ///
112 /// # Returns
113 ///
114 /// * Returns the result code.
115 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
116 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
117 ///
118 /// Available since API-level: 14
119 #[cfg(feature = "api-14")]
120 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
121 pub fn OH_ArkUI_UnmarshallStyledStringDescriptor(
122 buffer: *mut u8,
123 bufferSize: usize,
124 descriptor: *mut ArkUI_StyledString_Descriptor,
125 ) -> i32;
126 /// Serializes the styled string information into a byte array.
127 ///
128 /// # Arguments
129 ///
130 /// * `buffer` - Byte array where the serialized data will be stored.
131 ///
132 /// * `bufferSize` - Length of the byte array.
133 ///
134 /// * `descriptor` - Pointer to an <b>ArkUI_StyledString_Descriptor</b> object.
135 ///
136 /// * `resultSize` - Actual length of the byte array.
137 ///
138 /// # Returns
139 ///
140 /// * Returns the result code.
141 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
142 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter error occurs.
143 /// Returns [`ARKUI_ERROR_CODE_INVALID_STYLED_STRING`] if the styled string is invalid.
144 ///
145 /// Available since API-level: 14
146 #[cfg(feature = "api-14")]
147 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
148 pub fn OH_ArkUI_MarshallStyledStringDescriptor(
149 buffer: *mut u8,
150 bufferSize: usize,
151 descriptor: *mut ArkUI_StyledString_Descriptor,
152 resultSize: *mut usize,
153 ) -> i32;
154 /// Dispose an object of the text layout manager.
155 ///
156 /// # Arguments
157 ///
158 /// * `layoutManager` - Pointer to the ArkUI_TextLayoutManager object to be disposed.
159 ///
160 /// Available since API-level: 22
161 #[cfg(feature = "api-22")]
162 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
163 pub fn OH_ArkUI_TextLayoutManager_Dispose(layoutManager: *mut ArkUI_TextLayoutManager);
164 /// Gets the line count.
165 ///
166 /// # Arguments
167 ///
168 /// * `layoutManager` - Indicates the pointer to an <b>ArkUI_TextLayoutManager</b> object.
169 ///
170 /// * `outLineCount` - Returns the line count.
171 ///
172 /// # Returns
173 ///
174 /// * Returns the result code.
175 /// Returns [`ARKUI_ERROR_CODE_NO_ERROR`] if the operation is successful.
176 /// Returns [`ARKUI_ERROR_CODE_PARAM_INVALID`] if a parameter exception occurs.
177 ///
178 /// Available since API-level: 22
179 #[cfg(feature = "api-22")]
180 #[cfg_attr(docsrs, doc(cfg(feature = "api-22")))]
181 pub fn OH_ArkUI_TextLayoutManager_GetLineCount(
182 layoutManager: *mut ArkUI_TextLayoutManager,
183 outLineCount: *mut i32,
184 ) -> ArkUiResult;
185}