From 38beee444b504dd4ec3ef36d45ed7a5e87a45273 Mon Sep 17 00:00:00 2001 From: Bartlomiej Grzelewski Date: Tue, 27 Apr 2021 16:52:11 +0200 Subject: [PATCH] [NUI][AT-SPI] Add Value interface to Pagination --- .../Controls/Pagination.cs | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/Tizen.NUI.Components/Controls/Pagination.cs b/src/Tizen.NUI.Components/Controls/Pagination.cs index 813b4205d..f458c3024 100755 --- a/src/Tizen.NUI.Components/Controls/Pagination.cs +++ b/src/Tizen.NUI.Components/Controls/Pagination.cs @@ -366,6 +366,10 @@ namespace Tizen.NUI.Components selectedIndex = refinedValue; SelectIn(indicatorList[selectedIndex]); + + if (IsHighlighted) { + EmitAccessibilityEvent(ObjectPropertyChangeEvent.Value); + } } } @@ -384,11 +388,67 @@ namespace Tizen.NUI.Components return new Position(indicatorList[index].Position.X + container.PositionX, indicatorList[index].Position.Y + container.PositionY); } + /// + /// Minimum value. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected override double AccessibilityGetMinimum() + { + return 0.0; + } + + /// + /// Current value. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected override double AccessibilityGetCurrent() + { + return (double)SelectedIndex; + } + + /// + /// Maximum value. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected override double AccessibilityGetMaximum() + { + return (double)IndicatorCount; + } + + /// + /// Current value. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected override bool AccessibilitySetCurrent(double value) + { + int f = (int)value; + + if (f >= 0 && f <= IndicatorCount) + { + SelectedIndex = f; + return true; + } + + return false; + } + + /// + /// Minimum increment. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + protected override double AccessibilityGetMinimumIncrement() + { + return 1.0; + } + /// [EditorBrowsable(EditorBrowsableState.Never)] public override void OnInitialize() { base.OnInitialize(); + SetAccessibilityConstructor(Role.ScrollBar, AccessibilityInterface.Value); + AccessibilityHighlightable = true; + AppendAccessibilityAttribute("style", "pagecontrolbyvalue"); container = new VisualView() { -- 2.34.1