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