public ComponentImplementorHelper (Adapter resource) { this.resource = resource; lastFocusHandlerId = 0; focusHandlers = new Dictionary<uint, Atk.FocusHandler> (); }
public EditableTextImplementorHelper (Adapter adapter, Atk.ITextImplementor textImplementor, ITextImplementor textExpert) { this.adapter = adapter; valueProvider = adapter.Provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id) as IValueProvider; this.textExpert = textExpert; if (valueProvider != null) editable = !valueProvider.IsReadOnly; insertDeleteProvider = adapter.Provider.GetPatternProvider (InsertDeleteTextPatternIdentifiers.Pattern.Id) as IInsertDeleteTextProvider; oldText = textExpert.Text; ClipboardProvider = adapter.Provider.GetPatternProvider (ClipboardPatternIdentifiers.Pattern.Id) as IClipboardProvider; // We are keeping a private caret reference to validate the change // of value caretProvider = adapter.Provider.GetPatternProvider (CaretPatternIdentifiers.Pattern.Id) as ICaretProvider; caretOffset = (caretProvider != null ? caretProvider.CaretOffset : textExpert.Length); RefreshEditable (); }
public ImageImplementorHelper (Adapter adapter) { this.adapter = adapter; embeddedImageProvider = adapter.Provider.GetPatternProvider ( EmbeddedImagePatternIdentifiers.Pattern.Id) as IEmbeddedImageProvider; }
public BaseTextImplementor (Adapter resource) { this.resource = resource; caretProvider = resource.Provider.GetPatternProvider (CaretPatternIdentifiers.Pattern.Id) as ICaretProvider; caretOffset = -1; }
void ICanHaveSelection.RecursivelyDeselectAll (Adapter keepSelected) { if (Parent is ICanHaveSelection) { ((ICanHaveSelection) Parent).RecursivelyDeselectAll ( keepSelected); return; } ((ICanHaveSelection) this).RecursivelyDeselect (keepSelected); }
internal void HandleItemFocus (Adapter item, bool itemFocused) { bool tableFocused = (bool) Provider.GetPropertyValue (AutomationElementIdentifiers.HasKeyboardFocusProperty.Id); if (hasFocus != tableFocused) { NotifyStateChange (Atk.StateType.Focused, tableFocused); if (tableFocused) Atk.Focus.TrackerNotify (this); } if (itemFocused) EmitSignal ("active-descendant-changed", item.Handle); hasFocus = tableFocused; }
public static ITextImplementor GetImplementor (Adapter adapter, IRawElementProviderSimple prov) { ITextProvider textProvider = prov.GetPatternProvider (TextPatternIdentifiers.Pattern.Id) as ITextProvider; if (textProvider != null) return new TextProviderTextImplementor (adapter, textProvider); IValueProvider valueProvider = prov.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id) as IValueProvider; if (valueProvider != null) return new ValueProviderTextImplementor (adapter, valueProvider); IRangeValueProvider rangeValueProvider = prov.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id) as IRangeValueProvider; if (rangeValueProvider != null) return new RangeValueProviderTextImplementor (adapter, rangeValueProvider); return new NamePropertyTextImplementor (adapter, prov); }
internal void HandleItemFocus (Adapter item, bool itemFocused) { bool listFocused = (bool) Provider.GetPropertyValue (AutomationElementIdentifiers.HasKeyboardFocusProperty.Id); if (hasFocus != listFocused) { NotifyStateChange (Atk.StateType.Focused, listFocused); if (listFocused) Atk.Focus.TrackerNotify (this); } if (itemFocused) { // Orca wants to get Selection events before // active-descendant-changed events; otherwise // it is excessively verbose. if (!CanSelectMultiple) NotifyItemSelected (item); EmitSignal ("active-descendant-changed", item.Handle); } hasFocus = listFocused; }
internal override void RemoveChild (Atk.Object childToRemove) { if (childToRemove == selectedItem) selectedItem = null; base.RemoveChild (childToRemove); for (int i = 0; i < NAccessibleChildren; i++) { TreeItem currentChild = RefAccessibleChild (i) as TreeItem; if (currentChild != null) currentChild.NotifySomeChildRemoved (childToRemove); } }
public TextProviderTextImplementor (Adapter resource, ITextProvider textProvider) : base (resource) { this.textProvider = textProvider; }
public ValueProviderTextImplementor (Adapter resource, IValueProvider valueProvider) : base (resource) { this.valueProvider = valueProvider; }
private int GetRowForAdapter (Adapter target) { IRawElementProviderFragment child = provider.Navigate (NavigateDirection.FirstChild); int count = 0; return GetRowForProvider (child, (IRawElementProviderFragment)target.Provider, ref count); }
void ICanHaveSelection.RecursivelyDeselect (Adapter keepSelected) { if (this != keepSelected) Deselect (); lock (syncRoot) { bool changed_selected_child = false; bool any_child_was_selected = (selectedChild >= 0); for (int i = 0; i < NAccessibleChildren; i++) { Atk.Object child = RefAccessibleChild (i); if (child == null) continue; if (((Adapter) child) == keepSelected) { if (selectedChild != i) { selectedChild = i; changed_selected_child = true; } continue; } if (child is ICanHaveSelection) { ((ICanHaveSelection) child) .RecursivelyDeselect (keepSelected); } } if (changed_selected_child) { Atk.ISelectionImplementor selImplementor = this as Atk.ISelectionImplementor; if (selImplementor != null) { if (any_child_was_selected) //2 times: because we deselect a child and select another one EmitSelectionChanged (); EmitSelectionChanged (); } } } }
public NamePropertyTextImplementor (Adapter resource, IRawElementProviderSimple provider) : base (resource) { this.provider = provider; }
internal void NotifyItemSelected (Adapter item) { if (item == selectedItem) return; if (selectedItem != null) selectedItem.NotifyStateChange (Atk.StateType.Selected, false); item.NotifyStateChange (Atk.StateType.Selected, true); selectedItem = item; }
internal void NotifyItemSelectionRemoved (Adapter item) { if (item != selectedItem) return; item.NotifyStateChange (Atk.StateType.Selected, false); selectedItem = null; }
internal void RecursiveDeselect (Adapter keepSelected) { int nChildren = 0; lock (syncRoot) { nChildren = NAccessibleChildren; } for (int i = 0; i < nChildren; i++) { Atk.Object child = RefAccessibleChild (i); if (child == null || ((Adapter)child) == keepSelected) { continue; } ComboBoxItem item = child as ComboBoxItem; if (item != null) item.Deselect (); } if (Parent is ComboBoxOptions) ((ComboBoxOptions)Parent).RecursiveDeselect (keepSelected); else if (Parent is ComboBox) ((ComboBox)Parent).RaiseSelectionChanged (keepSelected.Name); }
public void NotifyRowAdjusted (Adapter adapter, bool expanded) { int row = GetRowForAdapter (adapter); int rowCount = 0; IRawElementProviderFragment childProvider = (IRawElementProviderFragment)adapter.Provider; for (IRawElementProviderFragment child = childProvider.Navigate (NavigateDirection.FirstChild); child != null; child = child.Navigate (NavigateDirection.NextSibling)) if (IsListItem (child)) rowCount++; if (rowCount > 0) { EmitSignal ((expanded? "row-inserted": "row-deleted"), row + 1, rowCount); EmitVisibleDataChanged (); } }
void ICanHaveSelection.RecursivelyDeselectAll (Adapter keepSelected) { ((ICanHaveSelection) this).RecursivelyDeselect (keepSelected); }
void ICanHaveSelection.RecursivelyDeselect (Adapter keepSelected) { lock (syncRoot) { for (int i = 0; i < NAccessibleChildren; i++) { Atk.Object child = RefAccessibleChild (i); if (child is ICanHaveSelection) { ((ICanHaveSelection) child).RecursivelyDeselect (keepSelected); } } } }
public RangeValueProviderTextImplementor (Adapter resource, IRangeValueProvider rangeValueProvider) : base (resource) { this.rangeValueProvider = rangeValueProvider; }