1 | // Copyright 2022 The AccessKit Authors. All rights reserved. |
2 | // Licensed under the Apache License, Version 2.0 (found in |
3 | // the LICENSE-APACHE file) or the MIT license (found in |
4 | // the LICENSE-MIT file), at your option. |
5 | |
6 | use accesskit::NodeId; |
7 | use atspi_common::{Live, Role, State}; |
8 | |
9 | use crate::{NodeIdOrRoot, Rect}; |
10 | |
11 | #[derive (Debug)] |
12 | pub enum Event { |
13 | Object { |
14 | target: NodeIdOrRoot, |
15 | event: ObjectEvent, |
16 | }, |
17 | Window { |
18 | target: NodeId, |
19 | name: String, |
20 | event: WindowEvent, |
21 | }, |
22 | } |
23 | |
24 | #[derive (Debug)] |
25 | pub enum Property { |
26 | Name(String), |
27 | Description(String), |
28 | Parent(NodeIdOrRoot), |
29 | Role(Role), |
30 | Value(f64), |
31 | } |
32 | |
33 | #[allow (clippy::enum_variant_names)] |
34 | #[derive (Debug)] |
35 | pub enum ObjectEvent { |
36 | ActiveDescendantChanged(NodeId), |
37 | Announcement(String, Live), |
38 | BoundsChanged(Rect), |
39 | ChildAdded(usize, NodeId), |
40 | ChildRemoved(NodeId), |
41 | PropertyChanged(Property), |
42 | StateChanged(State, bool), |
43 | } |
44 | |
45 | #[derive (Debug)] |
46 | pub enum WindowEvent { |
47 | Activated, |
48 | Deactivated, |
49 | } |
50 | |