arkui_sys/styled_string/drawing_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)]
6pub use super::ArkUI_StyledString;
7pub use ohos_drawing_sys::text_declaration::{
8 OH_Drawing_FontCollection, OH_Drawing_TextStyle, OH_Drawing_Typography,
9 OH_Drawing_TypographyStyle,
10};
11pub use ohos_drawing_sys::text_typography::OH_Drawing_PlaceholderSpan;
12
13extern "C" {
14 /// Creates a pointer to the ArkUI_StyledString object.
15 ///
16 /// # Arguments
17 ///
18 /// * `style` - A pointer to OH_Drawing_TypographyStyle, obtained by [`OH_Drawing_CreateTypographyStyle`].
19 ///
20 /// * `collection` - A pointer to OH_Drawing_FontCollection, obtained by [`OH_Drawing_CreateFontCollection`].
21 ///
22 /// # Returns
23 ///
24 /// * Creates a pointer to the ArkUI_StyledString object. If the object returns a null pointer,
25 /// the creation failed, either because the address space was full,
26 /// or because the style, collection parameter was an exception such as a null pointer.
27 ///
28 /// Available since API-level: 12
29 #[cfg(feature = "api-12")]
30 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
31 pub fn OH_ArkUI_StyledString_Create(
32 style: *mut OH_Drawing_TypographyStyle,
33 collection: *mut OH_Drawing_FontCollection,
34 ) -> *mut ArkUI_StyledString;
35 /// Sets the new layout style to the top of the current format string style stack.
36 ///
37 /// # Arguments
38 ///
39 /// * `handle` - A pointer to the ArkUI_StyledString object.
40 ///
41 /// * `style` - A pointer to the OH_Drawing_TextStyle object.
42 ///
43 /// Available since API-level: 12
44 #[cfg(feature = "api-12")]
45 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
46 pub fn OH_ArkUI_StyledString_PushTextStyle(
47 handle: *mut ArkUI_StyledString,
48 style: *mut OH_Drawing_TextStyle,
49 );
50 /// Creates a pointer to an OH_Drawing_Typography object based on a format string object
51 /// for advanced text estimation and typography.
52 ///
53 /// # Arguments
54 ///
55 /// * `handle` - A pointer to the ArkUI_StyledString object.
56 ///
57 /// # Returns
58 ///
59 /// * A pointer to the OH_Drawing_Typography object. If the object returns a null pointer,
60 /// the creation fails because the handle parameter is abnormal, such as a null pointer.
61 ///
62 /// Available since API-level: 12
63 #[cfg(feature = "api-12")]
64 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
65 pub fn OH_ArkUI_StyledString_CreateTypography(
66 handle: *mut ArkUI_StyledString,
67 ) -> *mut OH_Drawing_Typography;
68 /// Set the placeholder.
69 ///
70 /// # Arguments
71 ///
72 /// * `handle` - A pointer to the ArkUI_StyledString object.
73 ///
74 /// * `placeholder` - A pointer to the OH_Drawing_PlaceholderSpan object.
75 ///
76 /// Available since API-level: 12
77 #[cfg(feature = "api-12")]
78 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
79 pub fn OH_ArkUI_StyledString_AddPlaceholder(
80 handle: *mut ArkUI_StyledString,
81 placeholder: *mut OH_Drawing_PlaceholderSpan,
82 );
83}