public TextEventHandler (Element element) { this.element = element; element.accessible.ObjectEvents.TextChanged += OnTextChanged; element.accessible.ObjectEvents.TextSelectionChanged += OnTextSelectionChanged; }
public ValueEventHandler (Element element) { this.element = element; currentValue = Text.GetText (); element.accessible.ObjectEvents.TextChanged += OnTextChanged; }
public SelectionEventHandler (Element element, SelectionSource source) { this.source = source; this.element = element; oldSelection = source.GetSelection (); element.accessible.ObjectEvents.SelectionChanged += OnSelectionChanged; }
public GridEventHandler (Element element) { this.element = element; element.accessible.ObjectEvents.RowInserted += OnRowInserted; element.accessible.ObjectEvents.RowDeleted += OnRowDeleted; element.accessible.ObjectEvents.ColumnInserted += OnColumnInserted; element.accessible.ObjectEvents.ColumnDeleted += OnColumnDeleted; }
public RangeValueEventHandler (Element element) { this.element = element; try { currentValue = Value.CurrentValue; } catch (Exception) { } element.accessible.ObjectEvents.PropertyChange += OnPropertyChange; }
public ExpandCollapseSource (Element element) { accessible = (element is DataItemElement ? ((Element)element.FirstChild).Accessible : element.Accessible); action = accessible.QueryAction (); ActionDescription [] actions = action.Actions; for (int i = 0; i < actions.Length; i++) { if (actions [i].Name == "expand or contract" || actions [i].Name == "expand or collapse") { expandOrContractAction = i; break; } } }
public IElement [] GetColumnHeaderItems () { // TODO: would be nice if at-spi made this easier Accessible accessible = table.GetColumnHeader (0); // If that returned null, then maybe we have no // headers, so not going to query every single row if (accessible == null) return new Element [0]; int count = table.NColumns; Element [] elements = new Element [count]; elements [0] = Element.GetElement (accessible); for (int i = 1; i < count; i++) { accessible = table.GetColumnHeader (i); if (accessible != null) elements [i] = Element.GetElement (accessible); } return elements; }
internal static Element GetElement (Accessible accessible, bool create) { if (accessible == null) return null; // We expose the children of Applications as top-level, // to be more like UIA if (accessible.Role == Role.Application) return null; if (elements.ContainsKey (accessible)) return elements [accessible]; if (!create) return null; Element element; if (IsTable (accessible)) element = new TableElement (accessible); else if (IsTableHeaderItem (accessible)) element = new TableHeaderItemElement (accessible); else if (IsTreeItem (accessible)) element = new TreeItemElement (accessible); else element = new Element (accessible); return element; }
public Element (Accessible accessible) { extraChildren = new List<Element> (); if (!elements.ContainsKey (accessible)) elements [accessible] = this; patterns = new List<ISourceEventHandler> (); this.accessible = accessible; runtimeId = -1; if (accessible.Role == Role.Dialog && accessible.Parent.Role == Role.Application && accessible.QueryComponent () != null) { // Try to figure out if the dialog is painted // on top of another window BoundingBox curExtents = accessible.QueryComponent ().GetExtents (CoordType.Screen); int count = accessible.Parent.Children.Count; for (int i = 0; i < count; i++) { Accessible child = accessible.Parent.Children [i]; if (child == null || child.Role != Role.Frame) continue; Component childComponent = child.QueryComponent (); if (childComponent == null) continue; BoundingBox windowExtents = childComponent.GetExtents (CoordType.Screen); if (windowExtents.X <= curExtents.X && windowExtents.Y <= curExtents.Y && (windowExtents.X + windowExtents.Width) > curExtents.X && (windowExtents.Y + windowExtents.Height) > curExtents.Y) { parent = GetElement (child); parent.extraChildren.Add (this); break; } } } if (parent == null) parent = GetElement (accessible.Parent); AddEvents (true); }
public TextSource (Element element) { accessible = element.Accessible; text = accessible.QueryText (); }
public SelectionItemSource (Element element) { accessible = element.Accessible; }
public ToggleSource (Element element) { accessible = element.Accessible; action = accessible.QueryAction (); }
public TableItemSource (Element element) : base (element) { }
public ValueSource (Element element) { accessible = element.Accessible; text = accessible.QueryText (); editableText = accessible.QueryEditableText (); }
public RangeValueSource (Element element) { accessible = element.Accessible; }
public GridItemSource (Element element) { accessible = element.Accessible; table = accessible.Parent.QueryTable (); }