atspi_proxies/
text.rs

1//! # `DBus` interface proxy for: `org.a11y.atspi.Text`
2//!
3//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
4//! Source: `Text.xml`.
5//!
6//! You may prefer to adapt it, instead of using it verbatim.
7//!
8//! More information can be found in the
9//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
10//! section of the zbus documentation.
11//!
12#![allow(clippy::too_many_arguments)]
13// this is to silence clippy due to zbus expanding parameter expressions
14
15use crate::common::{ClipType, CoordType, Granularity};
16
17#[zbus::proxy(interface = "org.a11y.atspi.Text", assume_defaults = true)]
18pub trait Text {
19	/// `AddSelection` method
20	fn add_selection(&self, start_offset: i32, end_offset: i32) -> zbus::Result<bool>;
21
22	/// `GetAttributeRun` method
23	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	/// `GetAttributeValue` method
30	fn get_attribute_value(&self, offset: i32, attribute_name: &str) -> zbus::Result<String>;
31
32	/// `GetAttributes` method
33	fn get_attributes(
34		&self,
35		offset: i32,
36	) -> zbus::Result<(std::collections::HashMap<String, String>, i32, i32)>;
37
38	/// `GetBoundedRanges` method
39	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	/// `GetCharacterAtOffset` method
51	fn get_character_at_offset(&self, offset: i32) -> zbus::Result<i32>;
52
53	/// `GetCharacterExtents` method
54	fn get_character_extents(
55		&self,
56		offset: i32,
57		coord_type: CoordType,
58	) -> zbus::Result<(i32, i32, i32, i32)>;
59
60	/// `GetDefaultAttributeSet` method
61	fn get_default_attribute_set(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
62
63	/// `GetDefaultAttributes` method
64	fn get_default_attributes(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
65
66	/// `GetNSelections` method
67	fn get_nselections(&self) -> zbus::Result<i32>;
68
69	/// `GetOffsetAtPoint` method
70	fn get_offset_at_point(&self, x: i32, y: i32, coord_type: CoordType) -> zbus::Result<i32>;
71
72	/// `GetRangeExtents` method
73	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	/// `GetSelection` method
81	fn get_selection(&self, selection_num: i32) -> zbus::Result<(i32, i32)>;
82
83	/// `GetStringAtOffset` method
84	fn get_string_at_offset(
85		&self,
86		offset: i32,
87		granularity: Granularity,
88	) -> zbus::Result<(String, i32, i32)>;
89
90	/// `GetText` method
91	/// This should be called with explicitly known offsets. Calling with an arbitrary
92	/// large offset can cause undefined behavior or no text to be returned.
93	fn get_text(&self, start_offset: i32, end_offset: i32) -> zbus::Result<String>;
94
95	/// `GetTextAfterOffset` method
96	fn get_text_after_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
97
98	/// `GetTextAtOffset` method
99	fn get_text_at_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
100
101	/// `GetTextBeforeOffset` method
102	fn get_text_before_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
103
104	/// `RemoveSelection` method
105	fn remove_selection(&self, selection_num: i32) -> zbus::Result<bool>;
106
107	/// `ScrollSubstringTo` method
108	fn scroll_substring_to(
109		&self,
110		start_offset: i32,
111		end_offset: i32,
112		type_: u32,
113	) -> zbus::Result<bool>;
114
115	/// `ScrollSubstringToPoint` method
116	fn scroll_substring_to_point(
117		&self,
118		start_offset: i32,
119		end_offset: i32,
120		type_: u32,
121		x: i32,
122		y: i32,
123	) -> zbus::Result<bool>;
124
125	/// `SetCaretOffset` method
126	fn set_caret_offset(&self, offset: i32) -> zbus::Result<bool>;
127
128	/// `SetSelection` method
129	fn set_selection(
130		&self,
131		selection_num: i32,
132		start_offset: i32,
133		end_offset: i32,
134	) -> zbus::Result<bool>;
135
136	/// `CaretOffset` property
137	#[zbus(property)]
138	fn caret_offset(&self) -> zbus::Result<i32>;
139
140	/// `CharacterCount` property
141	#[zbus(property)]
142	fn character_count(&self) -> zbus::Result<i32>;
143}