# Accessibility::Component Interface Reference

`import "Accessibility_Component.idl";`

## Public Member Functions

boolean | contains (in long x, in long y, in short coord_type)
Accessible | getAccessibleAtPoint (in long x, in long y, in short coord_type)
BoundingBox | getExtents (in short coord_type)
void | getPosition (out long x, out long y, in short coord_type)
void | getSize (out long width, out long height)
ComponentLayer | getLayer ()
short | getMDIZOrder ()
boolean | grabFocus ()
void | registerFocusHandler (in EventListener handler)
void | deregisterFocusHandler (in EventListener handler)
double | getAlpha ()

## Detailed Description

The Component interface is implemented by objects which occupy on-screen space, e.g. objects which have onscreen visual representations. The methods in Component allow clients to identify where the objects lie in the onscreen coordinate system, their relative size, stacking order, and position. It also provides a mechanism whereby keyboard focus may be transferred to specific user interface elements programmatically. This is a 2D API, coordinates of 3D objects are projected into the 2-dimensional screen view for purposes of this interface.

Note:
  the meaning and defined values of the `short` `coord_type` parameter used by some Component methods is as follows:
  - 0 indicates coord_type_xy_screen, coordinates are relative to the display screen, in pixels.
  - 1 indicates coord_type_xy_window, coordinates are relative to the current toplevel window, in pixels.

  Events emitted by Component instances include:

  - `"object:bounds-changed"`
  - `"object:visible-data-changed"`

## Member Function Documentation

boolean Accessibility::Component::contains | ( | in long | x,
|  | in long | y,
|  | in short | coord_type |
| ) |  |  |

Returns:
  `True` if the specified point lies within the Component's bounding box, `False` otherwise.

Accessible Accessibility::Component::getAccessibleAtPoint | ( | in long | x,
|  | in long | y,
|  | in short | coord_type |
| ) |  |  |

Returns:
  the Accessible child whose bounding box contains the specified point.

BoundingBox Accessibility::Component::getExtents | ( | in short | coord_type | ) |

Obtain the Component's bounding box, in pixels, relative to the specified coordinate system.

Returns:
  a BoundingBox which entirely contains the object's onscreen visual representation.

void Accessibility::Component::getPosition | ( | out long | x,
|  | out long | y,
|  | in short | coord_type |
| ) |  |  |

Obtain the position of the current component in the coordinate system specified by `coord_type`.

Parameters:

  | coord_type |
  | x | an out parameter which will be back-filled with the returned x coordinate.
  | y | an out parameter which will be back-filled with the returned y coordinate.

void Accessibility::Component::getSize | ( | out long | width,
|  | out long | height |
| ) |  |  |

Obtain the size, in the coordinate system specified by `coord_type`, of the rectangular area which fully contains the object's visual representation, without accounting for viewport clipping.

Parameters:

  | width | the object's horizontal extents in the specified coordinate system.
  | height | the object's vertical extents in the specified coordinate system.

ComponentLayer Accessibility::Component::getLayer | ( |  | ) |

Returns:
  the ComponentLayer in which this object resides.

short Accessibility::Component::getMDIZOrder | ( |  | ) |

Obtain the relative stacking order (i.e. 'Z' order) of an object. Larger values indicate that an object is on "top" of the stack, therefore objects with smaller MDIZOrder may be obscured by objects with a larger MDIZOrder, but not vice-versa.

Note:
  only relevant for objects in LAYER_MDI or LAYER_WINDOW

Returns:
  an integer indicating the object's place in the stacking order.

boolean Accessibility::Component::grabFocus | ( |  | ) |

Request that the object obtain keyboard focus.

Returns:
  `True` if keyboard focus was successfully transferred to the Component.

void Accessibility::Component::registerFocusHandler | ( | in EventListener | handler | ) |

Register an EventListener for notification when this object receives keyboard focus.

Note:
  you probably want to register for ¨focus:¨ events via Registry::registerGlobalEventListener instead.

void Accessibility::Component::deregisterFocusHandler | ( | in EventListener | handler | ) |

Request that an EventListener registered via registerFocusHandler no longer be notified when this object receives keyboard focus.

double Accessibility::Component::getAlpha | ( |  | ) |

Obtain the alpha value of the component. An alpha value of 1.0 or greater indicates that the object is fully opaque, and an alpha value of 0.0 indicates that the object is fully transparent. Negative alpha values have no defined meaning at this time.

Note:
  alpha values are used in conjunction with Z-order calculations to determine whether an object wholly or partially obscures another object's visual intersection, in the event that their bounds intersect.

See also:
  STATE_OPAQUE

Since:
  AT-SPI 1.7.0

The documentation for this interface was generated from the following file:

- /home/liyuan/src/at-spi/idl/Accessibility_Component.idl