1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use crate::{services::{MouseCursor, PointerEnterEventListener, PointerExitEventListener}, ui::Locale, gestures::GestureRecognizer};
use super::{TextStyle, InlineSpan};
pub struct TextSpan {
// Additional spans to include as children.
pub children: Vec<Box<dyn InlineSpan>>,
// Returns the value of mouseCursor.
pub cursor: MouseCursor,
// The language of the text in this span and its span children.
pub locale: Option<Locale>,
// Mouse cursor when the mouse hovers over this span.
pub mouse_cursor: MouseCursor,
// Triggered when a mouse pointer, with or without buttons pressed, has entered the region and validForMouseTracker is true.
pub on_enter: PointerEnterEventListener,
// Triggered when a mouse pointer, with or without buttons pressed, has exited the region and validForMouseTracker is true.
pub on_exit: PointerExitEventListener,
// A gesture recognizer that will receive events that hit this span.
pub recognizer: GestureRecognizer,
// An alternative semantics label for this TextSpan.
pub semantics_label: String,
// Whether the assistive technologies should spell out this text character by character.
pub spell_out: bool,
// The TextStyle to apply to this span.
pub style: TextStyle,
// The text contained in this span.
pub text: String,
// Whether this is included when MouseTracker collects the list of annotations.
pub valid_for_mouse_tracker: bool,
}
impl Default for TextSpan {
fn default() -> Self {
Self {
children: Default::default(),
cursor: Default::default(),
locale: Default::default(),
mouse_cursor: Default::default(),
on_enter: box |_| {},
on_exit: box |_| {},
recognizer: Default::default(),
semantics_label: Default::default(),
spell_out: Default::default(),
style: Default::default(),
text: Default::default(),
valid_for_mouse_tracker: Default::default(),
}
}
}