arkui_sys/styled_string/
drawing_ffi.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
pub use super::ArkUI_StyledString;
pub use ohos_drawing_sys::text_declaration::{
    OH_Drawing_FontCollection, OH_Drawing_TextStyle, OH_Drawing_Typography,
    OH_Drawing_TypographyStyle,
};
pub use ohos_drawing_sys::text_typography::OH_Drawing_PlaceholderSpan;

extern "C" {
    /// Creates a pointer to the ArkUI_StyledString object.
    ///
    /// # Arguments
    ///
    /// `style` - A pointer to OH_Drawing_TypographyStyle, obtained by [`OH_Drawing_CreateTypographyStyle`].
    ///
    /// `collection` - A pointer to OH_Drawing_FontCollection, obtained by [`OH_Drawing_CreateFontCollection`].
    ///
    /// # Returns
    ///
    /// Creates a pointer to the ArkUI_StyledString object. If the object returns a null pointer,
    /// the creation failed, either because the address space was full,
    /// or because the style, collection parameter was an exception such as a null pointer.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_Create(
        style: *mut OH_Drawing_TypographyStyle,
        collection: *mut OH_Drawing_FontCollection,
    ) -> *mut ArkUI_StyledString;
    /// Sets the new layout style to the top of the current format string style stack.
    ///
    /// # Arguments
    ///
    /// `handle` - A pointer to the ArkUI_StyledString object.
    ///
    /// `style` - A pointer to the OH_Drawing_TextStyle object.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_PushTextStyle(
        handle: *mut ArkUI_StyledString,
        style: *mut OH_Drawing_TextStyle,
    );
    /// Creates a pointer to an OH_Drawing_Typography object based on a format string object
    /// for advanced text estimation and typography.
    ///
    /// # Arguments
    ///
    /// `handle` - A pointer to the ArkUI_StyledString object.
    ///
    /// # Returns
    ///
    /// A pointer to the OH_Drawing_Typography object. If the object returns a null pointer,
    /// the creation fails because the handle parameter is abnormal, such as a null pointer.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_CreateTypography(
        handle: *mut ArkUI_StyledString,
    ) -> *mut OH_Drawing_Typography;
    /// Set the placeholder.
    ///
    /// # Arguments
    ///
    /// `handle` - A pointer to the ArkUI_StyledString object.
    ///
    /// `placeholder` - A pointer to the OH_Drawing_PlaceholderSpan object.
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_ArkUI_StyledString_AddPlaceholder(
        handle: *mut ArkUI_StyledString,
        placeholder: *mut OH_Drawing_PlaceholderSpan,
    );
}