2 * Copyright(c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.ComponentModel;
20 using Tizen.NUI.BaseComponents;
22 namespace Tizen.NUI.Accessibility
25 /// Interface representing objects which can store immutable texts.
27 [EditorBrowsable(EditorBrowsableState.Never)]
28 public interface IAtspiText
31 /// Gets stored text in given range.
33 /// <param name="startOffset"> The index of first character </param>
34 /// <param name="endOffset"> The index of first character after the last one expected </param>
35 /// <returns> The substring of stored text </returns>
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 string AccessibilityGetText(int startOffset, int endOffset);
40 /// Gets number of all stored characters.
42 /// <returns> The number of characters </returns>
43 [EditorBrowsable(EditorBrowsableState.Never)]
44 int AccessibilityGetCharacterCount();
47 /// Gets the cursor offset.
49 /// <returns> Value of cursor offset </returns>
50 [EditorBrowsable(EditorBrowsableState.Never)]
51 int AccessibilityGetCursorOffset();
54 /// Sets the cursor offset.
56 /// <param name="offset"> Cursor offset </param>
57 /// <returns> True if successful </returns>
58 [EditorBrowsable(EditorBrowsableState.Never)]
59 bool AccessibilitySetCursorOffset(int offset);
62 /// Gets substring of stored text truncated in concrete gradation.
64 /// <param name="offset"> The position in stored text </param>
65 /// <param name="boundary"> The enumeration describing text gradation </param>
66 /// <returns> Range structure containing acquired text and offsets in original string </returns>
67 [EditorBrowsable(EditorBrowsableState.Never)]
68 AccessibilityRange AccessibilityGetTextAtOffset(int offset, AccessibilityTextBoundary boundary);
71 /// Gets selected text.
74 /// Currently only one selection (i.e. with index = 0) is supported
76 /// <param name="selectionNumber"> The selection index </param>
77 /// <returns> Range structure containing acquired text and offsets in original string </returns>
78 [EditorBrowsable(EditorBrowsableState.Never)]
79 AccessibilityRange AccessibilityGetSelection(int selectionNumber);
82 /// Removes the whole selection.
85 /// Currently only one selection (i.e. with index = 0) is supported
87 /// <param name="selectionNumber"> The selection index </param>
88 /// <returns> True on success, false otherwise </returns>
89 [EditorBrowsable(EditorBrowsableState.Never)]
90 bool AccessibilityRemoveSelection(int selectionNumber);
93 /// Sets selected text.
96 /// Currently only one selection (i.e. with index = 0) is supported
98 /// <param name="selectionNumber"> The selection index </param>
99 /// <param name="startOffset"> The index of first character </param>
100 /// <param name="endOffset"> The index of first character after the last one expected </param>
101 /// <returns> True on success, false otherwise </returns>
102 [EditorBrowsable(EditorBrowsableState.Never)]
103 bool AccessibilitySetSelection(int selectionNumber, int startOffset, int endOffset);
106 /// Gets the bounding box for text within a range in text.
108 /// <param name="startOffset"> The index of first character </param>
109 /// <param name="endOffset"> The index of first character after the last one expected </param>
110 /// <param name="coordType"> The enumeration with type of coordinate system </param>
111 /// <returns> Rectangle giving the position and size of the specified range of text </returns>
112 [EditorBrowsable(EditorBrowsableState.Never)]
113 Rectangle AccessibilityGetRangeExtents(int startOffset, int endOffset, AccessibilityCoordinateType coordType);