Inheritance: Atk.Object
Esempio n. 1
0
		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 ();
		}
Esempio n. 3
0
		public ImageImplementorHelper (Adapter adapter)
		{
			this.adapter = adapter;

			embeddedImageProvider = adapter.Provider.GetPatternProvider (
				EmbeddedImagePatternIdentifiers.Pattern.Id)
					as IEmbeddedImageProvider;
		}
Esempio n. 4
0
		public BaseTextImplementor (Adapter resource)
		{
			this.resource = resource;

			caretProvider
				= resource.Provider.GetPatternProvider (CaretPatternIdentifiers.Pattern.Id)
					as ICaretProvider;
			caretOffset = -1;
		}
Esempio n. 5
0
		void ICanHaveSelection.RecursivelyDeselectAll (Adapter keepSelected)
		{
			if (Parent is ICanHaveSelection) {
				((ICanHaveSelection) Parent).RecursivelyDeselectAll (
					keepSelected);
				return;
			}

			((ICanHaveSelection) this).RecursivelyDeselect (keepSelected);
		}
Esempio n. 6
0
		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;
		}
Esempio n. 7
0
		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);
		}
Esempio n. 8
0
File: Tree.cs Progetto: mono/uia2atk
		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;
		}
Esempio n. 9
0
File: Tree.cs Progetto: mono/uia2atk
		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);
			}
		}
Esempio n. 10
0
		public TextProviderTextImplementor (Adapter resource, 
		                                    ITextProvider textProvider)
			: base (resource)
		{
			this.textProvider = textProvider;
		}
Esempio n. 11
0
		public ValueProviderTextImplementor (Adapter resource, IValueProvider valueProvider)
			: base (resource)
		{
			this.valueProvider = valueProvider;
		}
Esempio n. 12
0
File: Tree.cs Progetto: mono/uia2atk
		private int GetRowForAdapter (Adapter target)
		{
			IRawElementProviderFragment child = provider.Navigate (NavigateDirection.FirstChild);
			int count = 0;
			return GetRowForProvider (child, (IRawElementProviderFragment)target.Provider, ref count);
		}
Esempio n. 13
0
File: Menu.cs Progetto: mono/uia2atk
		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 ();
					}
				}
			}
		}
Esempio n. 14
0
		public NamePropertyTextImplementor (Adapter resource, IRawElementProviderSimple provider)
			: base (resource)
		{
			this.provider = provider;
		}
Esempio n. 15
0
File: Tree.cs Progetto: mono/uia2atk
		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;
		}
Esempio n. 16
0
File: Tree.cs Progetto: mono/uia2atk
		internal void NotifyItemSelectionRemoved (Adapter item)
		{
			if (item != selectedItem)
				return;
			item.NotifyStateChange (Atk.StateType.Selected, false);
			selectedItem = null;
		}
Esempio n. 17
0
		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);
		}
Esempio n. 18
0
File: Tree.cs Progetto: mono/uia2atk
		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 ();
			}
		}
Esempio n. 19
0
		void ICanHaveSelection.RecursivelyDeselectAll (Adapter keepSelected)
		{
			((ICanHaveSelection) this).RecursivelyDeselect (keepSelected);
		}
Esempio n. 20
0
		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;
		}