gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Interfaces.Accessible

Description

GtkAccessible is an interface for describing UI elements for Assistive Technologies.

Every accessible implementation has:

The role cannot be changed after instantiating a GtkAccessible implementation.

The attributes are updated every time a UI element's state changes in a way that should be reflected by assistive technologies. For instance, if a GtkWidget visibility changes, the AccessibleStateHidden state will also change to reflect the Widget:visible property.

Every accessible implementation is part of a tree of accessible objects. Normally, this tree corresponds to the widget tree, but can be customized by reimplementing the Accessible.get_accessible_parent(), Accessible.get_first_accessible_child() and Accessible.get_next_accessible_sibling() virtual functions. Note that you can not create a top-level accessible object as of now, which means that you must always have a parent accessible object. Also note that when an accessible object does not correspond to a widget, and it has children, whose implementation you don't control, it is necessary to ensure the correct shape of the a11y tree by calling accessibleSetAccessibleParent and updating the sibling by accessibleUpdateNextAccessibleSibling.

Synopsis

Exported types

newtype Accessible Source #

Memory-managed wrapper type.

Constructors

Accessible (ManagedPtr Accessible) 

Instances

Instances details
Eq Accessible Source # 
Instance details

Defined in GI.Gtk.Interfaces.Accessible

GObject Accessible Source # 
Instance details

Defined in GI.Gtk.Interfaces.Accessible

ManagedPtrNewtype Accessible Source # 
Instance details

Defined in GI.Gtk.Interfaces.Accessible

Methods

toManagedPtr :: Accessible -> ManagedPtr Accessible

TypedObject Accessible Source # 
Instance details

Defined in GI.Gtk.Interfaces.Accessible

Methods

glibType :: IO GType

HasParentTypes Accessible Source # 
Instance details

Defined in GI.Gtk.Interfaces.Accessible

IsGValue (Maybe Accessible) Source #

Convert Accessible to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Interfaces.Accessible

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Accessible -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Accessible)

type ParentTypes Accessible Source # 
Instance details

Defined in GI.Gtk.Interfaces.Accessible

type ParentTypes Accessible = '[Object]

class (GObject o, IsDescendantOf Accessible o) => IsAccessible o Source #

Type class for types which can be safely cast to Accessible, for instance with toAccessible.

Instances

Instances details
(GObject o, IsDescendantOf Accessible o) => IsAccessible o Source # 
Instance details

Defined in GI.Gtk.Interfaces.Accessible

toAccessible :: (MonadIO m, IsAccessible o) => o -> m Accessible Source #

Cast to Accessible, for types for which this is known to be safe. For general casts, use castTo.

Methods

getAccessibleParent

accessibleGetAccessibleParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> m (Maybe Accessible)

Returns: the accessible parent

Retrieves the accessible parent for an accessible object.

This function returns NULL for top level widgets.

Since: 4.10

getAccessibleRole

accessibleGetAccessibleRole Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: an accessible object

-> m AccessibleRole

Returns: the accessible role

Retrieves the accessible role of an accessible object.

getAtContext

accessibleGetAtContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> m ATContext

Returns: the accessible implementation object

Retrieves the accessible implementation for the given GtkAccessible.

Since: 4.10

getBounds

accessibleGetBounds Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> m (Bool, Int32, Int32, Int32, Int32)

Returns: true if the bounds are valid, and false otherwise

Queries the coordinates and dimensions of this accessible

This functionality can be overridden by GtkAccessible implementations, e.g. to get the bounds from an ignored child widget.

Since: 4.10

getFirstAccessibleChild

accessibleGetFirstAccessibleChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: an accessible object

-> m (Maybe Accessible)

Returns: the first accessible child

Retrieves the first accessible child of an accessible object.

Since: 4.10

getNextAccessibleSibling

accessibleGetNextAccessibleSibling Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: an accessible object

-> m (Maybe Accessible)

Returns: the next accessible sibling

Retrieves the next accessible sibling of an accessible object

Since: 4.10

getPlatformState

accessibleGetPlatformState Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> AccessiblePlatformState

state: platform state to query

-> m Bool

Returns: the value of state for the accessible

Query a platform state, such as focus.

See gtk_accessible_platform_changed().

This functionality can be overridden by GtkAccessible implementations, e.g. to get platform state from an ignored child widget, as is the case for GtkText wrappers.

Since: 4.10

resetProperty

accessibleResetProperty Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> AccessibleProperty

property: a GtkAccessibleProperty

-> m () 

Resets the accessible property to its default value.

resetRelation

accessibleResetRelation Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> AccessibleRelation

relation: a GtkAccessibleRelation

-> m () 

Resets the accessible relation to its default value.

resetState

accessibleResetState Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> AccessibleState

state: a GtkAccessibleState

-> m () 

Resets the accessible state to its default value.

setAccessibleParent

accessibleSetAccessibleParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a, IsAccessible b, IsAccessible c) 
=> a

self: an accessible object

-> Maybe b

parent: the parent accessible object

-> Maybe c

nextSibling: the sibling accessible object

-> m () 

Sets the parent and sibling of an accessible object.

This function is meant to be used by accessible implementations that are not part of the widget hierarchy, and but act as a logical bridge between widgets. For instance, if a widget creates an object that holds metadata for each child, and you want that object to implement the GtkAccessible interface, you will use this function to ensure that the parent of each child widget is the metadata object, and the parent of each metadata object is the container widget.

Since: 4.10

updateNextAccessibleSibling

accessibleUpdateNextAccessibleSibling Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a, IsAccessible b) 
=> a

self: a GtkAccessible

-> Maybe b

newSibling: the new next accessible sibling to set

-> m () 

Updates the next accessible sibling of self.

That might be useful when a new child of a custom GtkAccessible is created, and it needs to be linked to a previous child.

Since: 4.10

updateProperty

accessibleUpdateProperty Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> [AccessibleProperty]

properties: an array of GtkAccessibleProperty

-> [GValue]

values: an array of GValues, one for each property

-> m () 

Updates an array of accessible properties.

This function should be called by GtkWidget types whenever an accessible property change must be communicated to assistive technologies.

This function is meant to be used by language bindings.

updateRelation

accessibleUpdateRelation Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> [AccessibleRelation]

relations: an array of GtkAccessibleRelation

-> [GValue]

values: an array of GValues, one for each relation

-> m () 

Updates an array of accessible relations.

This function should be called by GtkWidget types whenever an accessible relation change must be communicated to assistive technologies.

This function is meant to be used by language bindings.

updateState

accessibleUpdateState Source #

Arguments

:: (HasCallStack, MonadIO m, IsAccessible a) 
=> a

self: a GtkAccessible

-> [AccessibleState]

states: an array of GtkAccessibleState

-> [GValue]

values: an array of GValues, one for each state

-> m () 

Updates an array of accessible states.

This function should be called by GtkWidget types whenever an accessible state change must be communicated to assistive technologies.

This function is meant to be used by language bindings.

Properties

accessibleRole

The accessible role of the given GtkAccessible implementation.

The accessible role cannot be changed once set.

constructAccessibleAccessibleRole :: (IsAccessible o, MonadIO m) => AccessibleRole -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “accessible-role” property. This is rarely needed directly, but it is used by new.

getAccessibleAccessibleRole :: (MonadIO m, IsAccessible o) => o -> m AccessibleRole Source #

Get the value of the “accessible-role” property. When overloading is enabled, this is equivalent to

get accessible #accessibleRole

setAccessibleAccessibleRole :: (MonadIO m, IsAccessible o) => o -> AccessibleRole -> m () Source #

Set the value of the “accessible-role” property. When overloading is enabled, this is equivalent to

set accessible [ #accessibleRole := value ]