ohos_drawing_sys/text_typography/text_typography_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)]
6#[cfg(feature = "api-12")]
7use crate::font::OH_Drawing_Font_Metrics;
8use crate::text_declaration::*;
9use crate::types::*;
10
11impl OH_Drawing_TextDirection {
12 /// Right to left (RTL)
13 pub const TEXT_DIRECTION_RTL: OH_Drawing_TextDirection = OH_Drawing_TextDirection(0);
14 /// Left to right (LTR)
15 pub const TEXT_DIRECTION_LTR: OH_Drawing_TextDirection = OH_Drawing_TextDirection(1);
16}
17#[repr(transparent)]
18/// Enumerates text directions.
19///
20///
21/// Available since API-level: 8
22///
23/// Version: 1.0
24#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
25pub struct OH_Drawing_TextDirection(pub ::core::ffi::c_uint);
26impl OH_Drawing_TextAlign {
27 /// Left-aligned
28 pub const TEXT_ALIGN_LEFT: OH_Drawing_TextAlign = OH_Drawing_TextAlign(0);
29 /// Right-aligned
30 pub const TEXT_ALIGN_RIGHT: OH_Drawing_TextAlign = OH_Drawing_TextAlign(1);
31 /// Center-aligned
32 pub const TEXT_ALIGN_CENTER: OH_Drawing_TextAlign = OH_Drawing_TextAlign(2);
33 /// Justified, which means that each line (except the last line) is stretched so that every line has equal width,
34 /// and the left and right margins are straight.
35 pub const TEXT_ALIGN_JUSTIFY: OH_Drawing_TextAlign = OH_Drawing_TextAlign(3);
36 /// <b>TEXT_ALIGN_START</b> achieves the same effect as <b>TEXT_ALIGN_LEFT</b>
37 /// when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_LTR</b>;
38 /// it achieves the same effect as <b>TEXT_ALIGN_RIGHT</b>
39 /// when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_RTL</b>.
40 pub const TEXT_ALIGN_START: OH_Drawing_TextAlign = OH_Drawing_TextAlign(4);
41 /// <b>TEXT_ALIGN_END</b> achieves the same effect as <b>TEXT_ALIGN_RIGHT</b>
42 /// when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_LTR</b>;
43 /// it achieves the same effect as <b>TEXT_ALIGN_LEFT</b>
44 /// when <b>OH_Drawing_TextDirection</b> is <b>TEXT_DIRECTION_RTL</b>.
45 pub const TEXT_ALIGN_END: OH_Drawing_TextAlign = OH_Drawing_TextAlign(5);
46}
47#[repr(transparent)]
48/// Enumerates text alignment modes.
49///
50///
51/// Available since API-level: 8
52///
53/// Version: 1.0
54#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
55pub struct OH_Drawing_TextAlign(pub ::core::ffi::c_uint);
56impl OH_Drawing_FontWeight {
57 /// Thin
58 pub const FONT_WEIGHT_100: OH_Drawing_FontWeight = OH_Drawing_FontWeight(0);
59 /// Extra-light
60 pub const FONT_WEIGHT_200: OH_Drawing_FontWeight = OH_Drawing_FontWeight(1);
61 /// Light
62 pub const FONT_WEIGHT_300: OH_Drawing_FontWeight = OH_Drawing_FontWeight(2);
63 /// Normal/Regular
64 pub const FONT_WEIGHT_400: OH_Drawing_FontWeight = OH_Drawing_FontWeight(3);
65 /// Medium
66 pub const FONT_WEIGHT_500: OH_Drawing_FontWeight = OH_Drawing_FontWeight(4);
67 /// Semi-bold
68 pub const FONT_WEIGHT_600: OH_Drawing_FontWeight = OH_Drawing_FontWeight(5);
69 /// Bold
70 pub const FONT_WEIGHT_700: OH_Drawing_FontWeight = OH_Drawing_FontWeight(6);
71 /// Extra-bold
72 pub const FONT_WEIGHT_800: OH_Drawing_FontWeight = OH_Drawing_FontWeight(7);
73 /// Black
74 pub const FONT_WEIGHT_900: OH_Drawing_FontWeight = OH_Drawing_FontWeight(8);
75}
76#[repr(transparent)]
77/// Enumerates font weights.
78///
79///
80/// Available since API-level: 8
81///
82/// Version: 1.0
83#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
84pub struct OH_Drawing_FontWeight(pub ::core::ffi::c_uint);
85impl OH_Drawing_TextBaseline {
86 /// Alphabetic, where the letters in alphabets like English sit on.
87 pub const TEXT_BASELINE_ALPHABETIC: OH_Drawing_TextBaseline = OH_Drawing_TextBaseline(0);
88 /// Ideographic. The baseline is at the bottom of the text area.
89 pub const TEXT_BASELINE_IDEOGRAPHIC: OH_Drawing_TextBaseline = OH_Drawing_TextBaseline(1);
90}
91#[repr(transparent)]
92/// Enumerates text baselines.
93///
94///
95/// Available since API-level: 8
96///
97/// Version: 1.0
98#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
99pub struct OH_Drawing_TextBaseline(pub ::core::ffi::c_uint);
100impl OH_Drawing_TextDecoration {
101 /// No decoration.
102 pub const TEXT_DECORATION_NONE: OH_Drawing_TextDecoration = OH_Drawing_TextDecoration(0);
103 /// A underline is used for decoration.
104 pub const TEXT_DECORATION_UNDERLINE: OH_Drawing_TextDecoration = OH_Drawing_TextDecoration(1);
105 /// An overline is used for decoration.
106 pub const TEXT_DECORATION_OVERLINE: OH_Drawing_TextDecoration = OH_Drawing_TextDecoration(2);
107 /// A strikethrough is used for decoration.
108 pub const TEXT_DECORATION_LINE_THROUGH: OH_Drawing_TextDecoration =
109 OH_Drawing_TextDecoration(4);
110}
111#[repr(transparent)]
112/// Enumerates text decorations.
113///
114///
115/// Available since API-level: 8
116///
117/// Version: 1.0
118#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
119pub struct OH_Drawing_TextDecoration(pub ::core::ffi::c_uint);
120impl OH_Drawing_FontStyle {
121 /// Normal style
122 pub const FONT_STYLE_NORMAL: OH_Drawing_FontStyle = OH_Drawing_FontStyle(0);
123 /// Italic style
124 pub const FONT_STYLE_ITALIC: OH_Drawing_FontStyle = OH_Drawing_FontStyle(1);
125 /// Oblique style
126 pub const FONT_STYLE_OBLIQUE: OH_Drawing_FontStyle = OH_Drawing_FontStyle(2);
127}
128#[repr(transparent)]
129/// Enumerates font styles.
130///
131///
132/// Available since API-level: 8
133///
134/// Version: 1.0
135#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
136pub struct OH_Drawing_FontStyle(pub ::core::ffi::c_uint);
137#[cfg(feature = "api-11")]
138#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
139impl OH_Drawing_PlaceholderVerticalAlignment {
140 /// Offset At Baseline
141 pub const ALIGNMENT_OFFSET_AT_BASELINE: OH_Drawing_PlaceholderVerticalAlignment =
142 OH_Drawing_PlaceholderVerticalAlignment(0);
143 /// Above Baseline
144 pub const ALIGNMENT_ABOVE_BASELINE: OH_Drawing_PlaceholderVerticalAlignment =
145 OH_Drawing_PlaceholderVerticalAlignment(1);
146 /// Below Baseline
147 pub const ALIGNMENT_BELOW_BASELINE: OH_Drawing_PlaceholderVerticalAlignment =
148 OH_Drawing_PlaceholderVerticalAlignment(2);
149 /// Top of Row Box
150 pub const ALIGNMENT_TOP_OF_ROW_BOX: OH_Drawing_PlaceholderVerticalAlignment =
151 OH_Drawing_PlaceholderVerticalAlignment(3);
152 /// Bottom of Row Box
153 pub const ALIGNMENT_BOTTOM_OF_ROW_BOX: OH_Drawing_PlaceholderVerticalAlignment =
154 OH_Drawing_PlaceholderVerticalAlignment(4);
155 /// Center of Row Box
156 pub const ALIGNMENT_CENTER_OF_ROW_BOX: OH_Drawing_PlaceholderVerticalAlignment =
157 OH_Drawing_PlaceholderVerticalAlignment(5);
158}
159#[repr(transparent)]
160/// Enumerates placeholder vertical alignment.
161///
162///
163/// Available since API-level: 11
164///
165/// Version: 1.0
166#[cfg(feature = "api-11")]
167#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
168#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
169pub struct OH_Drawing_PlaceholderVerticalAlignment(pub ::core::ffi::c_uint);
170/// Defines the placeholder span.
171///
172///
173/// Available since API-level: 11
174///
175/// Version: 1.0
176#[cfg(feature = "api-11")]
177#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
178#[repr(C)]
179#[derive(Debug, Copy, Clone)]
180pub struct OH_Drawing_PlaceholderSpan {
181 /// width of placeholder
182 pub width: f64,
183 /// height of placeholder
184 pub height: f64,
185 /// alignment of placeholder
186 pub alignment: OH_Drawing_PlaceholderVerticalAlignment,
187 /// baseline of placeholder
188 pub baseline: OH_Drawing_TextBaseline,
189 /// baselineoffset of placeholder
190 pub baselineOffset: f64,
191}
192#[cfg(feature = "api-11")]
193#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
194impl OH_Drawing_TextDecorationStyle {
195 /// Solid style
196 pub const TEXT_DECORATION_STYLE_SOLID: OH_Drawing_TextDecorationStyle =
197 OH_Drawing_TextDecorationStyle(0);
198 /// Double style
199 pub const TEXT_DECORATION_STYLE_DOUBLE: OH_Drawing_TextDecorationStyle =
200 OH_Drawing_TextDecorationStyle(1);
201 /// Dotted style
202 pub const TEXT_DECORATION_STYLE_DOTTED: OH_Drawing_TextDecorationStyle =
203 OH_Drawing_TextDecorationStyle(2);
204 /// Dashed style
205 pub const TEXT_DECORATION_STYLE_DASHED: OH_Drawing_TextDecorationStyle =
206 OH_Drawing_TextDecorationStyle(3);
207 /// Wavy style
208 pub const TEXT_DECORATION_STYLE_WAVY: OH_Drawing_TextDecorationStyle =
209 OH_Drawing_TextDecorationStyle(4);
210}
211#[repr(transparent)]
212/// Enumerates text decoration style.
213///
214///
215/// Available since API-level: 11
216///
217/// Version: 1.0
218#[cfg(feature = "api-11")]
219#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
220#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
221pub struct OH_Drawing_TextDecorationStyle(pub ::core::ffi::c_uint);
222#[cfg(feature = "api-11")]
223#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
224impl OH_Drawing_EllipsisModal {
225 /// Head modal
226 pub const ELLIPSIS_MODAL_HEAD: OH_Drawing_EllipsisModal = OH_Drawing_EllipsisModal(0);
227 /// Middle modal
228 pub const ELLIPSIS_MODAL_MIDDLE: OH_Drawing_EllipsisModal = OH_Drawing_EllipsisModal(1);
229 /// Tail modal
230 pub const ELLIPSIS_MODAL_TAIL: OH_Drawing_EllipsisModal = OH_Drawing_EllipsisModal(2);
231}
232#[repr(transparent)]
233/// Enumerates ellipsis modal.
234///
235///
236/// Available since API-level: 11
237///
238/// Version: 1.0
239#[cfg(feature = "api-11")]
240#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
241#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
242pub struct OH_Drawing_EllipsisModal(pub ::core::ffi::c_uint);
243#[cfg(feature = "api-11")]
244#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
245impl OH_Drawing_BreakStrategy {
246 /// Greedy strategy
247 pub const BREAK_STRATEGY_GREEDY: OH_Drawing_BreakStrategy = OH_Drawing_BreakStrategy(0);
248 /// Quality strategy
249 pub const BREAK_STRATEGY_HIGH_QUALITY: OH_Drawing_BreakStrategy = OH_Drawing_BreakStrategy(1);
250 /// Balanced strategy
251 pub const BREAK_STRATEGY_BALANCED: OH_Drawing_BreakStrategy = OH_Drawing_BreakStrategy(2);
252}
253#[repr(transparent)]
254/// Enumerates break strategy.
255///
256///
257/// Available since API-level: 11
258///
259/// Version: 1.0
260#[cfg(feature = "api-11")]
261#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
262#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
263pub struct OH_Drawing_BreakStrategy(pub ::core::ffi::c_uint);
264#[cfg(feature = "api-11")]
265#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
266impl OH_Drawing_WordBreakType {
267 /// Normal type
268 pub const WORD_BREAK_TYPE_NORMAL: OH_Drawing_WordBreakType = OH_Drawing_WordBreakType(0);
269 /// Break All type
270 pub const WORD_BREAK_TYPE_BREAK_ALL: OH_Drawing_WordBreakType = OH_Drawing_WordBreakType(1);
271 /// Break Word type
272 pub const WORD_BREAK_TYPE_BREAK_WORD: OH_Drawing_WordBreakType = OH_Drawing_WordBreakType(2);
273}
274#[repr(transparent)]
275/// Enumerates word break type.
276///
277///
278/// Available since API-level: 11
279///
280/// Version: 1.0
281#[cfg(feature = "api-11")]
282#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
283#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
284pub struct OH_Drawing_WordBreakType(pub ::core::ffi::c_uint);
285#[cfg(feature = "api-11")]
286#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
287impl OH_Drawing_RectHeightStyle {
288 /// Tight style
289 pub const RECT_HEIGHT_STYLE_TIGHT: OH_Drawing_RectHeightStyle = OH_Drawing_RectHeightStyle(0);
290 /// Max style
291 pub const RECT_HEIGHT_STYLE_MAX: OH_Drawing_RectHeightStyle = OH_Drawing_RectHeightStyle(1);
292 /// Includelinespacemiddle style
293 pub const RECT_HEIGHT_STYLE_INCLUDELINESPACEMIDDLE: OH_Drawing_RectHeightStyle =
294 OH_Drawing_RectHeightStyle(2);
295 /// Includelinespacetop style
296 pub const RECT_HEIGHT_STYLE_INCLUDELINESPACETOP: OH_Drawing_RectHeightStyle =
297 OH_Drawing_RectHeightStyle(3);
298 /// Includelinespacebottom style
299 pub const RECT_HEIGHT_STYLE_INCLUDELINESPACEBOTTOM: OH_Drawing_RectHeightStyle =
300 OH_Drawing_RectHeightStyle(4);
301 /// Struct style
302 pub const RECT_HEIGHT_STYLE_STRUCT: OH_Drawing_RectHeightStyle = OH_Drawing_RectHeightStyle(5);
303}
304#[repr(transparent)]
305/// Enumerates rect height style.
306///
307///
308/// Available since API-level: 11
309///
310/// Version: 1.0
311#[cfg(feature = "api-11")]
312#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
313#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
314pub struct OH_Drawing_RectHeightStyle(pub ::core::ffi::c_uint);
315#[cfg(feature = "api-11")]
316#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
317impl OH_Drawing_RectWidthStyle {
318 /// Tight style
319 pub const RECT_WIDTH_STYLE_TIGHT: OH_Drawing_RectWidthStyle = OH_Drawing_RectWidthStyle(0);
320 /// Max style
321 pub const RECT_WIDTH_STYLE_MAX: OH_Drawing_RectWidthStyle = OH_Drawing_RectWidthStyle(1);
322}
323#[repr(transparent)]
324/// Enumerates rect Width style.
325///
326///
327/// Available since API-level: 11
328///
329/// Version: 1.0
330#[cfg(feature = "api-11")]
331#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
332#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
333pub struct OH_Drawing_RectWidthStyle(pub ::core::ffi::c_uint);
334#[cfg(feature = "api-12")]
335#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
336impl OH_Drawing_FontConfigInfoErrorCode {
337 /// The list of system font configuration information was successfully obtained
338 pub const SUCCESS_FONT_CONFIG_INFO: OH_Drawing_FontConfigInfoErrorCode =
339 OH_Drawing_FontConfigInfoErrorCode(0);
340 /// Unknown error
341 pub const UNKNOWN: OH_Drawing_FontConfigInfoErrorCode = OH_Drawing_FontConfigInfoErrorCode(1);
342 /// Parse system config file error
343 pub const PARSE_FILE: OH_Drawing_FontConfigInfoErrorCode =
344 OH_Drawing_FontConfigInfoErrorCode(2);
345 /// Alloc memory error
346 pub const ALLOC_MEMORY: OH_Drawing_FontConfigInfoErrorCode =
347 OH_Drawing_FontConfigInfoErrorCode(3);
348 /// Copy string data error
349 pub const COPY_STRING_DATA: OH_Drawing_FontConfigInfoErrorCode =
350 OH_Drawing_FontConfigInfoErrorCode(4);
351}
352#[repr(transparent)]
353/// Gets system font configuration information list result enum.
354///
355///
356/// Available since API-level: 12
357///
358/// Version: 1.0
359#[cfg(feature = "api-12")]
360#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
361#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
362pub struct OH_Drawing_FontConfigInfoErrorCode(pub ::core::ffi::c_uint);
363/// Fallback font information.
364///
365///
366/// Available since API-level: 12
367///
368/// Version: 1.0
369#[cfg(feature = "api-12")]
370#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
371#[repr(C)]
372#[derive(Debug, Copy, Clone)]
373pub struct OH_Drawing_FontFallbackInfo {
374 /// The type of language supported by the font set. The language format is bcp47
375 pub language: *mut ::core::ffi::c_char,
376 /// Font family name
377 pub familyName: *mut ::core::ffi::c_char,
378}
379/// Fallback font group.
380///
381///
382/// Available since API-level: 12
383///
384/// Version: 1.0
385#[cfg(feature = "api-12")]
386#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
387#[repr(C)]
388pub struct OH_Drawing_FontFallbackGroup {
389 /// The name of the font set corresponding to the fallback font set. If the value is null,
390 /// all fonts can be set using the fallback font set list.
391 pub groupName: *mut ::core::ffi::c_char,
392 /// Fallback font Info Size
393 pub fallbackInfoSize: usize,
394 /// A list of font sets for fallback fonts
395 pub fallbackInfoSet: *mut OH_Drawing_FontFallbackInfo,
396}
397/// Font weight mapping information.
398///
399///
400/// Available since API-level: 12
401///
402/// Version: 1.0
403#[cfg(feature = "api-12")]
404#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
405#[repr(C)]
406#[derive(Debug, Copy, Clone)]
407pub struct OH_Drawing_FontAdjustInfo {
408 /// The font's original weight value
409 pub weight: ::core::ffi::c_int,
410 /// The font weight displayed in the application
411 pub to: ::core::ffi::c_int,
412}
413/// Alias font information.
414///
415///
416/// Available since API-level: 12
417///
418/// Version: 1.0
419#[cfg(feature = "api-12")]
420#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
421#[repr(C)]
422#[derive(Debug, Copy, Clone)]
423pub struct OH_Drawing_FontAliasInfo {
424 /// Font family name
425 pub familyName: *mut ::core::ffi::c_char,
426 /// Font weight value. When the weight value is greater than 0,
427 /// the font set contains only fonts with the specified weight.
428 /// When the weight value is equal to 0, the font set contains all fonts.
429 pub weight: ::core::ffi::c_int,
430}
431/// General font set information supported by the system.
432///
433///
434/// Available since API-level: 12
435///
436/// Version: 1.0
437#[cfg(feature = "api-12")]
438#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
439#[repr(C)]
440pub struct OH_Drawing_FontGenericInfo {
441 /// Font family name
442 pub familyName: *mut ::core::ffi::c_char,
443 /// The size of alias font lists
444 pub aliasInfoSize: usize,
445 /// The size of font weight mapping information lists
446 pub adjustInfoSize: usize,
447 /// List of alias fonts
448 pub aliasInfoSet: *mut OH_Drawing_FontAliasInfo,
449 /// Font weight mapping information lists
450 pub adjustInfoSet: *mut OH_Drawing_FontAdjustInfo,
451}
452/// System font configuration information.
453///
454///
455/// Available since API-level: 12
456///
457/// Version: 1.0
458#[cfg(feature = "api-12")]
459#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
460#[repr(C)]
461pub struct OH_Drawing_FontConfigInfo {
462 /// Count of system font file paths
463 pub fontDirSize: usize,
464 /// List size of generic font sets
465 pub fontGenericInfoSize: usize,
466 /// Count of fallback font set lists
467 pub fallbackGroupSize: usize,
468 /// List of system font file paths
469 pub fontDirSet: *mut *mut ::core::ffi::c_char,
470 /// List of generic font sets
471 pub fontGenericInfoSet: *mut OH_Drawing_FontGenericInfo,
472 /// List of fallback font sets
473 pub fallbackGroupSet: *mut OH_Drawing_FontFallbackGroup,
474}
475/// Describes the font information.
476///
477///
478/// Available since API-level: 12
479///
480/// Version: 1.0
481#[cfg(feature = "api-12")]
482#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
483#[repr(C)]
484#[derive(Debug, Copy, Clone)]
485pub struct OH_Drawing_FontDescriptor {
486 /// The file path of System font
487 pub path: *mut ::core::ffi::c_char,
488 /// A name that uniquely identifies the font
489 pub postScriptName: *mut ::core::ffi::c_char,
490 /// The name of System font
491 pub fullName: *mut ::core::ffi::c_char,
492 /// The family of System font
493 pub fontFamily: *mut ::core::ffi::c_char,
494 /// The subfont family of the system font
495 pub fontSubfamily: *mut ::core::ffi::c_char,
496 /// The weight of System font
497 pub weight: ::core::ffi::c_int,
498 /// The width of System font
499 pub width: ::core::ffi::c_int,
500 /// Whether the system font is tilted
501 pub italic: ::core::ffi::c_int,
502 /// Whether the system font is compact
503 pub monoSpace: bool,
504 /// whether symbolic fonts are supported
505 pub symbolic: bool,
506}
507/// The metrics of line.
508///
509///
510/// Available since API-level: 12
511///
512/// Version: 1.0
513#[cfg(feature = "api-12")]
514#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
515#[repr(C)]
516pub struct OH_Drawing_LineMetrics {
517 /// Text ascender height
518 pub ascender: f64,
519 /// Tex descender height
520 pub descender: f64,
521 /// The height of a capital letter
522 pub capHeight: f64,
523 /// The height of a lowercase letter
524 pub xHeight: f64,
525 /// Text width
526 pub width: f64,
527 /// Line height
528 pub height: f64,
529 /// The distance from the left end of the text to the left end of the container,
530 /// aligned to 0, is the width of the container minus the width of the line of text
531 pub x: f64,
532 /// The height from the top of the text to the top of the container, the first line is 0,
533 /// and the second line is the height of the first line
534 pub y: f64,
535 /// Start Index
536 pub startIndex: usize,
537 /// End Index
538 pub endIndex: usize,
539 /// The metrics information of the first character
540 pub firstCharMetrics: OH_Drawing_Font_Metrics,
541}
542#[cfg(feature = "api-12")]
543#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
544impl OH_Drawing_TextHeightBehavior {
545 /// both ascend of first row and last row style
546 pub const TEXT_HEIGHT_ALL: OH_Drawing_TextHeightBehavior = OH_Drawing_TextHeightBehavior(0);
547 /// forbidding ascend of first row style
548 pub const TEXT_HEIGHT_DISABLE_FIRST_ASCENT: OH_Drawing_TextHeightBehavior =
549 OH_Drawing_TextHeightBehavior(1);
550 /// forbidding ascend of last row style
551 pub const TEXT_HEIGHT_DISABLE_LAST_ASCENT: OH_Drawing_TextHeightBehavior =
552 OH_Drawing_TextHeightBehavior(2);
553 /// neither ascend of first row nor last row style
554 pub const TEXT_HEIGHT_DISABLE_ALL: OH_Drawing_TextHeightBehavior =
555 OH_Drawing_TextHeightBehavior(3);
556}
557#[repr(transparent)]
558/// Enumerates of heightmode of text.
559///
560///
561/// Available since API-level: 12
562///
563/// Version: 1.0
564#[cfg(feature = "api-12")]
565#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
566#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
567pub struct OH_Drawing_TextHeightBehavior(pub ::core::ffi::c_uint);
568#[cfg(feature = "api-12")]
569#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
570impl OH_Drawing_TextStyleType {
571 /// None style
572 pub const TEXT_STYLE_NONE: OH_Drawing_TextStyleType = OH_Drawing_TextStyleType(0);
573 /// All attributes style
574 pub const TEXT_STYLE_ALL_ATTRIBUTES: OH_Drawing_TextStyleType = OH_Drawing_TextStyleType(1);
575 /// Font style
576 pub const TEXT_STYLE_FONT: OH_Drawing_TextStyleType = OH_Drawing_TextStyleType(2);
577 /// Foreground style
578 pub const TEXT_STYLE_FOREGROUND: OH_Drawing_TextStyleType = OH_Drawing_TextStyleType(3);
579 /// Background style
580 pub const TEXT_STYLE_BACKGROUND: OH_Drawing_TextStyleType = OH_Drawing_TextStyleType(4);
581 /// Shadow style
582 pub const TEXT_STYLE_SHADOW: OH_Drawing_TextStyleType = OH_Drawing_TextStyleType(5);
583 /// Decorations style
584 pub const TEXT_STYLE_DECORATIONS: OH_Drawing_TextStyleType = OH_Drawing_TextStyleType(6);
585 /// Letter spacing style
586 pub const TEXT_STYLE_LETTER_SPACING: OH_Drawing_TextStyleType = OH_Drawing_TextStyleType(7);
587 /// Word spacing style
588 pub const TEXT_STYLE_WORD_SPACING: OH_Drawing_TextStyleType = OH_Drawing_TextStyleType(8);
589}
590#[repr(transparent)]
591/// Enumerates text style type.
592///
593///
594/// Available since API-level: 12
595///
596/// Version: 1.0
597#[cfg(feature = "api-12")]
598#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
599#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
600pub struct OH_Drawing_TextStyleType(pub ::core::ffi::c_uint);
601#[cfg(feature = "api-12")]
602#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
603impl OH_Drawing_FontWidth {
604 pub const FONT_WIDTH_ULTRA_CONDENSED: OH_Drawing_FontWidth = OH_Drawing_FontWidth(1);
605 pub const FONT_WIDTH_EXTRA_CONDENSED: OH_Drawing_FontWidth = OH_Drawing_FontWidth(2);
606 pub const FONT_WIDTH_CONDENSED: OH_Drawing_FontWidth = OH_Drawing_FontWidth(3);
607 pub const FONT_WIDTH_SEMI_CONDENSED: OH_Drawing_FontWidth = OH_Drawing_FontWidth(4);
608 pub const FONT_WIDTH_NORMAL: OH_Drawing_FontWidth = OH_Drawing_FontWidth(5);
609 pub const FONT_WIDTH_SEMI_EXPANDED: OH_Drawing_FontWidth = OH_Drawing_FontWidth(6);
610 pub const FONT_WIDTH_EXPANDED: OH_Drawing_FontWidth = OH_Drawing_FontWidth(7);
611 pub const FONT_WIDTH_EXTRA_EXPANDED: OH_Drawing_FontWidth = OH_Drawing_FontWidth(8);
612 pub const FONT_WIDTH_ULTRA_EXPANDED: OH_Drawing_FontWidth = OH_Drawing_FontWidth(9);
613}
614#[repr(transparent)]
615/// Enumerates font width.
616///
617///
618/// Available since API-level: 12
619///
620/// Version: 1.0
621#[cfg(feature = "api-12")]
622#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
623#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
624pub struct OH_Drawing_FontWidth(pub ::core::ffi::c_uint);
625/// Defines the font style struct.
626///
627///
628/// Available since API-level: 12
629///
630/// Version: 1.0
631#[cfg(feature = "api-12")]
632#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
633#[repr(C)]
634#[derive(Debug, Copy, Clone)]
635pub struct OH_Drawing_FontStyleStruct {
636 /// Font weight
637 pub weight: OH_Drawing_FontWeight,
638 /// Font width
639 pub width: OH_Drawing_FontWidth,
640 /// Font slant
641 pub slant: OH_Drawing_FontStyle,
642}
643/// Defines the fontfeature.
644///
645///
646/// Available since API-level: 12
647///
648/// Version: 1.0
649#[cfg(feature = "api-12")]
650#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
651#[repr(C)]
652#[derive(Debug, Copy, Clone)]
653pub struct OH_Drawing_FontFeature {
654 /// key of fontfeature
655 pub tag: *mut ::core::ffi::c_char,
656 /// value of fontfeature
657 pub value: ::core::ffi::c_int,
658}
659/// Defines StrutStyle info struct.
660///
661///
662/// Available since API-level: 12
663///
664/// Version: 1.0
665#[cfg(feature = "api-12")]
666#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
667#[repr(C)]
668pub struct OH_Drawing_StrutStyle {
669 /// The font weight to use when calculating the strut
670 pub weight: OH_Drawing_FontWeight,
671 /// The font style to use when calculating the strut
672 pub style: OH_Drawing_FontStyle,
673 /// The size of the ascent plus descent in logical pixels
674 pub size: f64,
675 /// The minimum height of the strut, as a multiple of fontSize
676 pub heightScale: f64,
677 /// Whether the height is override
678 pub heightOverride: bool,
679 /// Whether the halfleading is enable
680 pub halfLeading: bool,
681 /// The additional leading to apply to the strut as a multiple of Size
682 pub leading: f64,
683 /// Whether the strut height should be forced
684 pub forceStrutHeight: bool,
685 /// The size of font families
686 pub familiesSize: usize,
687 /// The families of the font to use when calculating the strut
688 pub families: *mut *mut ::core::ffi::c_char,
689}
690extern "C" {
691 /// Creates an <b>OH_Drawing_TypographyStyle</b> object.
692 ///
693 ///
694 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
695 ///
696 /// # Returns
697 ///
698 /// * Returns the pointer to the <b>OH_Drawing_TypographyStyle</b> object created.
699 ///
700 /// Available since API-level: 8
701 ///
702 /// Version: 1.0
703 pub fn OH_Drawing_CreateTypographyStyle() -> *mut OH_Drawing_TypographyStyle;
704 /// Releases the memory occupied by an <b>OH_Drawing_TypographyStyle</b> object.
705 ///
706 ///
707 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
708 /// # Arguments
709 ///
710 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
711 ///
712 /// Available since API-level: 8
713 ///
714 /// Version: 1.0
715 pub fn OH_Drawing_DestroyTypographyStyle(style: *mut OH_Drawing_TypographyStyle);
716 /// Sets the text direction.
717 ///
718 ///
719 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
720 /// # Arguments
721 ///
722 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
723 ///
724 /// * `direction` - Indicates the text direction to set. For details, see the enum <b>OH_Drawing_TextDirection</b>.
725 ///
726 /// Available since API-level: 8
727 ///
728 /// Version: 1.0
729 pub fn OH_Drawing_SetTypographyTextDirection(
730 style: *mut OH_Drawing_TypographyStyle,
731 direction: ::core::ffi::c_int,
732 );
733 /// Sets the text alignment mode.
734 ///
735 ///
736 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
737 /// # Arguments
738 ///
739 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
740 ///
741 /// * `align` - Indicates the text alignment mode to set. For details, see the enum <b>OH_Drawing_TextAlign</b>.
742 ///
743 /// Available since API-level: 8
744 ///
745 /// Version: 1.0
746 pub fn OH_Drawing_SetTypographyTextAlign(
747 style: *mut OH_Drawing_TypographyStyle,
748 align: ::core::ffi::c_int,
749 );
750 /// Sets the maximum number of lines in a text file.
751 ///
752 ///
753 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
754 /// # Arguments
755 ///
756 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
757 ///
758 /// * `lineNumber` - Indicates the maximum number of lines to set.
759 ///
760 /// Available since API-level: 8
761 ///
762 /// Version: 1.0
763 pub fn OH_Drawing_SetTypographyTextMaxLines(
764 style: *mut OH_Drawing_TypographyStyle,
765 lineNumber: ::core::ffi::c_int,
766 );
767 /// Creates an <b>OH_Drawing_TextStyle</b> object.
768 ///
769 ///
770 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
771 ///
772 /// # Returns
773 ///
774 /// * Returns the pointer to the <b>OH_Drawing_TextStyle</b> object created.
775 ///
776 /// Available since API-level: 8
777 ///
778 /// Version: 1.0
779 pub fn OH_Drawing_CreateTextStyle() -> *mut OH_Drawing_TextStyle;
780 /// Releases the memory occupied by an <b>OH_Drawing_TextStyle</b> object.
781 ///
782 ///
783 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
784 /// # Arguments
785 ///
786 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
787 ///
788 /// Available since API-level: 8
789 ///
790 /// Version: 1.0
791 pub fn OH_Drawing_DestroyTextStyle(style: *mut OH_Drawing_TextStyle);
792 /// Sets the text color.
793 ///
794 ///
795 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
796 /// # Arguments
797 ///
798 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
799 ///
800 /// * `color` - Indicates the color to set.
801 ///
802 /// Available since API-level: 8
803 ///
804 /// Version: 1.0
805 pub fn OH_Drawing_SetTextStyleColor(style: *mut OH_Drawing_TextStyle, color: u32);
806 /// Sets the font size.
807 ///
808 ///
809 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
810 /// # Arguments
811 ///
812 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
813 ///
814 /// * `fontSize` - Indicates the font size to set.
815 ///
816 /// Available since API-level: 8
817 ///
818 /// Version: 1.0
819 pub fn OH_Drawing_SetTextStyleFontSize(style: *mut OH_Drawing_TextStyle, fontSize: f64);
820 /// Sets the font weight.
821 ///
822 ///
823 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
824 /// # Arguments
825 ///
826 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
827 ///
828 /// * `fontWeight` - Indicates the font weight to set. For details, see the enum <b>OH_Drawing_FontWeight</b>.
829 ///
830 /// Available since API-level: 8
831 ///
832 /// Version: 1.0
833 pub fn OH_Drawing_SetTextStyleFontWeight(
834 style: *mut OH_Drawing_TextStyle,
835 fontWeight: ::core::ffi::c_int,
836 );
837 /// Sets the text baseline.
838 ///
839 ///
840 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
841 /// # Arguments
842 ///
843 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
844 ///
845 /// * `baseline` - Indicates the text baseline to set. For details, see the enum <b>OH_Drawing_TextBaseline</b>.
846 ///
847 /// Available since API-level: 8
848 ///
849 /// Version: 1.0
850 pub fn OH_Drawing_SetTextStyleBaseLine(
851 style: *mut OH_Drawing_TextStyle,
852 baseline: ::core::ffi::c_int,
853 );
854 /// Sets the text decoration.
855 ///
856 ///
857 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
858 /// # Arguments
859 ///
860 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
861 ///
862 /// * `decoration` - Indicates the text decoration to set. For details, see the enum <b>OH_Drawing_TextDecoration</b>.
863 ///
864 /// Available since API-level: 8
865 ///
866 /// Version: 1.0
867 pub fn OH_Drawing_SetTextStyleDecoration(
868 style: *mut OH_Drawing_TextStyle,
869 decoration: ::core::ffi::c_int,
870 );
871 /// Sets the color for the text decoration.
872 ///
873 ///
874 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
875 /// # Arguments
876 ///
877 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
878 ///
879 /// * `color` - Indicates the color to set.
880 ///
881 /// Available since API-level: 8
882 ///
883 /// Version: 1.0
884 pub fn OH_Drawing_SetTextStyleDecorationColor(style: *mut OH_Drawing_TextStyle, color: u32);
885 /// Sets the font height.
886 ///
887 ///
888 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
889 /// # Arguments
890 ///
891 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
892 ///
893 /// * `fontHeight` - Indicates the font height to set.
894 ///
895 /// Available since API-level: 8
896 ///
897 /// Version: 1.0
898 pub fn OH_Drawing_SetTextStyleFontHeight(style: *mut OH_Drawing_TextStyle, fontHeight: f64);
899 /// Sets the font families.
900 ///
901 ///
902 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
903 /// # Arguments
904 ///
905 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
906 ///
907 /// * `fontFamiliesNumber` - Indicates the number of font families to set.
908 ///
909 /// * `fontFamilies` - Indicates the pointer to the font families to set.
910 ///
911 /// Available since API-level: 8
912 ///
913 /// Version: 1.0
914 pub fn OH_Drawing_SetTextStyleFontFamilies(
915 style: *mut OH_Drawing_TextStyle,
916 fontFamiliesNumber: ::core::ffi::c_int,
917 fontFamilies: *mut *const ::core::ffi::c_char,
918 );
919 /// Sets the font style.
920 ///
921 ///
922 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
923 /// # Arguments
924 ///
925 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
926 ///
927 /// * `fontStyle` - Indicates the font style to set. For details, see the enum <b>OH_Drawing_FontStyle</b>.
928 ///
929 /// Available since API-level: 8
930 ///
931 /// Version: 1.0
932 pub fn OH_Drawing_SetTextStyleFontStyle(
933 style: *mut OH_Drawing_TextStyle,
934 fontStyle: ::core::ffi::c_int,
935 );
936 /// Sets the locale.
937 ///
938 ///
939 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
940 /// # Arguments
941 ///
942 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
943 ///
944 /// * `locale` - Indicates the pointer to the locale to set.
945 ///
946 /// Available since API-level: 8
947 ///
948 /// Version: 1.0
949 pub fn OH_Drawing_SetTextStyleLocale(
950 style: *mut OH_Drawing_TextStyle,
951 locale: *const ::core::ffi::c_char,
952 );
953 /// Sets the foreground brush style.
954 ///
955 ///
956 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
957 /// # Arguments
958 ///
959 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
960 ///
961 /// * `foregroundBrush` - Indicates the pointer to a brush object <b>OH_Drawing_Brush</b>.
962 ///
963 /// Available since API-level: 12
964 ///
965 /// Version: 1.0
966 #[cfg(feature = "api-12")]
967 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
968 pub fn OH_Drawing_SetTextStyleForegroundBrush(
969 style: *mut OH_Drawing_TextStyle,
970 foregroundBrush: *mut OH_Drawing_Brush,
971 );
972 /// Gets the foreground brush style.
973 ///
974 ///
975 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
976 /// # Arguments
977 ///
978 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
979 ///
980 /// * `foregroundBrush` - Indicates the pointer to a brush object <b>OH_Drawing_Brush</b>.
981 ///
982 /// Available since API-level: 12
983 ///
984 /// Version: 1.0
985 #[cfg(feature = "api-12")]
986 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
987 pub fn OH_Drawing_TextStyleGetForegroundBrush(
988 style: *mut OH_Drawing_TextStyle,
989 foregroundBrush: *mut OH_Drawing_Brush,
990 );
991 /// Sets the foreground pen style.
992 ///
993 ///
994 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
995 /// # Arguments
996 ///
997 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
998 ///
999 /// * `foregroundPen` - Indicates the pointer to a pen object <b>OH_Drawing_Pen</b>.
1000 ///
1001 /// Available since API-level: 12
1002 ///
1003 /// Version: 1.0
1004 #[cfg(feature = "api-12")]
1005 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1006 pub fn OH_Drawing_SetTextStyleForegroundPen(
1007 style: *mut OH_Drawing_TextStyle,
1008 foregroundPen: *mut OH_Drawing_Pen,
1009 );
1010 /// Gets the foreground pen style.
1011 ///
1012 ///
1013 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1014 /// # Arguments
1015 ///
1016 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
1017 ///
1018 /// * `foregroundPen` - Indicates the pointer to a pen object <b>OH_Drawing_Pen</b>.
1019 ///
1020 /// Available since API-level: 12
1021 ///
1022 /// Version: 1.0
1023 #[cfg(feature = "api-12")]
1024 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1025 pub fn OH_Drawing_TextStyleGetForegroundPen(
1026 style: *mut OH_Drawing_TextStyle,
1027 foregroundPen: *mut OH_Drawing_Pen,
1028 );
1029 /// Sets the background brush style.
1030 ///
1031 ///
1032 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1033 /// # Arguments
1034 ///
1035 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
1036 ///
1037 /// * `foregroundPen` - Indicates the pointer to a brush object <b>OH_Drawing_Brush</b>.
1038 ///
1039 /// Available since API-level: 12
1040 ///
1041 /// Version: 1.0
1042 #[cfg(feature = "api-12")]
1043 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1044 pub fn OH_Drawing_SetTextStyleBackgroundBrush(
1045 style: *mut OH_Drawing_TextStyle,
1046 foregroundPen: *mut OH_Drawing_Brush,
1047 );
1048 /// Gets the background brush style.
1049 ///
1050 ///
1051 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1052 /// # Arguments
1053 ///
1054 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
1055 ///
1056 /// * `backgroundBrush` - Indicates the pointer to a brush object <b>OH_Drawing_Brush</b>.
1057 ///
1058 /// Available since API-level: 12
1059 ///
1060 /// Version: 1.0
1061 #[cfg(feature = "api-12")]
1062 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1063 pub fn OH_Drawing_TextStyleGetBackgroundBrush(
1064 style: *mut OH_Drawing_TextStyle,
1065 backgroundBrush: *mut OH_Drawing_Brush,
1066 );
1067 /// Sets the background pen style.
1068 ///
1069 ///
1070 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1071 /// # Arguments
1072 ///
1073 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
1074 ///
1075 /// * `backgroundPen` - Indicates the pointer to a pen object <b>OH_Drawing_Pen</b>.
1076 ///
1077 /// Available since API-level: 12
1078 ///
1079 /// Version: 1.0
1080 #[cfg(feature = "api-12")]
1081 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1082 pub fn OH_Drawing_SetTextStyleBackgroundPen(
1083 style: *mut OH_Drawing_TextStyle,
1084 backgroundPen: *mut OH_Drawing_Pen,
1085 );
1086 /// Gets the background pen style.
1087 ///
1088 ///
1089 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1090 /// # Arguments
1091 ///
1092 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
1093 ///
1094 /// * `backgroundPen` - Indicates the pointer to a pen object <b>OH_Drawing_Pen</b>.
1095 ///
1096 /// Available since API-level: 12
1097 ///
1098 /// Version: 1.0
1099 #[cfg(feature = "api-12")]
1100 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1101 pub fn OH_Drawing_TextStyleGetBackgroundPen(
1102 style: *mut OH_Drawing_TextStyle,
1103 backgroundPen: *mut OH_Drawing_Pen,
1104 );
1105 /// Creates a pointer to an <b>OH_Drawing_TypographyCreate</b> object.
1106 ///
1107 ///
1108 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1109 /// # Arguments
1110 ///
1111 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
1112 ///
1113 /// * `fontCollection` - Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.
1114 ///
1115 /// # Returns
1116 ///
1117 /// * Returns the pointer to the <b>OH_Drawing_TypographyCreate</b> object created.
1118 ///
1119 /// Available since API-level: 8
1120 ///
1121 /// Version: 1.0
1122 pub fn OH_Drawing_CreateTypographyHandler(
1123 style: *mut OH_Drawing_TypographyStyle,
1124 fontCollection: *mut OH_Drawing_FontCollection,
1125 ) -> *mut OH_Drawing_TypographyCreate;
1126 /// Releases the memory occupied by an <b>OH_Drawing_TypographyCreate</b> object.
1127 ///
1128 ///
1129 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1130 /// # Arguments
1131 ///
1132 /// * `handler` - Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
1133 ///
1134 /// Available since API-level: 8
1135 ///
1136 /// Version: 1.0
1137 pub fn OH_Drawing_DestroyTypographyHandler(handler: *mut OH_Drawing_TypographyCreate);
1138 /// Sets the text style.
1139 ///
1140 ///
1141 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1142 /// # Arguments
1143 ///
1144 /// * `handler` - Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
1145 ///
1146 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
1147 ///
1148 /// Available since API-level: 8
1149 ///
1150 /// Version: 1.0
1151 pub fn OH_Drawing_TypographyHandlerPushTextStyle(
1152 handler: *mut OH_Drawing_TypographyCreate,
1153 style: *mut OH_Drawing_TextStyle,
1154 );
1155 /// Sets the text content.
1156 ///
1157 ///
1158 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1159 /// # Arguments
1160 ///
1161 /// * `handler` - Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
1162 ///
1163 /// * `text` - Indicates the pointer to the text content to set.
1164 ///
1165 /// Available since API-level: 8
1166 ///
1167 /// Version: 1.0
1168 pub fn OH_Drawing_TypographyHandlerAddText(
1169 handler: *mut OH_Drawing_TypographyCreate,
1170 text: *const ::core::ffi::c_char,
1171 );
1172 /// Removes the topmost style in the stack, leaving the remaining styles in effect.
1173 ///
1174 ///
1175 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1176 /// # Arguments
1177 ///
1178 /// * `handler` - Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
1179 ///
1180 /// Available since API-level: 8
1181 ///
1182 /// Version: 1.0
1183 pub fn OH_Drawing_TypographyHandlerPopTextStyle(handler: *mut OH_Drawing_TypographyCreate);
1184 /// Creates an <b>OH_Drawing_Typography</b> object.
1185 ///
1186 ///
1187 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1188 /// # Arguments
1189 ///
1190 /// * `handler` - Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
1191 ///
1192 /// # Returns
1193 ///
1194 /// * Returns the pointer to the <b>OH_Drawing_Typography</b> object created.
1195 ///
1196 /// Available since API-level: 8
1197 ///
1198 /// Version: 1.0
1199 pub fn OH_Drawing_CreateTypography(
1200 handler: *mut OH_Drawing_TypographyCreate,
1201 ) -> *mut OH_Drawing_Typography;
1202 /// Releases the memory occupied by an <b>OH_Drawing_Typography</b> object.
1203 ///
1204 ///
1205 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1206 /// # Arguments
1207 ///
1208 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1209 ///
1210 /// Available since API-level: 8
1211 ///
1212 /// Version: 1.0
1213 pub fn OH_Drawing_DestroyTypography(typography: *mut OH_Drawing_Typography);
1214 /// Lays out the typography.
1215 ///
1216 ///
1217 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1218 /// # Arguments
1219 ///
1220 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1221 ///
1222 /// * `maxWidth` - Indicates the maximum text width to set.
1223 ///
1224 /// Available since API-level: 8
1225 ///
1226 /// Version: 1.0
1227 pub fn OH_Drawing_TypographyLayout(typography: *mut OH_Drawing_Typography, maxWidth: f64);
1228 /// Paints text on the canvas.
1229 ///
1230 ///
1231 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1232 /// # Arguments
1233 ///
1234 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1235 ///
1236 /// * `canvas` - Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
1237 ///
1238 /// * `potisionX` - Indicates the x coordinate.
1239 ///
1240 /// * `potisionY` - Indicates the y coordinate.
1241 ///
1242 /// Available since API-level: 8
1243 ///
1244 /// Version: 1.0
1245 pub fn OH_Drawing_TypographyPaint(
1246 typography: *mut OH_Drawing_Typography,
1247 canvas: *mut OH_Drawing_Canvas,
1248 potisionX: f64,
1249 potisionY: f64,
1250 );
1251 /// Paints path text on the canvas.
1252 ///
1253 ///
1254 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1255 /// # Arguments
1256 ///
1257 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1258 ///
1259 /// * `canvas` - Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
1260 ///
1261 /// * `path` - Indicates path information.
1262 ///
1263 /// * `hOffset` - Indicates the distance along the path to add to the text's starting position.
1264 ///
1265 /// * `vOffset` - Indicates the distance above(-) or below(+) the path to position the text.
1266 ///
1267 /// Available since API-level: 12
1268 ///
1269 /// Version: 1.0
1270 #[cfg(feature = "api-12")]
1271 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1272 pub fn OH_Drawing_TypographyPaintOnPath(
1273 typography: *mut OH_Drawing_Typography,
1274 canvas: *mut OH_Drawing_Canvas,
1275 path: *mut OH_Drawing_Path,
1276 hOffset: f64,
1277 vOffset: f64,
1278 );
1279 /// Gets the max width.
1280 ///
1281 ///
1282 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1283 /// # Arguments
1284 ///
1285 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1286 ///
1287 /// # Returns
1288 ///
1289 /// * Returns the max width.
1290 ///
1291 /// Available since API-level: 9
1292 ///
1293 /// Version: 1.1
1294 pub fn OH_Drawing_TypographyGetMaxWidth(typography: *mut OH_Drawing_Typography) -> f64;
1295 /// Gets the height.
1296 ///
1297 ///
1298 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1299 /// # Arguments
1300 ///
1301 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1302 ///
1303 /// # Returns
1304 ///
1305 /// * Returns the height.
1306 ///
1307 /// Available since API-level: 9
1308 ///
1309 /// Version: 1.1
1310 pub fn OH_Drawing_TypographyGetHeight(typography: *mut OH_Drawing_Typography) -> f64;
1311 /// Obtains the width of the longest line. You are advised to round up the return value in actual use.
1312 /// When the text content is empty, the minimum float value,
1313 /// that is, -340282346638528859811704183484516925440.000000, is returned.
1314 ///
1315 ///
1316 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1317 /// # Arguments
1318 ///
1319 /// * `typography` - Pointer to an <b>OH_Drawing_Typography</b> object, which is obtained by
1320 /// [`OH_Drawing_CreateTypography`].
1321 ///
1322 /// # Returns
1323 ///
1324 /// * Returns the width of the longest line.
1325 ///
1326 /// Available since API-level: 9
1327 ///
1328 /// Version: 1.1
1329 pub fn OH_Drawing_TypographyGetLongestLine(typography: *mut OH_Drawing_Typography) -> f64;
1330 /// Obtains the width of the longest line with indent. You are advised to
1331 /// round up the return value in actual use. When the text content is empty, the
1332 /// minimum float value, that is, 0.0, is returned.
1333 ///
1334 ///
1335 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1336 /// # Arguments
1337 ///
1338 /// * `typography` - Pointer to an <b>OH_Drawing_Typography</b> object, which is obtained by
1339 /// [`OH_Drawing_CreateTypography`].
1340 ///
1341 /// # Returns
1342 ///
1343 /// * Returns the width of the longest line with indent.
1344 ///
1345 /// Available since API-level: 13
1346 ///
1347 /// Version: 1.1
1348 #[cfg(feature = "api-13")]
1349 #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
1350 pub fn OH_Drawing_TypographyGetLongestLineWithIndent(
1351 typography: *mut OH_Drawing_Typography,
1352 ) -> f64;
1353 /// Gets the min intrinsic width.
1354 ///
1355 ///
1356 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1357 /// # Arguments
1358 ///
1359 /// * `typography` - the pointer to an <b>OH_Drawing_Typography</b> object.
1360 ///
1361 /// # Returns
1362 ///
1363 /// * Returns the min intrinsic width.
1364 ///
1365 /// Available since API-level: 9
1366 ///
1367 /// Version: 1.1
1368 pub fn OH_Drawing_TypographyGetMinIntrinsicWidth(typography: *mut OH_Drawing_Typography)
1369 -> f64;
1370 /// Gets the max intrinsic width.
1371 ///
1372 ///
1373 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1374 /// # Arguments
1375 ///
1376 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1377 ///
1378 /// # Returns
1379 ///
1380 /// * Returns the max intrinsic width.
1381 ///
1382 /// Available since API-level: 9
1383 ///
1384 /// Version: 1.1
1385 pub fn OH_Drawing_TypographyGetMaxIntrinsicWidth(typography: *mut OH_Drawing_Typography)
1386 -> f64;
1387 /// Gets the alphabetic baseline.
1388 ///
1389 ///
1390 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1391 /// # Arguments
1392 ///
1393 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1394 ///
1395 /// # Returns
1396 ///
1397 /// * Returns the alphabetic baseline.
1398 ///
1399 /// Available since API-level: 9
1400 ///
1401 /// Version: 1.1
1402 pub fn OH_Drawing_TypographyGetAlphabeticBaseline(
1403 typography: *mut OH_Drawing_Typography,
1404 ) -> f64;
1405 /// Gets the ideographic baseline.
1406 ///
1407 ///
1408 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1409 /// # Arguments
1410 ///
1411 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1412 ///
1413 /// # Returns
1414 ///
1415 /// * Returns the ideographic baseline.
1416 ///
1417 /// Available since API-level: 9
1418 ///
1419 /// Version: 1.1
1420 pub fn OH_Drawing_TypographyGetIdeographicBaseline(
1421 typography: *mut OH_Drawing_Typography,
1422 ) -> f64;
1423 /// Sets the placeholder.
1424 ///
1425 ///
1426 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1427 /// # Arguments
1428 ///
1429 /// * `handler` - Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
1430 ///
1431 /// * `span` - Indicates the pointer to an <b>OH_Drawing_PlaceholderSpan</b> object.
1432 ///
1433 /// Available since API-level: 11
1434 ///
1435 /// Version: 1.0
1436 #[cfg(feature = "api-11")]
1437 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1438 pub fn OH_Drawing_TypographyHandlerAddPlaceholder(
1439 handler: *mut OH_Drawing_TypographyCreate,
1440 span: *mut OH_Drawing_PlaceholderSpan,
1441 );
1442 /// Gets the exceed maxLines.
1443 ///
1444 ///
1445 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1446 /// # Arguments
1447 ///
1448 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1449 ///
1450 /// # Returns
1451 ///
1452 /// * Returns the exceed maxLines.
1453 ///
1454 /// Available since API-level: 11
1455 ///
1456 /// Version: 1.0
1457 #[cfg(feature = "api-11")]
1458 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1459 pub fn OH_Drawing_TypographyDidExceedMaxLines(typography: *mut OH_Drawing_Typography) -> bool;
1460 /// Gets the rects for range.
1461 ///
1462 ///
1463 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1464 /// # Arguments
1465 ///
1466 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1467 ///
1468 /// * `start` - Indicates the start of range to set.
1469 ///
1470 /// * `end` - Indicates the end of range to set.
1471 ///
1472 /// * `heightStyle` - Indicates the height style to set.
1473 /// For details, see the enum <b>OH_Drawing_RectHeightStyle</b>.
1474 ///
1475 /// * `widthStyle` - Indicates the width style to set.
1476 /// For details, see the enum <b>OH_Drawing_RectWidthStyle</b>.
1477 ///
1478 /// # Returns
1479 ///
1480 /// * Returns the rects for range.
1481 ///
1482 /// Available since API-level: 11
1483 ///
1484 /// Version: 1.0
1485 #[cfg(feature = "api-11")]
1486 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1487 pub fn OH_Drawing_TypographyGetRectsForRange(
1488 typography: *mut OH_Drawing_Typography,
1489 start: usize,
1490 end: usize,
1491 heightStyle: OH_Drawing_RectHeightStyle,
1492 widthStyle: OH_Drawing_RectWidthStyle,
1493 ) -> *mut OH_Drawing_TextBox;
1494 /// Gets the rects for placeholders.
1495 ///
1496 ///
1497 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1498 /// # Arguments
1499 ///
1500 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1501 ///
1502 /// # Returns
1503 ///
1504 /// * Returns the rects for placeholders.
1505 ///
1506 /// Available since API-level: 11
1507 ///
1508 /// Version: 1.0
1509 #[cfg(feature = "api-11")]
1510 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1511 pub fn OH_Drawing_TypographyGetRectsForPlaceholders(
1512 typography: *mut OH_Drawing_Typography,
1513 ) -> *mut OH_Drawing_TextBox;
1514 /// Gets left from textbox.
1515 ///
1516 ///
1517 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1518 /// # Arguments
1519 ///
1520 /// * `textbox` - Indicates the pointer to an <b>OH_Drawing_TextBox</b> object.
1521 ///
1522 /// * `index` - Indicates the index of textbox.
1523 ///
1524 /// # Returns
1525 ///
1526 /// * Returns left from textbox.
1527 ///
1528 /// Available since API-level: 11
1529 ///
1530 /// Version: 1.0
1531 #[cfg(feature = "api-11")]
1532 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1533 pub fn OH_Drawing_GetLeftFromTextBox(
1534 textbox: *mut OH_Drawing_TextBox,
1535 index: ::core::ffi::c_int,
1536 ) -> f32;
1537 /// Gets right from textbox.
1538 ///
1539 ///
1540 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1541 /// # Arguments
1542 ///
1543 /// * `textbox` - Indicates the pointer to an <b>OH_Drawing_TextBox</b> object.
1544 ///
1545 /// * `index` - Indicates the index of textbox.
1546 ///
1547 /// # Returns
1548 ///
1549 /// * Returns right from textbox.
1550 ///
1551 /// Available since API-level: 11
1552 ///
1553 /// Version: 1.0
1554 #[cfg(feature = "api-11")]
1555 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1556 pub fn OH_Drawing_GetRightFromTextBox(
1557 textbox: *mut OH_Drawing_TextBox,
1558 index: ::core::ffi::c_int,
1559 ) -> f32;
1560 /// Gets top from textbox.
1561 ///
1562 ///
1563 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1564 /// # Arguments
1565 ///
1566 /// * `textbox` - Indicates the pointer to an <b>OH_Drawing_TextBox</b> object.
1567 ///
1568 /// * `index` - Indicates the index of textbox.
1569 ///
1570 /// # Returns
1571 ///
1572 /// * Returns top from textbox.
1573 ///
1574 /// Available since API-level: 11
1575 ///
1576 /// Version: 1.0
1577 #[cfg(feature = "api-11")]
1578 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1579 pub fn OH_Drawing_GetTopFromTextBox(
1580 textbox: *mut OH_Drawing_TextBox,
1581 index: ::core::ffi::c_int,
1582 ) -> f32;
1583 /// Gets bottom from textbox.
1584 ///
1585 ///
1586 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1587 /// # Arguments
1588 ///
1589 /// * `textbox` - Indicates the pointer to an <b>OH_Drawing_TextBox</b> object.
1590 ///
1591 /// * `index` - Indicates the index of textbox.
1592 ///
1593 /// # Returns
1594 ///
1595 /// * Returns bottom from textbox.
1596 ///
1597 /// Available since API-level: 11
1598 ///
1599 /// Version: 1.0
1600 #[cfg(feature = "api-11")]
1601 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1602 pub fn OH_Drawing_GetBottomFromTextBox(
1603 textbox: *mut OH_Drawing_TextBox,
1604 index: ::core::ffi::c_int,
1605 ) -> f32;
1606 /// Gets direction from textbox.
1607 ///
1608 ///
1609 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1610 /// # Arguments
1611 ///
1612 /// * `textbox` - Indicates the pointer to an <b>OH_Drawing_TextBox</b> object.
1613 ///
1614 /// * `index` - Indicates the index of textbox.
1615 ///
1616 /// # Returns
1617 ///
1618 /// * Returns direction from textbox.
1619 ///
1620 /// Available since API-level: 11
1621 ///
1622 /// Version: 1.0
1623 #[cfg(feature = "api-11")]
1624 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1625 pub fn OH_Drawing_GetTextDirectionFromTextBox(
1626 textbox: *mut OH_Drawing_TextBox,
1627 index: ::core::ffi::c_int,
1628 ) -> ::core::ffi::c_int;
1629 /// Gets size of textBox.
1630 ///
1631 ///
1632 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1633 /// # Arguments
1634 ///
1635 /// * `textBox` - Indicates the pointer to an <b>OH_Drawing_TextBox</b> object.
1636 ///
1637 /// # Returns
1638 ///
1639 /// * Returns size of textBox.
1640 ///
1641 /// Available since API-level: 11
1642 ///
1643 /// Version: 1.0
1644 #[cfg(feature = "api-11")]
1645 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1646 pub fn OH_Drawing_GetSizeOfTextBox(textBox: *mut OH_Drawing_TextBox) -> usize;
1647 /// Gets the glyphposition at coordinate.
1648 ///
1649 ///
1650 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1651 /// # Arguments
1652 ///
1653 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1654 ///
1655 /// * `dx` - Indicates the positionX of typography to set.
1656 ///
1657 /// * `dy` - Indicates the positionY of typography to set.
1658 ///
1659 /// # Returns
1660 ///
1661 /// * Returns the glyphposition at coordinate.
1662 ///
1663 /// Available since API-level: 11
1664 ///
1665 /// Version: 1.0
1666 #[cfg(feature = "api-11")]
1667 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1668 pub fn OH_Drawing_TypographyGetGlyphPositionAtCoordinate(
1669 typography: *mut OH_Drawing_Typography,
1670 dx: f64,
1671 dy: f64,
1672 ) -> *mut OH_Drawing_PositionAndAffinity;
1673 /// Gets the glyphposition at coordinate with cluster.
1674 ///
1675 ///
1676 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1677 /// # Arguments
1678 ///
1679 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1680 ///
1681 /// * `dx` - Indicates the positionX of typography to set.
1682 ///
1683 /// * `dy` - Indicates the positionY of typography to set.
1684 ///
1685 /// # Returns
1686 ///
1687 /// * Returns the glyphposition at coordinate with cluster.
1688 ///
1689 /// Available since API-level: 11
1690 ///
1691 /// Version: 1.0
1692 #[cfg(feature = "api-11")]
1693 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1694 pub fn OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster(
1695 typography: *mut OH_Drawing_Typography,
1696 dx: f64,
1697 dy: f64,
1698 ) -> *mut OH_Drawing_PositionAndAffinity;
1699 /// Gets position from position and affinity.
1700 ///
1701 ///
1702 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1703 /// # Arguments
1704 ///
1705 /// * `positionAndAffinity` - Indicates the pointer to an <b>OH_Drawing_PositionAndAffinity</b> object.
1706 ///
1707 /// # Returns
1708 ///
1709 /// * Returns position from position and affinity.
1710 ///
1711 /// Available since API-level: 11
1712 ///
1713 /// Version: 1.0
1714 #[cfg(feature = "api-11")]
1715 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1716 pub fn OH_Drawing_GetPositionFromPositionAndAffinity(
1717 positionAndAffinity: *mut OH_Drawing_PositionAndAffinity,
1718 ) -> usize;
1719 /// Gets affinity from position and affinity.
1720 ///
1721 ///
1722 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1723 /// # Arguments
1724 ///
1725 /// * `positionandaffinity` - Indicates the pointer to an <b>OH_Drawing_PositionAndAffinity</b> object.
1726 ///
1727 /// # Returns
1728 ///
1729 /// * Returns affinity from position and affinity.
1730 ///
1731 /// Available since API-level: 11
1732 ///
1733 /// Version: 1.0
1734 #[cfg(feature = "api-11")]
1735 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1736 pub fn OH_Drawing_GetAffinityFromPositionAndAffinity(
1737 positionandaffinity: *mut OH_Drawing_PositionAndAffinity,
1738 ) -> ::core::ffi::c_int;
1739 /// Gets the word boundary.
1740 ///
1741 ///
1742 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1743 /// # Arguments
1744 ///
1745 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1746 ///
1747 /// * `offset` - Indicates the size of text to set.
1748 ///
1749 /// # Returns
1750 ///
1751 /// * Returns the word boundary.
1752 ///
1753 /// Available since API-level: 11
1754 ///
1755 /// Version: 1.0
1756 #[cfg(feature = "api-11")]
1757 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1758 pub fn OH_Drawing_TypographyGetWordBoundary(
1759 typography: *mut OH_Drawing_Typography,
1760 offset: usize,
1761 ) -> *mut OH_Drawing_Range;
1762 /// Gets start from range.
1763 ///
1764 ///
1765 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1766 /// # Arguments
1767 ///
1768 /// * `range` - Indicates the pointer to an <b>OH_Drawing_Range</b> object.
1769 ///
1770 /// # Returns
1771 ///
1772 /// * Returns start from range.
1773 ///
1774 /// Available since API-level: 11
1775 ///
1776 /// Version: 1.0
1777 #[cfg(feature = "api-11")]
1778 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1779 pub fn OH_Drawing_GetStartFromRange(range: *mut OH_Drawing_Range) -> usize;
1780 /// Gets end from range.
1781 ///
1782 ///
1783 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1784 /// # Arguments
1785 ///
1786 /// * `range` - Indicates the pointer to an <b>OH_Drawing_Range</b> object.
1787 ///
1788 /// # Returns
1789 ///
1790 /// * Returns end from range.
1791 ///
1792 /// Available since API-level: 11
1793 ///
1794 /// Version: 1.0
1795 #[cfg(feature = "api-11")]
1796 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1797 pub fn OH_Drawing_GetEndFromRange(range: *mut OH_Drawing_Range) -> usize;
1798 /// Gets the line count.
1799 ///
1800 ///
1801 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1802 /// # Arguments
1803 ///
1804 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
1805 ///
1806 /// # Returns
1807 ///
1808 /// * Returns the line count.
1809 ///
1810 /// Available since API-level: 11
1811 ///
1812 /// Version: 1.0
1813 #[cfg(feature = "api-11")]
1814 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1815 pub fn OH_Drawing_TypographyGetLineCount(typography: *mut OH_Drawing_Typography) -> usize;
1816 /// Sets the decoration style.
1817 ///
1818 ///
1819 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1820 /// # Arguments
1821 ///
1822 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
1823 ///
1824 /// * `decorationStyle` - Indicates the text decoration style to set.
1825 /// For details, see the enum <b>OH_Drawing_TextDecorationStyle</b>.
1826 ///
1827 /// Available since API-level: 11
1828 ///
1829 /// Version: 1.0
1830 #[cfg(feature = "api-11")]
1831 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1832 pub fn OH_Drawing_SetTextStyleDecorationStyle(
1833 style: *mut OH_Drawing_TextStyle,
1834 decorationStyle: ::core::ffi::c_int,
1835 );
1836 /// Sets the decoration thickness scale.
1837 ///
1838 ///
1839 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1840 /// # Arguments
1841 ///
1842 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
1843 ///
1844 /// * `decorationThicknessScale` - Indicates the thickness scale of text decoration to set.
1845 ///
1846 /// Available since API-level: 11
1847 ///
1848 /// Version: 1.0
1849 #[cfg(feature = "api-11")]
1850 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1851 pub fn OH_Drawing_SetTextStyleDecorationThicknessScale(
1852 style: *mut OH_Drawing_TextStyle,
1853 decorationThicknessScale: f64,
1854 );
1855 /// Sets the letter spacing.
1856 ///
1857 ///
1858 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1859 /// # Arguments
1860 ///
1861 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
1862 ///
1863 /// * `letterSpacing` - Indicates the letter space to set.
1864 ///
1865 /// Available since API-level: 11
1866 ///
1867 /// Version: 1.0
1868 #[cfg(feature = "api-11")]
1869 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1870 pub fn OH_Drawing_SetTextStyleLetterSpacing(
1871 style: *mut OH_Drawing_TextStyle,
1872 letterSpacing: f64,
1873 );
1874 /// Sets the word spacing.
1875 ///
1876 ///
1877 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1878 /// # Arguments
1879 ///
1880 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
1881 ///
1882 /// * `wordSpacing` - Indicates the word space to set.
1883 ///
1884 /// Available since API-level: 11
1885 ///
1886 /// Version: 1.0
1887 #[cfg(feature = "api-11")]
1888 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1889 pub fn OH_Drawing_SetTextStyleWordSpacing(style: *mut OH_Drawing_TextStyle, wordSpacing: f64);
1890 /// Sets the half leading.
1891 ///
1892 ///
1893 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1894 /// # Arguments
1895 ///
1896 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
1897 ///
1898 /// * `halfLeading` - Indicates the half leading to set.
1899 ///
1900 /// Available since API-level: 11
1901 ///
1902 /// Version: 1.0
1903 #[cfg(feature = "api-11")]
1904 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1905 pub fn OH_Drawing_SetTextStyleHalfLeading(style: *mut OH_Drawing_TextStyle, halfLeading: bool);
1906 /// Sets the ellipsis.
1907 ///
1908 ///
1909 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1910 /// # Arguments
1911 ///
1912 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
1913 ///
1914 /// * `ellipsis` - Indicates the pointer to ellipsis style.
1915 ///
1916 /// Available since API-level: 11
1917 ///
1918 /// Version: 1.0
1919 #[cfg(feature = "api-11")]
1920 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1921 pub fn OH_Drawing_SetTextStyleEllipsis(
1922 style: *mut OH_Drawing_TextStyle,
1923 ellipsis: *const ::core::ffi::c_char,
1924 );
1925 /// Sets the ellipsis modal.
1926 ///
1927 ///
1928 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1929 /// # Arguments
1930 ///
1931 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
1932 ///
1933 /// * `ellipsisModal` - Indicates the ellipsis model to set. For details, see the enum <b>OH_Drawing_EllipsisModal</b>.
1934 ///
1935 /// Available since API-level: 11
1936 ///
1937 /// Version: 1.0
1938 #[cfg(feature = "api-11")]
1939 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1940 pub fn OH_Drawing_SetTextStyleEllipsisModal(
1941 style: *mut OH_Drawing_TextStyle,
1942 ellipsisModal: ::core::ffi::c_int,
1943 );
1944 /// Sets the break strategy.
1945 ///
1946 ///
1947 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1948 /// # Arguments
1949 ///
1950 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
1951 ///
1952 /// * `breakStrategy` - Indicates the break strategy to set. For details, see the enum <b>OH_Drawing_BreakStrategy</b>.
1953 ///
1954 /// Available since API-level: 11
1955 ///
1956 /// Version: 1.0
1957 #[cfg(feature = "api-11")]
1958 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1959 pub fn OH_Drawing_SetTypographyTextBreakStrategy(
1960 style: *mut OH_Drawing_TypographyStyle,
1961 breakStrategy: ::core::ffi::c_int,
1962 );
1963 /// Sets the word break type.
1964 ///
1965 ///
1966 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1967 /// # Arguments
1968 ///
1969 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
1970 ///
1971 /// * `wordBreakType` - Indicates the word break type to set. For details, see the enum <b>OH_Drawing_WordBreakType</b>.
1972 ///
1973 /// Available since API-level: 11
1974 ///
1975 /// Version: 1.0
1976 #[cfg(feature = "api-11")]
1977 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1978 pub fn OH_Drawing_SetTypographyTextWordBreakType(
1979 style: *mut OH_Drawing_TypographyStyle,
1980 wordBreakType: ::core::ffi::c_int,
1981 );
1982 /// Sets the ellipsis modal.
1983 ///
1984 ///
1985 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
1986 /// # Arguments
1987 ///
1988 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
1989 ///
1990 /// * `ellipsisModal` - Indicates the ellipsis modal to set. For details, see the enum <b>OH_Drawing_EllipsisModal</b>.
1991 ///
1992 /// Available since API-level: 11
1993 ///
1994 /// Version: 1.0
1995 #[cfg(feature = "api-11")]
1996 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
1997 pub fn OH_Drawing_SetTypographyTextEllipsisModal(
1998 style: *mut OH_Drawing_TypographyStyle,
1999 ellipsisModal: ::core::ffi::c_int,
2000 );
2001 /// get line height.
2002 ///
2003 ///
2004 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2005 /// # Arguments
2006 ///
2007 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
2008 ///
2009 /// * `lineNumber` - Indicates the line number.
2010 ///
2011 /// # Returns
2012 ///
2013 /// * Returns line height.
2014 ///
2015 /// Available since API-level: 11
2016 ///
2017 /// Version: 1.0
2018 #[cfg(feature = "api-11")]
2019 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
2020 pub fn OH_Drawing_TypographyGetLineHeight(
2021 typography: *mut OH_Drawing_Typography,
2022 lineNumber: ::core::ffi::c_int,
2023 ) -> f64;
2024 /// get line width.
2025 ///
2026 ///
2027 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2028 /// # Arguments
2029 ///
2030 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
2031 ///
2032 /// * `lineNumber` - Indicates the line number.
2033 ///
2034 /// # Returns
2035 ///
2036 /// * Returns line width.
2037 ///
2038 /// Available since API-level: 11
2039 ///
2040 /// Version: 1.0
2041 #[cfg(feature = "api-11")]
2042 #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
2043 pub fn OH_Drawing_TypographyGetLineWidth(
2044 typography: *mut OH_Drawing_Typography,
2045 lineNumber: ::core::ffi::c_int,
2046 ) -> f64;
2047 /// get line text range.
2048 ///
2049 ///
2050 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2051 /// # Arguments
2052 ///
2053 /// * `typography` - Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
2054 ///
2055 /// * `lineNumber` - Indicates the line number.
2056 ///
2057 /// * `includeSpaces` - Indicates whether spaces are contained.
2058 ///
2059 /// # Returns
2060 ///
2061 /// * Returns line text range.
2062 ///
2063 /// Available since API-level: 12
2064 ///
2065 /// Version: 1.0
2066 #[cfg(feature = "api-12")]
2067 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2068 pub fn OH_Drawing_TypographyGetLineTextRange(
2069 typography: *mut OH_Drawing_Typography,
2070 lineNumber: ::core::ffi::c_int,
2071 includeSpaces: bool,
2072 ) -> *mut OH_Drawing_Range;
2073 /// Creates an <b>OH_Drawing_FontDescriptor</b> object.
2074 ///
2075 ///
2076 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2077 ///
2078 /// # Returns
2079 ///
2080 /// * Returns the pointer to the font descriptor object <b>OH_Drawing_FontDescriptor</b> created.
2081 ///
2082 /// Available since API-level: 12
2083 ///
2084 /// Version: 1.0
2085 #[cfg(feature = "api-12")]
2086 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2087 pub fn OH_Drawing_CreateFontDescriptor() -> *mut OH_Drawing_FontDescriptor;
2088 /// Releases the memory occupied by an <b>OH_Drawing_FontDescriptor</b> object.
2089 ///
2090 ///
2091 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2092 /// # Arguments
2093 ///
2094 /// * `descriptor` - the pointer to the font descriptor object <b>OH_Drawing_FontDescriptor</b>.
2095 ///
2096 /// Available since API-level: 12
2097 ///
2098 /// Version: 1.0
2099 #[cfg(feature = "api-12")]
2100 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2101 pub fn OH_Drawing_DestroyFontDescriptor(descriptor: *mut OH_Drawing_FontDescriptor);
2102 /// Creates an <b>OH_Drawing_FontParser</b> object.
2103 ///
2104 ///
2105 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2106 ///
2107 /// # Returns
2108 ///
2109 /// * Returns the pointer to the font parser object <b>OH_Drawing_FontParser</b>.
2110 ///
2111 /// Available since API-level: 12
2112 ///
2113 /// Version: 1.0
2114 #[cfg(feature = "api-12")]
2115 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2116 pub fn OH_Drawing_CreateFontParser() -> *mut OH_Drawing_FontParser;
2117 /// Releases the memory occupied by an <b>OH_Drawing_FontParser</b> object.
2118 ///
2119 ///
2120 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2121 /// # Arguments
2122 ///
2123 /// * `parser` - Indicates the pointer to the font parser object <b>OH_Drawing_FontParser</b>.
2124 ///
2125 /// Available since API-level: 12
2126 ///
2127 /// Version: 1.0
2128 #[cfg(feature = "api-12")]
2129 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2130 pub fn OH_Drawing_DestroyFontParser(parser: *mut OH_Drawing_FontParser);
2131 /// Gets a list of system font names.
2132 ///
2133 ///
2134 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2135 /// # Arguments
2136 ///
2137 /// * `fontParser` - Indicates the pointer to the font parser object <b>OH_Drawing_FontParser</b>.
2138 ///
2139 /// * `num` - Returns the number of obtained system font names.
2140 ///
2141 /// # Returns
2142 ///
2143 /// * Returns a list of obtained system fonts.
2144 ///
2145 /// Available since API-level: 12
2146 ///
2147 /// Version: 1.0
2148 #[cfg(feature = "api-12")]
2149 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2150 pub fn OH_Drawing_FontParserGetSystemFontList(
2151 fontParser: *mut OH_Drawing_FontParser,
2152 num: *mut usize,
2153 ) -> *mut *mut ::core::ffi::c_char;
2154 /// Releases the memory occupied by a list of system font names.
2155 ///
2156 ///
2157 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2158 /// # Arguments
2159 ///
2160 /// * `fontList` - Indicates the pointer to a list of system font names.
2161 ///
2162 /// * `num` - The number of obtained system font names.
2163 ///
2164 /// Available since API-level: 12
2165 ///
2166 /// Version: 1.0
2167 #[cfg(feature = "api-12")]
2168 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2169 pub fn OH_Drawing_DestroySystemFontList(fontList: *mut *mut ::core::ffi::c_char, num: usize);
2170 /// Gets information about the system font by font name.
2171 ///
2172 ///
2173 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2174 /// # Arguments
2175 ///
2176 /// * `fontParser` - Indicates the pointer to the font parser object <b>OH_Drawing_FontParser</b>.
2177 ///
2178 /// * `name` - font name.
2179 ///
2180 /// # Returns
2181 ///
2182 /// * Returns system fonts information.
2183 ///
2184 /// Available since API-level: 12
2185 ///
2186 /// Version: 1.0
2187 #[cfg(feature = "api-12")]
2188 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2189 pub fn OH_Drawing_FontParserGetFontByName(
2190 fontParser: *mut OH_Drawing_FontParser,
2191 name: *const ::core::ffi::c_char,
2192 ) -> *mut OH_Drawing_FontDescriptor;
2193 /// Get line metrics information.
2194 ///
2195 ///
2196 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2197 /// # Arguments
2198 ///
2199 /// * `typography` - Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>.
2200 ///
2201 /// # Returns
2202 ///
2203 /// * Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>.
2204 ///
2205 /// Available since API-level: 12
2206 ///
2207 /// Version: 1.0
2208 #[cfg(feature = "api-12")]
2209 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2210 pub fn OH_Drawing_TypographyGetLineMetrics(
2211 typography: *mut OH_Drawing_Typography,
2212 ) -> *mut OH_Drawing_LineMetrics;
2213 /// Get the number of lines.
2214 ///
2215 ///
2216 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2217 /// # Arguments
2218 ///
2219 /// * `lineMetrics` - Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>.
2220 ///
2221 /// # Returns
2222 ///
2223 /// * Returns the number of lines.
2224 ///
2225 /// Available since API-level: 12
2226 ///
2227 /// Version: 1.0
2228 #[cfg(feature = "api-12")]
2229 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2230 pub fn OH_Drawing_LineMetricsGetSize(lineMetrics: *mut OH_Drawing_LineMetrics) -> usize;
2231 /// Releases the memory occupied by line metrics.
2232 ///
2233 ///
2234 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2235 /// # Arguments
2236 ///
2237 /// * `lineMetrics` - Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>.
2238 ///
2239 /// Available since API-level: 12
2240 ///
2241 /// Version: 1.0
2242 #[cfg(feature = "api-12")]
2243 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2244 pub fn OH_Drawing_DestroyLineMetrics(lineMetrics: *mut OH_Drawing_LineMetrics);
2245 /// Gets the specified line by line number.
2246 ///
2247 ///
2248 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2249 /// # Arguments
2250 ///
2251 /// * `typography` - Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>.
2252 ///
2253 /// * `lineNumber` - Line number.
2254 ///
2255 /// * `lineMetric` - Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>.
2256 ///
2257 /// # Returns
2258 ///
2259 /// * Whether the line metrics was obtained.
2260 ///
2261 /// Available since API-level: 12
2262 ///
2263 /// Version: 1.0
2264 #[cfg(feature = "api-12")]
2265 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2266 pub fn OH_Drawing_TypographyGetLineMetricsAt(
2267 typography: *mut OH_Drawing_Typography,
2268 lineNumber: ::core::ffi::c_int,
2269 lineMetric: *mut OH_Drawing_LineMetrics,
2270 ) -> bool;
2271 /// Sets the ellipsis of lines in a text file.
2272 ///
2273 ///
2274 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2275 /// # Arguments
2276 ///
2277 /// * `style` - Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>.
2278 ///
2279 /// * `ellipsis` - Indicates the line textellipsis.
2280 ///
2281 /// Available since API-level: 12
2282 ///
2283 /// Version: 1.0
2284 #[cfg(feature = "api-12")]
2285 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2286 pub fn OH_Drawing_SetTypographyTextEllipsis(
2287 style: *mut OH_Drawing_TypographyStyle,
2288 ellipsis: *const ::core::ffi::c_char,
2289 );
2290 /// Sets the locale of lines in a text file.
2291 ///
2292 ///
2293 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2294 /// # Arguments
2295 ///
2296 /// * `style` - Indicates the pointer to a typography style object
2297 /// <b>OH_Drawing_TypographyStyle</b>.
2298 ///
2299 /// * `locale` - Indicates the pointer to the locale to set.
2300 ///
2301 /// Available since API-level: 12
2302 ///
2303 /// Version: 1.0
2304 #[cfg(feature = "api-12")]
2305 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2306 pub fn OH_Drawing_SetTypographyTextLocale(
2307 style: *mut OH_Drawing_TypographyStyle,
2308 locale: *const ::core::ffi::c_char,
2309 );
2310 /// Sets the textSplitRatio of lines in a text file.
2311 ///
2312 ///
2313 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2314 /// # Arguments
2315 ///
2316 /// * `style` - Indicates the pointer to a typography style object
2317 /// <b>OH_Drawing_TypographyStyle</b>.
2318 ///
2319 /// * `textSplitRatio` - Indicates the textSplitRatio of lines to set.
2320 ///
2321 /// Available since API-level: 12
2322 ///
2323 /// Version: 1.0
2324 #[cfg(feature = "api-12")]
2325 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2326 pub fn OH_Drawing_SetTypographyTextSplitRatio(
2327 style: *mut OH_Drawing_TypographyStyle,
2328 textSplitRatio: f32,
2329 );
2330 /// Gets the TextStyle of lines in a text file.
2331 ///
2332 ///
2333 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2334 /// # Arguments
2335 ///
2336 /// * `style` - Indicates the pointer to a typography style object
2337 /// <b>OH_Drawing_TypographyStyle</b>.
2338 ///
2339 /// # Returns
2340 ///
2341 /// * Returns line text textstyle.
2342 ///
2343 /// Available since API-level: 12
2344 ///
2345 /// Version: 1.0
2346 #[cfg(feature = "api-12")]
2347 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2348 pub fn OH_Drawing_TypographyGetTextStyle(
2349 style: *mut OH_Drawing_TypographyStyle,
2350 ) -> *mut OH_Drawing_TextStyle;
2351 /// Gets the EffectiveAlign of lines in a text file.
2352 ///
2353 ///
2354 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2355 /// # Arguments
2356 ///
2357 /// * `style` - Indicates the pointer to a typography style object
2358 /// <b>OH_Drawing_TypographyStyle</b>.
2359 ///
2360 /// # Returns
2361 ///
2362 /// * Returns line text align.
2363 ///
2364 /// Available since API-level: 12
2365 ///
2366 /// Version: 1.0
2367 #[cfg(feature = "api-12")]
2368 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2369 pub fn OH_Drawing_TypographyGetEffectiveAlignment(
2370 style: *mut OH_Drawing_TypographyStyle,
2371 ) -> ::core::ffi::c_int;
2372 /// Gets the UnlimitedLines of lines in a text file.
2373 ///
2374 ///
2375 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2376 /// # Arguments
2377 ///
2378 /// * `style` - Indicates the pointer to a typography style object
2379 /// <b>OH_Drawing_TypographyStyle</b>.
2380 ///
2381 /// # Returns
2382 ///
2383 /// * Returns whether the text has a maximum line limit,
2384 /// with true indicating a maximum line limit and false indicating no maximum line limit.
2385 ///
2386 /// Available since API-level: 12
2387 ///
2388 /// Version: 1.0
2389 #[cfg(feature = "api-12")]
2390 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2391 pub fn OH_Drawing_TypographyIsLineUnlimited(style: *mut OH_Drawing_TypographyStyle) -> bool;
2392 /// Gets the IsEllipsized of lines in a text file.
2393 ///
2394 ///
2395 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2396 /// # Arguments
2397 ///
2398 /// * `style` - Indicates the pointer to a typography style object
2399 /// <b>OH_Drawing_TypographyStyle</b>.
2400 ///
2401 /// # Returns
2402 ///
2403 /// * Returns whether the text has ellipsis,
2404 /// true meaning there is an ellipsis and false meaning there is no ellipsis.
2405 ///
2406 /// Available since API-level: 12
2407 ///
2408 /// Version: 1.0
2409 #[cfg(feature = "api-12")]
2410 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2411 pub fn OH_Drawing_TypographyIsEllipsized(style: *mut OH_Drawing_TypographyStyle) -> bool;
2412 /// set line textstyle.
2413 ///
2414 ///
2415 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2416 /// # Arguments
2417 ///
2418 /// * `handler` - Indicates the pointer to a typography style object
2419 /// <b>OH_Drawing_TypographyStyle</b>.
2420 ///
2421 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
2422 ///
2423 /// Available since API-level: 12
2424 ///
2425 /// Version: 1.0
2426 #[cfg(feature = "api-12")]
2427 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2428 pub fn OH_Drawing_SetTypographyTextStyle(
2429 handler: *mut OH_Drawing_TypographyStyle,
2430 style: *mut OH_Drawing_TextStyle,
2431 );
2432 /// get line fontmetrics.
2433 ///
2434 ///
2435 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2436 /// # Arguments
2437 ///
2438 /// * `typography` - Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>.
2439 ///
2440 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
2441 ///
2442 /// * `fontmetrics` - Indicates the pointer to a font metrics object <b>OH_Drawing_Font_Metrics</b>.
2443 ///
2444 /// # Returns
2445 ///
2446 /// * Whether the font metrics was obtained.
2447 ///
2448 /// Available since API-level: 12
2449 ///
2450 /// Version: 1.0
2451 #[cfg(feature = "api-12")]
2452 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2453 pub fn OH_Drawing_TextStyleGetFontMetrics(
2454 typography: *mut OH_Drawing_Typography,
2455 style: *mut OH_Drawing_TextStyle,
2456 fontmetrics: *mut OH_Drawing_Font_Metrics,
2457 ) -> bool;
2458 /// Gets the position of the specified line or the first text of the specified line.
2459 ///
2460 ///
2461 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2462 /// # Arguments
2463 ///
2464 /// * `typography` - Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>.
2465 ///
2466 /// * `lineNumber` - Line number.
2467 ///
2468 /// * `oneLine` - True is the information for the whole line, and false is the information to get the first character
2469 ///
2470 /// * `includeWhitespace` - Whether the text width contains whitespace.
2471 ///
2472 /// * `drawingLineMetrics` - Indicates the pointer to a line metrics object <b>OH_Drawing_LineMetrics</b>.
2473 ///
2474 /// # Returns
2475 ///
2476 /// * return whether the information was successfully fetched.
2477 ///
2478 /// Available since API-level: 12
2479 ///
2480 /// Version: 1.0
2481 #[cfg(feature = "api-12")]
2482 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2483 pub fn OH_Drawing_TypographyGetLineInfo(
2484 typography: *mut OH_Drawing_Typography,
2485 lineNumber: ::core::ffi::c_int,
2486 oneLine: bool,
2487 includeWhitespace: bool,
2488 drawingLineMetrics: *mut OH_Drawing_LineMetrics,
2489 ) -> bool;
2490 /// Sets the font weight of text typography.
2491 ///
2492 ///
2493 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2494 /// # Arguments
2495 ///
2496 /// * `style` - Indicates the pointer to a typography style object
2497 /// <b>OH_Drawing_TypographyStyle</b>.
2498 ///
2499 /// * `weight` - Indicates the font weight of text typography to set. For details,
2500 /// see the enum <b>OH_Drawing_FontWeight</b>.
2501 ///
2502 /// Available since API-level: 12
2503 ///
2504 /// Version: 1.0
2505 #[cfg(feature = "api-12")]
2506 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2507 pub fn OH_Drawing_SetTypographyTextFontWeight(
2508 style: *mut OH_Drawing_TypographyStyle,
2509 weight: ::core::ffi::c_int,
2510 );
2511 /// Sets the font style of text typography.
2512 ///
2513 ///
2514 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2515 /// # Arguments
2516 ///
2517 /// * `style` - Indicates the pointer to a typography style object
2518 /// <b>OH_Drawing_TypographyStyle</b>.
2519 ///
2520 /// * `fontStyle` - Indicates the font style of text typography to set. For details,
2521 /// see the enum <b>OH_Drawing_FontStyle</b>.
2522 ///
2523 /// Available since API-level: 12
2524 ///
2525 /// Version: 1.0
2526 #[cfg(feature = "api-12")]
2527 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2528 pub fn OH_Drawing_SetTypographyTextFontStyle(
2529 style: *mut OH_Drawing_TypographyStyle,
2530 fontStyle: ::core::ffi::c_int,
2531 );
2532 /// Sets the font family of text typography.
2533 ///
2534 ///
2535 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2536 /// # Arguments
2537 ///
2538 /// * `style` - Indicates the pointer to a typography style object
2539 /// <b>OH_Drawing_TypographyStyle</b>.
2540 ///
2541 /// * `fontFamily` - Indicates the pointer to the font family of text typography to set.
2542 ///
2543 /// Available since API-level: 12
2544 ///
2545 /// Version: 1.0
2546 #[cfg(feature = "api-12")]
2547 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2548 pub fn OH_Drawing_SetTypographyTextFontFamily(
2549 style: *mut OH_Drawing_TypographyStyle,
2550 fontFamily: *const ::core::ffi::c_char,
2551 );
2552 /// Sets the font size of text typography.
2553 ///
2554 ///
2555 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2556 /// # Arguments
2557 ///
2558 /// * `style` - Indicates the pointer to a typography style object
2559 /// <b>OH_Drawing_TypographyStyle</b>.
2560 ///
2561 /// * `fontSize` - Indicates the font size of text typography to set.
2562 ///
2563 /// Available since API-level: 12
2564 ///
2565 /// Version: 1.0
2566 #[cfg(feature = "api-12")]
2567 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2568 pub fn OH_Drawing_SetTypographyTextFontSize(
2569 style: *mut OH_Drawing_TypographyStyle,
2570 fontSize: f64,
2571 );
2572 /// Sets the font height of text typography.
2573 ///
2574 ///
2575 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2576 /// # Arguments
2577 ///
2578 /// * `style` - Indicates the pointer to a typography style object
2579 /// <b>OH_Drawing_TypographyStyle</b>.
2580 ///
2581 /// * `fontHeight` - Indicates the font height of text typography to set.
2582 ///
2583 /// Available since API-level: 12
2584 ///
2585 /// Version: 1.0
2586 #[cfg(feature = "api-12")]
2587 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2588 pub fn OH_Drawing_SetTypographyTextFontHeight(
2589 style: *mut OH_Drawing_TypographyStyle,
2590 fontHeight: f64,
2591 );
2592 /// Sets the half leading of text typography.
2593 ///
2594 ///
2595 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2596 /// # Arguments
2597 ///
2598 /// * `style` - Indicates the pointer to a typography style object
2599 /// <b>OH_Drawing_TypographyStyle</b>.
2600 ///
2601 /// * `halfLeading` - Indicates the half leading of text typography to set.
2602 ///
2603 /// Available since API-level: 12
2604 ///
2605 /// Version: 1.0
2606 #[cfg(feature = "api-12")]
2607 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2608 pub fn OH_Drawing_SetTypographyTextHalfLeading(
2609 style: *mut OH_Drawing_TypographyStyle,
2610 halfLeading: bool,
2611 );
2612 /// Sets whether to enable line style for text typography.
2613 ///
2614 ///
2615 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2616 /// # Arguments
2617 ///
2618 /// * `style` - Indicates the pointer to a typography style object
2619 /// <b>OH_Drawing_TypographyStyle</b>.
2620 ///
2621 /// * `useLineStyle` - Indicates whether the line style for text typography is used.
2622 ///
2623 /// Available since API-level: 12
2624 ///
2625 /// Version: 1.0
2626 #[cfg(feature = "api-12")]
2627 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2628 pub fn OH_Drawing_SetTypographyTextUseLineStyle(
2629 style: *mut OH_Drawing_TypographyStyle,
2630 useLineStyle: bool,
2631 );
2632 /// Sets the font weight of line style for text typography.
2633 ///
2634 ///
2635 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2636 /// # Arguments
2637 ///
2638 /// * `style` - Indicates the pointer to a typography style object
2639 /// <b>OH_Drawing_TypographyStyle</b>.
2640 ///
2641 /// * `weight` - Indicates the font weight of line style for text typography to set.
2642 /// For details, see the enum <b>OH_Drawing_FontWeight</b>.
2643 ///
2644 /// Available since API-level: 12
2645 ///
2646 /// Version: 1.0
2647 #[cfg(feature = "api-12")]
2648 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2649 pub fn OH_Drawing_SetTypographyTextLineStyleFontWeight(
2650 style: *mut OH_Drawing_TypographyStyle,
2651 weight: ::core::ffi::c_int,
2652 );
2653 /// Sets the font style of line style for text typography.
2654 ///
2655 ///
2656 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2657 /// # Arguments
2658 ///
2659 /// * `style` - Indicates the pointer to a typography style object
2660 /// <b>OH_Drawing_TypographyStyle</b>.
2661 ///
2662 /// * `fontStyle` - Indicates the font style of line style for text typography to set. For details,
2663 /// see the enum <b>OH_Drawing_FontStyle</b>.
2664 ///
2665 /// Available since API-level: 12
2666 ///
2667 /// Version: 1.0
2668 #[cfg(feature = "api-12")]
2669 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2670 pub fn OH_Drawing_SetTypographyTextLineStyleFontStyle(
2671 style: *mut OH_Drawing_TypographyStyle,
2672 fontStyle: ::core::ffi::c_int,
2673 );
2674 /// Sets the font families of line style for text typography.
2675 ///
2676 ///
2677 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2678 /// # Arguments
2679 ///
2680 /// * `style` - Indicates the pointer to a typography style object
2681 /// <b>OH_Drawing_TypographyStyle</b>.
2682 ///
2683 /// * `fontFamiliesNumber` - Indicates the number of font families to set.
2684 ///
2685 /// * `fontFamilies` - Indicates the pointer to the font families of line style for text typography to set.
2686 ///
2687 /// Available since API-level: 12
2688 ///
2689 /// Version: 1.0
2690 #[cfg(feature = "api-12")]
2691 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2692 pub fn OH_Drawing_SetTypographyTextLineStyleFontFamilies(
2693 style: *mut OH_Drawing_TypographyStyle,
2694 fontFamiliesNumber: ::core::ffi::c_int,
2695 fontFamilies: *mut *const ::core::ffi::c_char,
2696 );
2697 /// Sets the font size of line style for text typography.
2698 ///
2699 ///
2700 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2701 /// # Arguments
2702 ///
2703 /// * `style` - Indicates the pointer to a typography style object
2704 /// <b>OH_Drawing_TypographyStyle</b>.
2705 ///
2706 /// * `lineStyleFontSize` - Indicates the font size of line style for text typography to set.
2707 ///
2708 /// Available since API-level: 12
2709 ///
2710 /// Version: 1.0
2711 #[cfg(feature = "api-12")]
2712 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2713 pub fn OH_Drawing_SetTypographyTextLineStyleFontSize(
2714 style: *mut OH_Drawing_TypographyStyle,
2715 lineStyleFontSize: f64,
2716 );
2717 /// Sets the font height of line style for text typography.
2718 ///
2719 ///
2720 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2721 /// # Arguments
2722 ///
2723 /// * `style` - Indicates the pointer to a typography style object
2724 /// <b>OH_Drawing_TypographyStyle</b>.
2725 ///
2726 /// * `lineStyleFontHeight` - Indicates the font height of line style for text typography to set.
2727 ///
2728 /// Available since API-level: 12
2729 ///
2730 /// Version: 1.0
2731 #[cfg(feature = "api-12")]
2732 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2733 pub fn OH_Drawing_SetTypographyTextLineStyleFontHeight(
2734 style: *mut OH_Drawing_TypographyStyle,
2735 lineStyleFontHeight: f64,
2736 );
2737 /// Sets the half leading of line style for text typography.
2738 ///
2739 ///
2740 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2741 /// # Arguments
2742 ///
2743 /// * `style` - Indicates the pointer to a typography style object
2744 /// <b>OH_Drawing_TypographyStyle</b>.
2745 ///
2746 /// * `lineStyleHalfLeading` - Indicates the half leading of line for text typography to set.
2747 ///
2748 /// Available since API-level: 12
2749 ///
2750 /// Version: 1.0
2751 #[cfg(feature = "api-12")]
2752 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2753 pub fn OH_Drawing_SetTypographyTextLineStyleHalfLeading(
2754 style: *mut OH_Drawing_TypographyStyle,
2755 lineStyleHalfLeading: bool,
2756 );
2757 /// Sets the spacing scale of line style for text typography.
2758 ///
2759 ///
2760 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2761 /// # Arguments
2762 ///
2763 /// * `style` - Indicates the pointer to a typography style object
2764 /// <b>OH_Drawing_TypographyStyle</b>.
2765 ///
2766 /// * `spacingScale` - Indicates the space scale of line for text typography to set.
2767 ///
2768 /// Available since API-level: 12
2769 ///
2770 /// Version: 1.0
2771 #[cfg(feature = "api-12")]
2772 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2773 pub fn OH_Drawing_SetTypographyTextLineStyleSpacingScale(
2774 style: *mut OH_Drawing_TypographyStyle,
2775 spacingScale: f64,
2776 );
2777 /// Sets whether only line style is enabled for text typography.
2778 ///
2779 ///
2780 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2781 /// # Arguments
2782 ///
2783 /// * `style` - Indicates the pointer to a typography style object
2784 /// <b>OH_Drawing_TypographyStyle</b>.
2785 ///
2786 /// * `lineStyleOnly` - Indicates the line style for text typography to set only.
2787 ///
2788 /// Available since API-level: 12
2789 ///
2790 /// Version: 1.0
2791 #[cfg(feature = "api-12")]
2792 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2793 pub fn OH_Drawing_SetTypographyTextLineStyleOnly(
2794 style: *mut OH_Drawing_TypographyStyle,
2795 lineStyleOnly: bool,
2796 );
2797 /// Creates an <b>OH_Drawing_TextShadow</b> object.
2798 ///
2799 ///
2800 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2801 ///
2802 /// # Returns
2803 ///
2804 /// * Returns the pointer to the text shadow object created <b>OH_Drawing_TextShadow</b>.
2805 ///
2806 /// Available since API-level: 12
2807 ///
2808 /// Version: 1.0
2809 #[cfg(feature = "api-12")]
2810 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2811 pub fn OH_Drawing_CreateTextShadow() -> *mut OH_Drawing_TextShadow;
2812 /// Releases the memory occupied by the text shadow object <b>OH_Drawing_TextShadow</b>.
2813 ///
2814 ///
2815 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2816 /// # Arguments
2817 ///
2818 /// * `shadow` - Indicates the pointer to the text shadow object <b>OH_Drawing_TextShadow</b>.
2819 ///
2820 /// Available since API-level: 12
2821 ///
2822 /// Version: 1.0
2823 #[cfg(feature = "api-12")]
2824 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2825 pub fn OH_Drawing_DestroyTextShadow(shadow: *mut OH_Drawing_TextShadow);
2826 /// Gets the vector of TextShadow in TextStyle.
2827 ///
2828 ///
2829 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2830 /// # Arguments
2831 ///
2832 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
2833 ///
2834 /// * `int` - Indicates the number in vector to set.
2835 ///
2836 /// * `style` - Indicates the pointer to the text shadow object <b>OH_Drawing_TextShadow</b>.
2837 ///
2838 /// # Returns
2839 ///
2840 /// * Returns the vector of TextShadow.
2841 ///
2842 /// Available since API-level: 12
2843 ///
2844 /// Version: 1.0
2845 #[cfg(feature = "api-12")]
2846 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2847 pub fn OH_Drawing_TextStyleGetShadows(
2848 style: *mut OH_Drawing_TextStyle,
2849 ) -> *mut OH_Drawing_TextShadow;
2850 /// Gets the size of vector of TextShadow in TextStyle.
2851 ///
2852 ///
2853 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2854 /// # Arguments
2855 ///
2856 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
2857 ///
2858 /// # Returns
2859 ///
2860 /// * Returns the size of vector.
2861 ///
2862 /// Available since API-level: 12
2863 ///
2864 /// Version: 1.0
2865 #[cfg(feature = "api-12")]
2866 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2867 pub fn OH_Drawing_TextStyleGetShadowCount(
2868 style: *mut OH_Drawing_TextStyle,
2869 ) -> ::core::ffi::c_int;
2870 /// Adds element in vector of TextShadow in TextStyle.
2871 ///
2872 ///
2873 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2874 /// # Arguments
2875 ///
2876 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
2877 ///
2878 /// * `shadow` - Indicates the pointer to the text shadow object <b>OH_Drawing_TextShadow</b>.
2879 ///
2880 /// Available since API-level: 12
2881 ///
2882 /// Version: 1.0
2883 #[cfg(feature = "api-12")]
2884 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2885 pub fn OH_Drawing_TextStyleAddShadow(
2886 style: *mut OH_Drawing_TextStyle,
2887 shadow: *const OH_Drawing_TextShadow,
2888 );
2889 /// clear elements in vector of TextShadow in TextStyle.
2890 ///
2891 ///
2892 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2893 /// # Arguments
2894 ///
2895 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
2896 ///
2897 /// Available since API-level: 12
2898 ///
2899 /// Version: 1.0
2900 #[cfg(feature = "api-12")]
2901 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2902 pub fn OH_Drawing_TextStyleClearShadows(style: *mut OH_Drawing_TextStyle);
2903 /// Gets element in vector of TextShadow with index.
2904 ///
2905 ///
2906 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2907 /// # Arguments
2908 ///
2909 /// * `style` - Indicates the pointer to a text style object <b>OH_Drawing_TextStyle</b>.
2910 ///
2911 /// * `index` - Indicates the index to set.
2912 ///
2913 /// # Returns
2914 ///
2915 /// * Returns the pointer to element with the index in vector of the text style object
2916 /// <b>OH_Drawing_TextStyle</b>.
2917 ///
2918 /// Available since API-level: 12
2919 ///
2920 /// Version: 1.0
2921 #[cfg(feature = "api-12")]
2922 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2923 pub fn OH_Drawing_TextStyleGetShadowWithIndex(
2924 style: *mut OH_Drawing_TextStyle,
2925 index: ::core::ffi::c_int,
2926 ) -> *mut OH_Drawing_TextShadow;
2927 /// Set indents of the typography.
2928 ///
2929 ///
2930 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2931 /// # Arguments
2932 ///
2933 /// * `typography` - Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>.
2934 ///
2935 /// * `indentsNumber` - Indicates the pointer to the indents to set.
2936 ///
2937 /// * `indents` - Indicates the pointer to the indents to set.
2938 ///
2939 /// Available since API-level: 12
2940 ///
2941 /// Version: 1.0
2942 #[cfg(feature = "api-12")]
2943 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2944 pub fn OH_Drawing_TypographySetIndents(
2945 typography: *mut OH_Drawing_Typography,
2946 indentsNumber: ::core::ffi::c_int,
2947 indents: *const f32,
2948 );
2949 /// Gets element with index in vector of Indents.
2950 ///
2951 ///
2952 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2953 /// # Arguments
2954 ///
2955 /// * `typography` - Indicates the pointer to a typography object <b>OH_Drawing_Typography</b>.
2956 ///
2957 /// * `index` - Indicates the index to set.
2958 ///
2959 /// # Returns
2960 ///
2961 /// * float Indicates the element with the index in vector of Indents.
2962 ///
2963 /// Available since API-level: 12
2964 ///
2965 /// Version: 1.0
2966 #[cfg(feature = "api-12")]
2967 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2968 pub fn OH_Drawing_TypographyGetIndentsWithIndex(
2969 typography: *mut OH_Drawing_Typography,
2970 index: ::core::ffi::c_int,
2971 ) -> f32;
2972 /// Releases the memory occupied by vector with the text shadow object <b>OH_Drawing_TextShadow</b>.
2973 ///
2974 ///
2975 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2976 /// # Arguments
2977 ///
2978 /// * `shadow` - the pointer to the text shadow object <b>OH_Drawing_TextShadow</b>.
2979 ///
2980 /// Available since API-level: 12
2981 ///
2982 /// Version: 1.0
2983 #[cfg(feature = "api-12")]
2984 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
2985 pub fn OH_Drawing_DestroyTextShadows(shadow: *mut OH_Drawing_TextShadow);
2986 /// Set mode of applying the leading over and under text.
2987 ///
2988 ///
2989 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
2990 /// # Arguments
2991 ///
2992 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
2993 ///
2994 /// * `heightMode` - Indicates the mode to set.
2995 ///
2996 /// Available since API-level: 12
2997 ///
2998 /// Version: 1.0
2999 #[cfg(feature = "api-12")]
3000 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3001 pub fn OH_Drawing_TypographyTextSetHeightBehavior(
3002 style: *mut OH_Drawing_TypographyStyle,
3003 heightMode: OH_Drawing_TextHeightBehavior,
3004 );
3005 /// Get mode of applying the leading over and under text.
3006 ///
3007 ///
3008 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3009 /// # Arguments
3010 ///
3011 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
3012 ///
3013 /// # Returns
3014 ///
3015 /// * Returns the mode.
3016 ///
3017 /// Available since API-level: 12
3018 ///
3019 /// Version: 1.0
3020 #[cfg(feature = "api-12")]
3021 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3022 pub fn OH_Drawing_TypographyTextGetHeightBehavior(
3023 style: *mut OH_Drawing_TypographyStyle,
3024 ) -> OH_Drawing_TextHeightBehavior;
3025 /// Set struct of background rect and styleId of text.
3026 ///
3027 ///
3028 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3029 /// # Arguments
3030 ///
3031 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3032 ///
3033 /// * `rectStyleInfo` - Indicates the pointer to an <b>OH_Drawing_RectStyle_Info</b> object.
3034 ///
3035 /// * `styleId` - Indicates the styleId of text to set.
3036 ///
3037 /// Available since API-level: 12
3038 ///
3039 /// Version: 1.0
3040 #[cfg(feature = "api-12")]
3041 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3042 pub fn OH_Drawing_TextStyleSetBackgroundRect(
3043 style: *mut OH_Drawing_TextStyle,
3044 rectStyleInfo: *const OH_Drawing_RectStyle_Info,
3045 styleId: ::core::ffi::c_int,
3046 );
3047 /// Add symbols in creating typography.
3048 ///
3049 ///
3050 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3051 /// # Arguments
3052 ///
3053 /// * `handler` - Indicates the pointer to an <b>OH_Drawing_TypographyCreate</b> object.
3054 ///
3055 /// * `symbol` - Indicates the symbol to set.
3056 ///
3057 /// Available since API-level: 12
3058 ///
3059 /// Version: 1.0
3060 #[cfg(feature = "api-12")]
3061 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3062 pub fn OH_Drawing_TypographyHandlerAddSymbol(
3063 handler: *mut OH_Drawing_TypographyCreate,
3064 symbol: u32,
3065 );
3066 /// Add font feature.
3067 ///
3068 ///
3069 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3070 /// # Arguments
3071 ///
3072 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3073 ///
3074 /// * `tag` - Indicates the pointer to the tag to set.
3075 ///
3076 /// * `value` - Indicates the value to set.
3077 ///
3078 /// Available since API-level: 12
3079 ///
3080 /// Version: 1.0
3081 #[cfg(feature = "api-12")]
3082 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3083 pub fn OH_Drawing_TextStyleAddFontFeature(
3084 style: *mut OH_Drawing_TextStyle,
3085 tag: *const ::core::ffi::c_char,
3086 value: ::core::ffi::c_int,
3087 );
3088 /// Add font variation.
3089 ///
3090 ///
3091 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3092 /// # Arguments
3093 ///
3094 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3095 ///
3096 /// * `axis` - Indicates the pointer to font variation axis.
3097 ///
3098 /// * `value` - Indicates the font variation value to set.
3099 ///
3100 /// Available since API-level: 12
3101 ///
3102 /// Version: 1.0
3103 #[cfg(feature = "api-12")]
3104 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3105 pub fn OH_Drawing_TextStyleAddFontVariation(
3106 style: *mut OH_Drawing_TextStyle,
3107 axis: *const ::core::ffi::c_char,
3108 value: f32,
3109 );
3110 /// Get all font features.
3111 ///
3112 ///
3113 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3114 /// # Arguments
3115 ///
3116 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3117 ///
3118 /// # Returns
3119 ///
3120 /// * OH_Drawing_FontFeature Indicates the pointer to an array of structures of OH_Drawing_FontFeature.
3121 /// Get size of font feature by OH_Drawing_TextStyleGetFontFeatureSize.
3122 ///
3123 /// Available since API-level: 12
3124 ///
3125 /// Version: 1.0
3126 #[cfg(feature = "api-12")]
3127 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3128 pub fn OH_Drawing_TextStyleGetFontFeatures(
3129 style: *mut OH_Drawing_TextStyle,
3130 ) -> *mut OH_Drawing_FontFeature;
3131 /// Release the memory occupied by array of structures of font features.
3132 ///
3133 ///
3134 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3135 /// # Arguments
3136 ///
3137 /// * `fontFeature` - Indicates the pointer to an array of structures of OH_Drawing_FontFeature.
3138 ///
3139 /// * `fontFeatureSize` - Indicates the size of array of structures of OH_Drawing_FontFeature.
3140 ///
3141 /// Available since API-level: 12
3142 ///
3143 /// Version: 1.0
3144 #[cfg(feature = "api-12")]
3145 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3146 pub fn OH_Drawing_TextStyleDestroyFontFeatures(
3147 fontFeature: *mut OH_Drawing_FontFeature,
3148 fontFeatureSize: usize,
3149 );
3150 /// Get size of font features.
3151 ///
3152 ///
3153 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3154 /// # Arguments
3155 ///
3156 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3157 ///
3158 /// # Returns
3159 ///
3160 /// * Returns the size of fontfeatures map.
3161 ///
3162 /// Available since API-level: 12
3163 ///
3164 /// Version: 1.0
3165 #[cfg(feature = "api-12")]
3166 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3167 pub fn OH_Drawing_TextStyleGetFontFeatureSize(style: *mut OH_Drawing_TextStyle) -> usize;
3168 /// Clear font features.
3169 ///
3170 ///
3171 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3172 /// # Arguments
3173 ///
3174 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3175 ///
3176 /// Available since API-level: 12
3177 ///
3178 /// Version: 1.0
3179 #[cfg(feature = "api-12")]
3180 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3181 pub fn OH_Drawing_TextStyleClearFontFeature(style: *mut OH_Drawing_TextStyle);
3182 /// Set baseline shift of text.
3183 ///
3184 ///
3185 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3186 /// # Arguments
3187 ///
3188 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3189 ///
3190 /// * `lineShift` - Indicates the baseline shift to set.
3191 ///
3192 /// Available since API-level: 12
3193 ///
3194 /// Version: 1.0
3195 #[cfg(feature = "api-12")]
3196 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3197 pub fn OH_Drawing_TextStyleSetBaselineShift(style: *mut OH_Drawing_TextStyle, lineShift: f64);
3198 /// Get baseline shift of text.
3199 ///
3200 ///
3201 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3202 /// # Arguments
3203 ///
3204 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3205 ///
3206 /// # Returns
3207 ///
3208 /// * Returns the baseline shift.
3209 ///
3210 /// Available since API-level: 12
3211 ///
3212 /// Version: 1.0
3213 #[cfg(feature = "api-12")]
3214 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3215 pub fn OH_Drawing_TextStyleGetBaselineShift(style: *mut OH_Drawing_TextStyle) -> f64;
3216 /// Gets the text color.
3217 ///
3218 ///
3219 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3220 /// # Arguments
3221 ///
3222 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3223 ///
3224 /// # Returns
3225 ///
3226 /// * Returns the text color.
3227 ///
3228 /// Available since API-level: 12
3229 ///
3230 /// Version: 1.0
3231 #[cfg(feature = "api-12")]
3232 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3233 pub fn OH_Drawing_TextStyleGetColor(style: *mut OH_Drawing_TextStyle) -> u32;
3234 /// Gets text decoration style.
3235 ///
3236 ///
3237 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3238 /// # Arguments
3239 ///
3240 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3241 ///
3242 /// # Returns
3243 ///
3244 /// * Returns text decoration style.
3245 ///
3246 /// Available since API-level: 12
3247 ///
3248 /// Version: 1.0
3249 #[cfg(feature = "api-12")]
3250 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3251 pub fn OH_Drawing_TextStyleGetDecorationStyle(
3252 style: *mut OH_Drawing_TextStyle,
3253 ) -> OH_Drawing_TextDecorationStyle;
3254 /// Gets font weight.
3255 ///
3256 ///
3257 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3258 /// # Arguments
3259 ///
3260 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3261 ///
3262 /// # Returns
3263 ///
3264 /// * Returns font Weight.
3265 ///
3266 /// Available since API-level: 12
3267 ///
3268 /// Version: 1.0
3269 #[cfg(feature = "api-12")]
3270 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3271 pub fn OH_Drawing_TextStyleGetFontWeight(
3272 style: *mut OH_Drawing_TextStyle,
3273 ) -> OH_Drawing_FontWeight;
3274 /// Gets font style.
3275 ///
3276 ///
3277 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3278 /// # Arguments
3279 ///
3280 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3281 ///
3282 /// # Returns
3283 ///
3284 /// * Returns font style.
3285 ///
3286 /// Available since API-level: 12
3287 ///
3288 /// Version: 1.0
3289 #[cfg(feature = "api-12")]
3290 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3291 pub fn OH_Drawing_TextStyleGetFontStyle(
3292 style: *mut OH_Drawing_TextStyle,
3293 ) -> OH_Drawing_FontStyle;
3294 /// Gets the font baseline.
3295 ///
3296 ///
3297 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3298 /// # Arguments
3299 ///
3300 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3301 ///
3302 /// # Returns
3303 ///
3304 /// * Returns the font baseline.
3305 ///
3306 /// Available since API-level: 12
3307 ///
3308 /// Version: 1.0
3309 #[cfg(feature = "api-12")]
3310 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3311 pub fn OH_Drawing_TextStyleGetBaseline(
3312 style: *mut OH_Drawing_TextStyle,
3313 ) -> OH_Drawing_TextBaseline;
3314 /// Gets a list of font families.
3315 ///
3316 ///
3317 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3318 /// # Arguments
3319 ///
3320 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3321 ///
3322 /// * `num` - Indicates count of font families result.
3323 ///
3324 /// # Returns
3325 ///
3326 /// * Returns a list of font families.
3327 ///
3328 /// Available since API-level: 12
3329 ///
3330 /// Version: 1.0
3331 #[cfg(feature = "api-12")]
3332 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3333 pub fn OH_Drawing_TextStyleGetFontFamilies(
3334 style: *mut OH_Drawing_TextStyle,
3335 num: *mut usize,
3336 ) -> *mut *mut ::core::ffi::c_char;
3337 /// Releases the memory occupied by a list of font families.
3338 ///
3339 ///
3340 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3341 /// # Arguments
3342 ///
3343 /// * `fontFamilies` - Indicates the pointer to a list of font families.
3344 ///
3345 /// * `num` - Indicates the count of obtained font families.
3346 ///
3347 /// Available since API-level: 12
3348 ///
3349 /// Version: 1.0
3350 #[cfg(feature = "api-12")]
3351 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3352 pub fn OH_Drawing_TextStyleDestroyFontFamilies(
3353 fontFamilies: *mut *mut ::core::ffi::c_char,
3354 num: usize,
3355 );
3356 /// Gets font size.
3357 ///
3358 ///
3359 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3360 /// # Arguments
3361 ///
3362 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3363 ///
3364 /// # Returns
3365 ///
3366 /// * Returns font size.
3367 ///
3368 /// Available since API-level: 12
3369 ///
3370 /// Version: 1.0
3371 #[cfg(feature = "api-12")]
3372 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3373 pub fn OH_Drawing_TextStyleGetFontSize(style: *mut OH_Drawing_TextStyle) -> f64;
3374 /// Gets the letter spacing of the text.
3375 ///
3376 ///
3377 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3378 /// # Arguments
3379 ///
3380 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3381 ///
3382 /// # Returns
3383 ///
3384 /// * Returns the size of the letter spacing.
3385 ///
3386 /// Available since API-level: 12
3387 ///
3388 /// Version: 1.0
3389 #[cfg(feature = "api-12")]
3390 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3391 pub fn OH_Drawing_TextStyleGetLetterSpacing(style: *mut OH_Drawing_TextStyle) -> f64;
3392 /// Gets the word spacing of the text.
3393 ///
3394 ///
3395 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3396 /// # Arguments
3397 ///
3398 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3399 ///
3400 /// # Returns
3401 ///
3402 /// * Returns word spacing size.
3403 ///
3404 /// Available since API-level: 12
3405 ///
3406 /// Version: 1.0
3407 #[cfg(feature = "api-12")]
3408 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3409 pub fn OH_Drawing_TextStyleGetWordSpacing(style: *mut OH_Drawing_TextStyle) -> f64;
3410 /// Gets font height.
3411 ///
3412 ///
3413 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3414 /// # Arguments
3415 ///
3416 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3417 ///
3418 /// # Returns
3419 ///
3420 /// * Returns font height.
3421 ///
3422 /// Available since API-level: 12
3423 ///
3424 /// Version: 1.0
3425 #[cfg(feature = "api-12")]
3426 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3427 pub fn OH_Drawing_TextStyleGetFontHeight(style: *mut OH_Drawing_TextStyle) -> f64;
3428 /// Gets whether to set the text to half line spacing.
3429 ///
3430 ///
3431 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3432 /// # Arguments
3433 ///
3434 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3435 ///
3436 /// # Returns
3437 ///
3438 /// * Returns true indicates that the spacing takes effect,
3439 /// false indicates that the spacing does not take effect.
3440 ///
3441 /// Available since API-level: 12
3442 ///
3443 /// Version: 1.0
3444 #[cfg(feature = "api-12")]
3445 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3446 pub fn OH_Drawing_TextStyleGetHalfLeading(style: *mut OH_Drawing_TextStyle) -> bool;
3447 /// Gets the locale.
3448 ///
3449 ///
3450 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3451 /// # Arguments
3452 ///
3453 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3454 ///
3455 /// # Returns
3456 ///
3457 /// * Returns a locale of data type as a pointer to a char. As with the TextStyle lifecycle.
3458 /// No release is required and the return value is invalidated after the set method is called.
3459 ///
3460 /// Available since API-level: 12
3461 ///
3462 /// Version: 1.0
3463 #[cfg(feature = "api-12")]
3464 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3465 pub fn OH_Drawing_TextStyleGetLocale(
3466 style: *mut OH_Drawing_TextStyle,
3467 ) -> *const ::core::ffi::c_char;
3468 /// Sets the text style, including font weight, font width and font slant.
3469 ///
3470 ///
3471 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3472 /// # Arguments
3473 ///
3474 /// * `drawingTextStyle` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3475 ///
3476 /// * `fontStyle` - Indicates an <b>OH_Drawing_FontStyleStruct</b> object.
3477 ///
3478 /// Available since API-level: 12
3479 ///
3480 /// Version: 1.0
3481 #[cfg(feature = "api-12")]
3482 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3483 pub fn OH_Drawing_SetTextStyleFontStyleStruct(
3484 drawingTextStyle: *mut OH_Drawing_TextStyle,
3485 fontStyle: OH_Drawing_FontStyleStruct,
3486 );
3487 /// Gets the text style, including font weight, font width and font slant.
3488 ///
3489 ///
3490 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3491 /// # Arguments
3492 ///
3493 /// * `drawingTextStyle` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3494 ///
3495 /// # Returns
3496 ///
3497 /// * Returns the <b>OH_Drawing_FontStyleStruct</b> object getted.
3498 ///
3499 /// Available since API-level: 12
3500 ///
3501 /// Version: 1.0
3502 #[cfg(feature = "api-12")]
3503 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3504 pub fn OH_Drawing_TextStyleGetFontStyleStruct(
3505 drawingTextStyle: *mut OH_Drawing_TextStyle,
3506 ) -> OH_Drawing_FontStyleStruct;
3507 /// Sets the typography style, including font weight, font width and font slant.
3508 ///
3509 ///
3510 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3511 /// # Arguments
3512 ///
3513 /// * `drawingStyle` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
3514 ///
3515 /// * `fontStyle` - Indicates an <b>OH_Drawing_FontStyleStruct</b> object.
3516 ///
3517 /// Available since API-level: 12
3518 ///
3519 /// Version: 1.0
3520 #[cfg(feature = "api-12")]
3521 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3522 pub fn OH_Drawing_SetTypographyStyleFontStyleStruct(
3523 drawingStyle: *mut OH_Drawing_TypographyStyle,
3524 fontStyle: OH_Drawing_FontStyleStruct,
3525 );
3526 /// Gets the typography style, including font weight, font width and font slant.
3527 ///
3528 ///
3529 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3530 /// # Arguments
3531 ///
3532 /// * `drawingStyle` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
3533 ///
3534 /// # Returns
3535 ///
3536 /// * Returns the <b>OH_Drawing_FontStyleStruct</b> object getted.
3537 ///
3538 /// Available since API-level: 12
3539 ///
3540 /// Version: 1.0
3541 #[cfg(feature = "api-12")]
3542 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3543 pub fn OH_Drawing_TypographyStyleGetFontStyleStruct(
3544 drawingStyle: *mut OH_Drawing_TypographyStyle,
3545 ) -> OH_Drawing_FontStyleStruct;
3546 /// Gets whether the two TextStyle objects are equal.
3547 ///
3548 ///
3549 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3550 /// # Arguments
3551 ///
3552 /// * `style` - Indicates source of comparison <b>OH_Drawing_TextStyle</b> object.
3553 ///
3554 /// * `comparedStyle` - Indicates comparison <b>OH_Drawing_TextStyle</b> object.
3555 ///
3556 /// # Returns
3557 ///
3558 /// * Compare result.
3559 ///
3560 /// Available since API-level: 12
3561 ///
3562 /// Version: 1.0
3563 #[cfg(feature = "api-12")]
3564 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3565 pub fn OH_Drawing_TextStyleIsEqual(
3566 style: *const OH_Drawing_TextStyle,
3567 comparedStyle: *const OH_Drawing_TextStyle,
3568 ) -> bool;
3569 /// Gets whether the font properties of two TextStyle objects are equal.
3570 ///
3571 ///
3572 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3573 /// # Arguments
3574 ///
3575 /// * `style` - Indicates source of <b>comparison OH_Drawing_TextStyle</b> object.
3576 ///
3577 /// * `comparedStyle` - Indicates comparison <b>OH_Drawing_TextStyle</b> object.
3578 ///
3579 /// # Returns
3580 ///
3581 /// * Compare result.
3582 ///
3583 /// Available since API-level: 12
3584 ///
3585 /// Version: 1.0
3586 #[cfg(feature = "api-12")]
3587 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3588 pub fn OH_Drawing_TextStyleIsEqualByFont(
3589 style: *const OH_Drawing_TextStyle,
3590 comparedStyle: *const OH_Drawing_TextStyle,
3591 ) -> bool;
3592 /// Gets whether two TextStyle objects match attributes
3593 ///
3594 ///
3595 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3596 /// # Arguments
3597 ///
3598 /// * `style` - Indicates enumerates of text style type.
3599 ///
3600 /// * `comparedStyle` - Indicates source of comparison <b>OH_Drawing_TextStyle</b> object.
3601 ///
3602 /// * `textStyleType` - Indicates comparison <b>OH_Drawing_TextStyle</b> object.
3603 ///
3604 /// # Returns
3605 ///
3606 /// * Match attributes result.
3607 ///
3608 /// Available since API-level: 12
3609 ///
3610 /// Version: 1.0
3611 #[cfg(feature = "api-12")]
3612 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3613 pub fn OH_Drawing_TextStyleIsAttributeMatched(
3614 style: *const OH_Drawing_TextStyle,
3615 comparedStyle: *const OH_Drawing_TextStyle,
3616 textStyleType: OH_Drawing_TextStyleType,
3617 ) -> bool;
3618 /// Set placeholder of TextStyle.
3619 ///
3620 ///
3621 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3622 /// # Arguments
3623 ///
3624 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3625 ///
3626 /// Available since API-level: 12
3627 ///
3628 /// Version: 1.0
3629 #[cfg(feature = "api-12")]
3630 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3631 pub fn OH_Drawing_TextStyleSetPlaceholder(style: *mut OH_Drawing_TextStyle);
3632 /// Gets whether placeholder is enable.
3633 ///
3634 ///
3635 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3636 /// # Arguments
3637 ///
3638 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TextStyle</b> object.
3639 ///
3640 /// # Returns
3641 ///
3642 /// * Whether placeholder is enable.
3643 ///
3644 /// Available since API-level: 12
3645 ///
3646 /// Version: 1.0
3647 #[cfg(feature = "api-12")]
3648 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3649 pub fn OH_Drawing_TextStyleIsPlaceholder(style: *mut OH_Drawing_TextStyle) -> bool;
3650 /// Gets text alignment mode.
3651 ///
3652 ///
3653 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3654 /// # Arguments
3655 ///
3656 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
3657 ///
3658 /// # Returns
3659 ///
3660 /// * Returns text alignment mode.
3661 ///
3662 /// Available since API-level: 12
3663 ///
3664 /// Version: 1.0
3665 #[cfg(feature = "api-12")]
3666 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3667 pub fn OH_Drawing_TypographyStyleGetEffectiveAlignment(
3668 style: *mut OH_Drawing_TypographyStyle,
3669 ) -> OH_Drawing_TextAlign;
3670 /// Gets whether the hinting is enabled.
3671 ///
3672 ///
3673 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3674 /// # Arguments
3675 ///
3676 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
3677 ///
3678 /// # Returns
3679 ///
3680 /// * True, if the hinting takes effect; False, if the hinting does not take effect.
3681 ///
3682 /// Available since API-level: 12
3683 ///
3684 /// Version: 1.0
3685 #[cfg(feature = "api-12")]
3686 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3687 pub fn OH_Drawing_TypographyStyleIsHintEnabled(style: *mut OH_Drawing_TypographyStyle) -> bool;
3688 /// Gets system font configuration information.
3689 ///
3690 ///
3691 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3692 /// # Arguments
3693 ///
3694 /// * `errorCode` - Indicates error code returned, based on the error code to
3695 /// release the memory of system font configuration information.
3696 /// For details, see the enum <b>OH_Drawing_FontConfigInfoErrorCode</b>.
3697 ///
3698 /// # Returns
3699 ///
3700 /// * Returns a pointer to system font configuration information.
3701 /// Indicates the pointer to an <b>OH_Drawing_FontConfigInfo</b> object.
3702 ///
3703 /// Available since API-level: 12
3704 ///
3705 /// Version: 1.0
3706 #[cfg(feature = "api-12")]
3707 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3708 pub fn OH_Drawing_GetSystemFontConfigInfo(
3709 errorCode: *mut OH_Drawing_FontConfigInfoErrorCode,
3710 ) -> *mut OH_Drawing_FontConfigInfo;
3711 /// Releases the memory occupied by system font configuration information.
3712 ///
3713 ///
3714 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3715 /// # Arguments
3716 ///
3717 /// * `drawFontCfgInfo` - Indicates the pointer to an <b>OH_Drawing_FontConfigInfo</b> object.
3718 ///
3719 /// Available since API-level: 12
3720 ///
3721 /// Version: 1.0
3722 #[cfg(feature = "api-12")]
3723 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3724 pub fn OH_Drawing_DestroySystemFontConfigInfo(drawFontCfgInfo: *mut OH_Drawing_FontConfigInfo);
3725 /// Sets the strut style for text typography.
3726 ///
3727 ///
3728 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3729 /// # Arguments
3730 ///
3731 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
3732 ///
3733 /// * `strutstyle` - Indicates the pointer of <b>OH_Drawing_StrutStyle</b> object.
3734 ///
3735 /// Available since API-level: 12
3736 ///
3737 /// Version: 1.0
3738 #[cfg(feature = "api-12")]
3739 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3740 pub fn OH_Drawing_SetTypographyStyleTextStrutStyle(
3741 style: *mut OH_Drawing_TypographyStyle,
3742 strutstyle: *mut OH_Drawing_StrutStyle,
3743 );
3744 /// Releases the memory occupied by an <b>OH_Drawing_StrutStyle</b> object.
3745 ///
3746 ///
3747 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3748 /// # Arguments
3749 ///
3750 /// * `strutstyle` - Indicates the pointer of <b>OH_Drawing_StrutStyle</b> object.
3751 ///
3752 /// Available since API-level: 12
3753 ///
3754 /// Version: 1.0
3755 #[cfg(feature = "api-12")]
3756 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3757 pub fn OH_Drawing_TypographyStyleDestroyStrutStyle(strutstyle: *mut OH_Drawing_StrutStyle);
3758 /// Gets the strut style for text typography.
3759 ///
3760 ///
3761 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3762 /// # Arguments
3763 ///
3764 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
3765 ///
3766 /// # Returns
3767 ///
3768 /// * Returns the pointer of <b>OH_Drawing_StrutStyle</b> object.
3769 ///
3770 /// Available since API-level: 12
3771 ///
3772 /// Version: 1.0
3773 #[cfg(feature = "api-12")]
3774 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3775 pub fn OH_Drawing_TypographyStyleGetStrutStyle(
3776 style: *mut OH_Drawing_TypographyStyle,
3777 ) -> *mut OH_Drawing_StrutStyle;
3778 /// Overriding the struct StrutStyle equals operator.
3779 ///
3780 ///
3781 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3782 /// # Arguments
3783 ///
3784 /// * `from` - Indicates source of comparison object.
3785 ///
3786 /// * `to` - Indicates comparison object.
3787 ///
3788 /// Available since API-level: 12
3789 ///
3790 /// Version: 1.0
3791 #[cfg(feature = "api-12")]
3792 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3793 pub fn OH_Drawing_TypographyStyleStrutStyleEquals(
3794 from: *mut OH_Drawing_StrutStyle,
3795 to: *mut OH_Drawing_StrutStyle,
3796 ) -> bool;
3797 /// Sets the hinting of text typography.
3798 ///
3799 ///
3800 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3801 /// # Arguments
3802 ///
3803 /// * `style` - Indicates the pointer to an <b>OH_Drawing_TypographyStyle</b> object.
3804 ///
3805 /// * `hintsEnabled` - Indicates the hinting of text typography..
3806 ///
3807 /// Available since API-level: 12
3808 ///
3809 /// Version: 1.0
3810 #[cfg(feature = "api-12")]
3811 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3812 pub fn OH_Drawing_TypographyStyleSetHintsEnabled(
3813 style: *mut OH_Drawing_TypographyStyle,
3814 hintsEnabled: bool,
3815 );
3816 /// Getting all font metrics from target row.
3817 ///
3818 ///
3819 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3820 /// # Arguments
3821 ///
3822 /// * `typography` - Indicates a pointer to a typesetting object.
3823 ///
3824 /// * `lineNumber` - Indicates specifies the number of rows.
3825 ///
3826 /// * `fontMetricsSize` - Indicates the return size of font metrics struct from current line.
3827 ///
3828 /// # Returns
3829 ///
3830 /// * Returns all character measures for the current row.
3831 ///
3832 /// Available since API-level: 12
3833 ///
3834 /// Version: 1.0
3835 #[cfg(feature = "api-12")]
3836 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3837 pub fn OH_Drawing_TypographyGetLineFontMetrics(
3838 typography: *mut OH_Drawing_Typography,
3839 lineNumber: usize,
3840 fontMetricsSize: *mut usize,
3841 ) -> *mut OH_Drawing_Font_Metrics;
3842 /// Free up all the space taken up by the lineFontMetric.
3843 ///
3844 ///
3845 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3846 /// # Arguments
3847 ///
3848 /// * `lineFontMetric` - Indicates the first address of the lineFontMetric gather to be destroyed.
3849 ///
3850 /// Available since API-level: 12
3851 ///
3852 /// Version: 1.0
3853 #[cfg(feature = "api-12")]
3854 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3855 pub fn OH_Drawing_TypographyDestroyLineFontMetrics(
3856 lineFontMetric: *mut OH_Drawing_Font_Metrics,
3857 );
3858 /// Mark the Typography as dirty, and initially state the Typography.
3859 ///
3860 ///
3861 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3862 /// # Arguments
3863 ///
3864 /// * `typography` - Indicates the pointer to the text <b>OH_Drawing_Typography</b> object.
3865 ///
3866 /// Available since API-level: 12
3867 ///
3868 /// Version: 1.0
3869 #[cfg(feature = "api-12")]
3870 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3871 pub fn OH_Drawing_TypographyMarkDirty(typography: *mut OH_Drawing_Typography);
3872 /// Get the unresolved Glyphs count of lines in a text.
3873 ///
3874 ///
3875 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3876 /// # Arguments
3877 ///
3878 /// * `typography` - Indicates the pointer to the text <b>OH_Drawing_Typography</b> object.
3879 ///
3880 /// # Returns
3881 ///
3882 /// * Returns unresolved Glyphs count.
3883 ///
3884 /// Available since API-level: 12
3885 ///
3886 /// Version: 1.0
3887 #[cfg(feature = "api-12")]
3888 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3889 pub fn OH_Drawing_TypographyGetUnresolvedGlyphsCount(
3890 typography: *mut OH_Drawing_Typography,
3891 ) -> i32;
3892 /// Update the font size of lines in a text.
3893 ///
3894 ///
3895 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3896 /// # Arguments
3897 ///
3898 /// * `typography` - Indicates the pointer to the text <b>OH_Drawing_Typography</b> object.
3899 ///
3900 /// * `from` - Indicates the source of the original font size.
3901 ///
3902 /// * `to` - Indicates the destination of the updated font size.
3903 ///
3904 /// * `fontSize` - Indicates the size of the font.
3905 ///
3906 /// Available since API-level: 12
3907 ///
3908 /// Version: 1.0
3909 #[cfg(feature = "api-12")]
3910 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3911 pub fn OH_Drawing_TypographyUpdateFontSize(
3912 typography: *mut OH_Drawing_Typography,
3913 from: usize,
3914 to: usize,
3915 fontSize: f32,
3916 );
3917 /// Get whether the text layout enables line styles.
3918 ///
3919 ///
3920 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3921 /// # Arguments
3922 ///
3923 /// * `style` - Indicates the pointer to the text <b>OH_Drawing_TypographyStyle</b> object.
3924 ///
3925 /// # Returns
3926 ///
3927 /// * Whether or not to enable line styles in text layout only, true means enable, false means disable.
3928 ///
3929 /// Available since API-level: 12
3930 ///
3931 /// Version: 1.0
3932 #[cfg(feature = "api-12")]
3933 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3934 pub fn OH_Drawing_TypographyTextGetLineStyle(style: *mut OH_Drawing_TypographyStyle) -> bool;
3935 /// Get the font weight of line style for text typography.
3936 ///
3937 ///
3938 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3939 /// # Arguments
3940 ///
3941 /// * `style` - Indicates the pointer to a typography style object
3942 /// <b>OH_Drawing_TypographyStyle</b>.
3943 ///
3944 /// # Returns
3945 ///
3946 /// * Return the font weight of line style for text typography.
3947 /// For details, see the enum <b>OH_Drawing_FontWeight</b>.
3948 ///
3949 /// Available since API-level: 12
3950 ///
3951 /// Version: 1.0
3952 #[cfg(feature = "api-12")]
3953 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3954 pub fn OH_Drawing_TypographyTextlineStyleGetFontWeight(
3955 style: *mut OH_Drawing_TypographyStyle,
3956 ) -> OH_Drawing_FontWeight;
3957 /// Get the font style of line style for text typography.
3958 ///
3959 ///
3960 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3961 /// # Arguments
3962 ///
3963 /// * `style` - Indicates the pointer to a typography style object
3964 /// <b>OH_Drawing_TypographyStyle</b>.
3965 ///
3966 /// # Returns
3967 ///
3968 /// * Return the font style of line style for text typography.
3969 /// For details, see the enum <b>OH_Drawing_FontStyle</b>.
3970 ///
3971 /// Available since API-level: 12
3972 ///
3973 /// Version: 1.0
3974 #[cfg(feature = "api-12")]
3975 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3976 pub fn OH_Drawing_TypographyTextlineStyleGetFontStyle(
3977 style: *mut OH_Drawing_TypographyStyle,
3978 ) -> OH_Drawing_FontStyle;
3979 /// Get the font families of line style for text typography.
3980 ///
3981 ///
3982 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
3983 /// # Arguments
3984 ///
3985 /// * `style` - Indicates the pointer to a typography style object
3986 /// <b>OH_Drawing_TypographyStyle</b>.
3987 ///
3988 /// * `num` - The number of obtained font names.
3989 ///
3990 /// # Returns
3991 ///
3992 /// * Return the font families of line style for text typography.
3993 ///
3994 /// Available since API-level: 12
3995 ///
3996 /// Version: 1.0
3997 #[cfg(feature = "api-12")]
3998 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
3999 pub fn OH_Drawing_TypographyTextlineStyleGetFontFamilies(
4000 style: *mut OH_Drawing_TypographyStyle,
4001 num: *mut usize,
4002 ) -> *mut *mut ::core::ffi::c_char;
4003 /// Releases the memory occupied by a list of font families names.
4004 ///
4005 ///
4006 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4007 /// # Arguments
4008 ///
4009 /// * `fontFamilies` - Indicates the pointer to a list of font families names.
4010 ///
4011 /// * `fontFamiliesNum` - Indicates the number of obtained font names.
4012 ///
4013 /// Available since API-level: 12
4014 ///
4015 /// Version: 1.0
4016 #[cfg(feature = "api-12")]
4017 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4018 pub fn OH_Drawing_TypographyTextlineStyleDestroyFontFamilies(
4019 fontFamilies: *mut *mut ::core::ffi::c_char,
4020 fontFamiliesNum: usize,
4021 );
4022 /// Get the font size of font size for text typography.
4023 ///
4024 ///
4025 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4026 /// # Arguments
4027 ///
4028 /// * `style` - Indicates the pointer to a typography style object
4029 /// <b>OH_Drawing_TypographyStyle</b>.
4030 ///
4031 /// # Returns
4032 ///
4033 /// * Return the font size of font size for text typography.
4034 ///
4035 /// Available since API-level: 12
4036 ///
4037 /// Version: 1.0
4038 #[cfg(feature = "api-12")]
4039 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4040 pub fn OH_Drawing_TypographyTextlineStyleGetFontSize(
4041 style: *mut OH_Drawing_TypographyStyle,
4042 ) -> f64;
4043 /// Get the font height scale in text layout.
4044 ///
4045 ///
4046 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4047 /// # Arguments
4048 ///
4049 /// * `style` - Indicates the pointer to a typography style object
4050 /// <b>OH_Drawing_TypographyStyle</b>.
4051 ///
4052 /// # Returns
4053 ///
4054 /// * Retrun the font height scale in text layout.
4055 ///
4056 /// Available since API-level: 12
4057 ///
4058 /// Version: 1.0
4059 #[cfg(feature = "api-12")]
4060 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4061 pub fn OH_Drawing_TypographyTextlineStyleGetHeightScale(
4062 style: *mut OH_Drawing_TypographyStyle,
4063 ) -> f64;
4064 /// Get whether to enable font height for line styles in text layout only.
4065 ///
4066 ///
4067 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4068 /// # Arguments
4069 ///
4070 /// * `style` - Indicates the pointer to a typography style object
4071 /// <b>OH_Drawing_TypographyStyle</b>.
4072 ///
4073 /// # Returns
4074 ///
4075 /// * Whether or not to enable the font height for line styles in text layout only,
4076 /// true means enable, false means disable.
4077 ///
4078 /// Available since API-level: 12
4079 ///
4080 /// Version: 1.0
4081 #[cfg(feature = "api-12")]
4082 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4083 pub fn OH_Drawing_TypographyTextlineStyleGetHeightOnly(
4084 style: *mut OH_Drawing_TypographyStyle,
4085 ) -> bool;
4086 /// Get the half leading of line style for text typography.
4087 ///
4088 ///
4089 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4090 /// # Arguments
4091 ///
4092 /// * `style` - Indicates the pointer to a typography style object
4093 /// <b>OH_Drawing_TypographyStyle</b>.
4094 ///
4095 /// # Returns
4096 ///
4097 /// * Whether to enable the text line half leading style, true means enable, false means disable.
4098 ///
4099 /// Available since API-level: 12
4100 ///
4101 /// Version: 1.0
4102 #[cfg(feature = "api-12")]
4103 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4104 pub fn OH_Drawing_TypographyTextlineStyleGetHalfLeading(
4105 style: *mut OH_Drawing_TypographyStyle,
4106 ) -> bool;
4107 /// Get the spacing scale of line style for text typography.
4108 ///
4109 ///
4110 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4111 /// # Arguments
4112 ///
4113 /// * `style` - Indicates the pointer to a typography style object
4114 /// <b>OH_Drawing_TypographyStyle</b>.
4115 ///
4116 /// # Returns
4117 ///
4118 /// * Return the spacing scale of line style for text typography.
4119 ///
4120 /// Available since API-level: 12
4121 ///
4122 /// Version: 1.0
4123 #[cfg(feature = "api-12")]
4124 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4125 pub fn OH_Drawing_TypographyTextlineStyleGetSpacingScale(
4126 style: *mut OH_Drawing_TypographyStyle,
4127 ) -> f64;
4128 /// Get whether only line style is enabled for text typography.
4129 ///
4130 ///
4131 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4132 /// # Arguments
4133 ///
4134 /// * `style` - Indicates the pointer to a typography style object
4135 /// <b>OH_Drawing_TypographyStyle</b>.
4136 ///
4137 /// # Returns
4138 ///
4139 /// * Returns whether only line style is enabled for text layout, true means it is enabled,
4140 /// false means it is not.
4141 ///
4142 /// Available since API-level: 12
4143 ///
4144 /// Version: 1.0
4145 #[cfg(feature = "api-12")]
4146 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4147 pub fn OH_Drawing_TypographyTextlineGetStyleOnly(
4148 style: *mut OH_Drawing_TypographyStyle,
4149 ) -> bool;
4150 /// Get the text alignment mode.
4151 ///
4152 ///
4153 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4154 /// # Arguments
4155 ///
4156 /// * `style` - Indicates the pointer to a typography style object
4157 /// <b>OH_Drawing_TypographyStyle</b>.
4158 ///
4159 /// # Returns
4160 ///
4161 /// * Return the text alignment mode. For details, see the enum <b>OH_Drawing_TextAlign</b>.
4162 ///
4163 /// Available since API-level: 12
4164 ///
4165 /// Version: 1.0
4166 #[cfg(feature = "api-12")]
4167 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4168 pub fn OH_Drawing_TypographyGetTextAlign(
4169 style: *mut OH_Drawing_TypographyStyle,
4170 ) -> OH_Drawing_TextAlign;
4171 /// Get the text direction.
4172 ///
4173 ///
4174 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4175 /// # Arguments
4176 ///
4177 /// * `style` - Indicates the pointer to a typography style object
4178 /// <b>OH_Drawing_TypographyStyle</b>.
4179 ///
4180 /// # Returns
4181 ///
4182 /// * Return the text direction. For details, see the enum <b>OH_Drawing_TextDirection</b>.
4183 ///
4184 /// Available since API-level: 12
4185 ///
4186 /// Version: 1.0
4187 #[cfg(feature = "api-12")]
4188 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4189 pub fn OH_Drawing_TypographyGetTextDirection(
4190 style: *mut OH_Drawing_TypographyStyle,
4191 ) -> OH_Drawing_TextDirection;
4192 /// Sets the maximum number of lines in a text.
4193 ///
4194 ///
4195 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4196 /// # Arguments
4197 ///
4198 /// * `style` - Indicates the pointer to a typography style object
4199 /// <b>OH_Drawing_TypographyStyle</b>.
4200 ///
4201 /// # Returns
4202 ///
4203 /// * Return the maximum number of lines in a text.
4204 ///
4205 /// Available since API-level: 12
4206 ///
4207 /// Version: 1.0
4208 #[cfg(feature = "api-12")]
4209 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4210 pub fn OH_Drawing_TypographyGetTextMaxLines(style: *mut OH_Drawing_TypographyStyle) -> usize;
4211 /// Get the ellipsis of lines in a text.
4212 ///
4213 ///
4214 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4215 /// # Arguments
4216 ///
4217 /// * `style` - Indicates the pointer to a typography style object
4218 /// <b>OH_Drawing_TypographyStyle</b>.
4219 ///
4220 /// # Returns
4221 ///
4222 /// * Return the ellipsis of lines in a text.
4223 ///
4224 /// Available since API-level: 12
4225 ///
4226 /// Version: 1.0
4227 #[cfg(feature = "api-12")]
4228 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4229 pub fn OH_Drawing_TypographyGetTextEllipsis(
4230 style: *mut OH_Drawing_TypographyStyle,
4231 ) -> *mut ::core::ffi::c_char;
4232 /// Releases the memory occupied by a list of Ellipsis names.
4233 ///
4234 ///
4235 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4236 /// # Arguments
4237 ///
4238 /// * `ellipsis` - Indicates the pointer to a list of Ellipsis names.
4239 ///
4240 /// Available since API-level: 12
4241 ///
4242 /// Version: 1.0
4243 #[cfg(feature = "api-12")]
4244 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4245 pub fn OH_Drawing_TypographyDestroyEllipsis(ellipsis: *mut ::core::ffi::c_char);
4246 /// Overriding the class ParagraphStyle equals operator.
4247 ///
4248 ///
4249 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4250 /// # Arguments
4251 ///
4252 /// * `from` - Indicates source of comparison object.
4253 ///
4254 /// * `to` - Indicates comparison object.
4255 ///
4256 /// # Returns
4257 ///
4258 /// * Compare result.
4259 ///
4260 /// Available since API-level: 12
4261 ///
4262 /// Version: 1.0
4263 #[cfg(feature = "api-12")]
4264 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4265 pub fn OH_Drawing_TypographyStyleEquals(
4266 from: *mut OH_Drawing_TypographyStyle,
4267 to: *mut OH_Drawing_TypographyStyle,
4268 ) -> bool;
4269 /// Releases the memory occupied by text box.
4270 ///
4271 ///
4272 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4273 /// # Arguments
4274 ///
4275 /// * `textBox` - Indicates the pointer to a text box object <b>OH_Drawing_TextBox</b>.
4276 ///
4277 /// Available since API-level: 12
4278 ///
4279 /// Version: 1.0
4280 #[cfg(feature = "api-12")]
4281 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4282 pub fn OH_Drawing_TypographyDestroyTextBox(textBox: *mut OH_Drawing_TextBox);
4283 /// Sets the parameter of text-shadow.
4284 ///
4285 ///
4286 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4287 /// # Arguments
4288 ///
4289 /// * `shadow` - Indicates the pointer to an <b>OH_Drawing_TextShadow</b> object.
4290 ///
4291 /// * `color` - Indicates the color setting of text-shadow.
4292 ///
4293 /// * `offset` - Indicates the pointer to an <b>OH_Drawing_Point</b> object.
4294 ///
4295 /// * `blurRadius` - Indicates the radius of blur for text-shadow.
4296 ///
4297 /// Available since API-level: 12
4298 ///
4299 /// Version: 1.0
4300 #[cfg(feature = "api-12")]
4301 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
4302 pub fn OH_Drawing_SetTextShadow(
4303 shadow: *mut OH_Drawing_TextShadow,
4304 color: u32,
4305 offset: *mut OH_Drawing_Point,
4306 blurRadius: f64,
4307 );
4308 /// Get DrawingArray size.
4309 ///
4310 ///
4311 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
4312 /// # Arguments
4313 ///
4314 /// * `drawingArray` - Indicates the pointer to the array object <b>OH_Drawing_Array</b>.
4315 ///
4316 /// # Returns
4317 ///
4318 /// * Size of array.
4319 ///
4320 /// Available since API-level: 14
4321 ///
4322 /// Version: 1.0
4323 #[cfg(feature = "api-14")]
4324 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
4325 pub fn OH_Drawing_GetDrawingArraySize(drawingArray: *mut OH_Drawing_Array) -> usize;
4326}