Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some docs #199

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions atspi-common/src/events/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ pub struct AttributesChangedEvent {
pub item: crate::events::ObjectRef,
}

/// The focused page has changed. This event is usually sent only by document readers, signaling
/// that the _physical page equivalent is now different.
/// This event does not encode _which_ page is the new one, only that a new page is now the primary
/// one.
///
/// See `atspi_proxies::document::DocumentProxy::current_page_number` to actively find the
/// page number.
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, Eq, Hash, Default)]
pub struct PageChangedEvent {
/// The [`ObjectRef`] which the event applies to.
Expand Down
7 changes: 7 additions & 0 deletions atspi-common/src/events/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ impl HasMatchRule for ObjectEvents {
pub struct PropertyChangeEvent {
/// The [`ObjectRef`] which the event applies to.
pub item: crate::events::ObjectRef,
// TODO: this is not necessary since the string is encoded in the `Property` type.
pub property: String,
pub value: Property,
}
Expand All @@ -254,6 +255,9 @@ impl Default for PropertyChangeEvent {
}
}

/// Any accessibility related property on an [`ObjectRef`].
/// This is used only in the [`PropertyChangeEvent`]; this event gets triggered if a role or accessible
/// description of an item changes.
#[derive(Debug, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub enum Property {
Expand Down Expand Up @@ -563,6 +567,9 @@ pub struct TextChangedEvent {
pub text: String,
}

/// Signal that some attributes about the text (usually styling) have changed.
/// This event does not encode _what_ has changed about the attributes, merely that they have
/// changed.
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, Eq, Hash, Default)]
pub struct TextAttributesChangedEvent {
/// The [`ObjectRef`] which the event applies to.
Expand Down
Loading