Class: ATSPI::Accessible::Children
- Inherits:
-
Object
- Object
- ATSPI::Accessible::Children
- Includes:
- SelectableCollection
- Defined in:
- lib/atspi/accessible/children.rb
Overview
Wraps the children part of libatspi’s AtspiAccessible and parts of AtspiSelection.
Direct Known Subclasses
Defined Under Namespace
Classes: Selected
Enumerable interface collapse
-
#[](idx) ⇒ Object
included
from Collection
alias for #at.
-
#at(idx) ⇒ Accessible
Its child at index
idx
. -
#count ⇒ Integer
Its number of children.
-
#each ⇒ Object
included
from Collection
prerequisite for Enumerable.
-
#last(n = 1) ⇒ Object+
included
from Collection
Item(s) from the end.
-
#length ⇒ Object
included
from Collection
alias for #count.
-
#size ⇒ Object
included
from Collection
alias for #count.
Selection collapse
-
#deselect_all ⇒ true, false
Tries to deselect all children.
-
#select_all ⇒ true, false
Tries to select all children.
-
#selectable? ⇒ true, false
Checks if the accessible the children belong to implements the selection interface.
-
#selected ⇒ Selected, []
Its selected subset.
Representation collapse
-
#inspect ⇒ String
included
from SelectableCollection
Instance as inspectable string.
Instance Method Details
#[](idx) ⇒ Object Originally defined in module Collection
alias for #at
#at(idx) ⇒ Accessible
Returns its child at index idx
.
18 19 20 21 22 |
# File 'lib/atspi/accessible/children.rb', line 18 def at(idx) super do |mapped_idx| Accessible.new(@native.child_at_index(mapped_idx)) end end |
#count ⇒ Integer
Returns its number of children.
27 28 29 |
# File 'lib/atspi/accessible/children.rb', line 27 def count @native.child_count end |
#deselect_all ⇒ true, false
Tries to deselect all children
67 68 69 |
# File 'lib/atspi/accessible/children.rb', line 67 def deselect_all selectable? and @native.clear_selection end |
#each ⇒ Object Originally defined in module Collection
prerequisite for Enumerable
#inspect ⇒ String Originally defined in module SelectableCollection
Returns instance as inspectable string.
#last(n = 1) ⇒ Object+ Originally defined in module Collection
Returns item(s) from the end.
#length ⇒ Object Originally defined in module Collection
alias for #count
#select_all ⇒ true, false
Tries to select all children
58 59 60 |
# File 'lib/atspi/accessible/children.rb', line 58 def select_all selectable? and @native.select_all end |
#selectable? ⇒ true, false
Checks if the accessible the children belong to implements the selection interface.
39 40 41 |
# File 'lib/atspi/accessible/children.rb', line 39 def selectable? not @native.selection_iface.nil? end |
#selected ⇒ Selected, []
Returns its selected subset. It will be an empty array if children are not selectable.
45 46 47 48 49 50 51 |
# File 'lib/atspi/accessible/children.rb', line 45 def selected if selectable? Selected.new(@native) else [] end end |
#size ⇒ Object Originally defined in module Collection
alias for #count