1#![allow(clippy::too_many_arguments)]
13use crate::common::{ClipType, CoordType, Granularity};
16
17#[zbus::proxy(interface = "org.a11y.atspi.Text", assume_defaults = true)]
18pub trait Text {
19 fn add_selection(&self, start_offset: i32, end_offset: i32) -> zbus::Result<bool>;
21
22 fn get_attribute_run(
24 &self,
25 offset: i32,
26 include_defaults: bool,
27 ) -> zbus::Result<(std::collections::HashMap<String, String>, i32, i32)>;
28
29 fn get_attribute_value(&self, offset: i32, attribute_name: &str) -> zbus::Result<String>;
31
32 fn get_attributes(
34 &self,
35 offset: i32,
36 ) -> zbus::Result<(std::collections::HashMap<String, String>, i32, i32)>;
37
38 fn get_bounded_ranges(
40 &self,
41 x: i32,
42 y: i32,
43 width: i32,
44 height: i32,
45 coord_type: CoordType,
46 x_clip_type: ClipType,
47 y_clip_type: ClipType,
48 ) -> zbus::Result<Vec<(i32, i32, String, zbus::zvariant::OwnedValue)>>;
49
50 fn get_character_at_offset(&self, offset: i32) -> zbus::Result<i32>;
52
53 fn get_character_extents(
55 &self,
56 offset: i32,
57 coord_type: CoordType,
58 ) -> zbus::Result<(i32, i32, i32, i32)>;
59
60 fn get_default_attribute_set(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
62
63 fn get_default_attributes(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
65
66 fn get_nselections(&self) -> zbus::Result<i32>;
68
69 fn get_offset_at_point(&self, x: i32, y: i32, coord_type: CoordType) -> zbus::Result<i32>;
71
72 fn get_range_extents(
74 &self,
75 start_offset: i32,
76 end_offset: i32,
77 coord_type: CoordType,
78 ) -> zbus::Result<(i32, i32, i32, i32)>;
79
80 fn get_selection(&self, selection_num: i32) -> zbus::Result<(i32, i32)>;
82
83 fn get_string_at_offset(
85 &self,
86 offset: i32,
87 granularity: Granularity,
88 ) -> zbus::Result<(String, i32, i32)>;
89
90 fn get_text(&self, start_offset: i32, end_offset: i32) -> zbus::Result<String>;
92
93 fn get_text_after_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
95
96 fn get_text_at_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
98
99 fn get_text_before_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
101
102 fn remove_selection(&self, selection_num: i32) -> zbus::Result<bool>;
104
105 fn scroll_substring_to(
107 &self,
108 start_offset: i32,
109 end_offset: i32,
110 type_: u32,
111 ) -> zbus::Result<bool>;
112
113 fn scroll_substring_to_point(
115 &self,
116 start_offset: i32,
117 end_offset: i32,
118 type_: u32,
119 x: i32,
120 y: i32,
121 ) -> zbus::Result<bool>;
122
123 fn set_caret_offset(&self, offset: i32) -> zbus::Result<bool>;
125
126 fn set_selection(
128 &self,
129 selection_num: i32,
130 start_offset: i32,
131 end_offset: i32,
132 ) -> zbus::Result<bool>;
133
134 #[zbus(property)]
136 fn caret_offset(&self) -> zbus::Result<i32>;
137
138 #[zbus(property)]
140 fn character_count(&self) -> zbus::Result<i32>;
141}