1#![allow(clippy::too_many_arguments)]
13use crate::atspi_proxy;
16use crate::common::{ClipType, CoordType, Granularity};
17
18#[atspi_proxy(interface = "org.a11y.atspi.Text", assume_defaults = true)]
19trait Text {
20 fn add_selection(&self, start_offset: i32, end_offset: i32) -> zbus::Result<bool>;
22
23 fn get_attribute_run(
25 &self,
26 offset: i32,
27 include_defaults: bool,
28 ) -> zbus::Result<(std::collections::HashMap<String, String>, i32, i32)>;
29
30 fn get_attribute_value(&self, offset: i32, attribute_name: &str) -> zbus::Result<String>;
32
33 fn get_attributes(
35 &self,
36 offset: i32,
37 ) -> zbus::Result<(std::collections::HashMap<String, String>, i32, i32)>;
38
39 fn get_bounded_ranges(
41 &self,
42 x: i32,
43 y: i32,
44 width: i32,
45 height: i32,
46 coord_type: CoordType,
47 x_clip_type: ClipType,
48 y_clip_type: ClipType,
49 ) -> zbus::Result<Vec<(i32, i32, String, zbus::zvariant::OwnedValue)>>;
50
51 fn get_character_at_offset(&self, offset: i32) -> zbus::Result<i32>;
53
54 fn get_character_extents(
56 &self,
57 offset: i32,
58 coord_type: CoordType,
59 ) -> zbus::Result<(i32, i32, i32, i32)>;
60
61 fn get_default_attribute_set(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
63
64 fn get_default_attributes(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
66
67 fn get_nselections(&self) -> zbus::Result<i32>;
69
70 fn get_offset_at_point(&self, x: i32, y: i32, coord_type: CoordType) -> zbus::Result<i32>;
72
73 fn get_range_extents(
75 &self,
76 start_offset: i32,
77 end_offset: i32,
78 coord_type: CoordType,
79 ) -> zbus::Result<(i32, i32, i32, i32)>;
80
81 fn get_selection(&self, selection_num: i32) -> zbus::Result<(i32, i32)>;
83
84 fn get_string_at_offset(
86 &self,
87 offset: i32,
88 granularity: Granularity,
89 ) -> zbus::Result<(String, i32, i32)>;
90
91 fn get_text(&self, start_offset: i32, end_offset: i32) -> zbus::Result<String>;
93
94 fn get_text_after_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
96
97 fn get_text_at_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
99
100 fn get_text_before_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
102
103 fn remove_selection(&self, selection_num: i32) -> zbus::Result<bool>;
105
106 fn scroll_substring_to(
108 &self,
109 start_offset: i32,
110 end_offset: i32,
111 type_: u32,
112 ) -> zbus::Result<bool>;
113
114 fn scroll_substring_to_point(
116 &self,
117 start_offset: i32,
118 end_offset: i32,
119 type_: u32,
120 x: i32,
121 y: i32,
122 ) -> zbus::Result<bool>;
123
124 fn set_caret_offset(&self, offset: i32) -> zbus::Result<bool>;
126
127 fn set_selection(
129 &self,
130 selection_num: i32,
131 start_offset: i32,
132 end_offset: i32,
133 ) -> zbus::Result<bool>;
134
135 #[dbus_proxy(property)]
137 fn caret_offset(&self) -> zbus::Result<i32>;
138
139 #[dbus_proxy(property)]
141 fn character_count(&self) -> zbus::Result<i32>;
142}