Click or drag to resize
ISingleLineWidgetApi Interface
This interface describes the public API of the single line widget.

Namespace: MyScript.Atk.Text.Sltw
Assembly: MyScript.Atk.Text.Sltw (in MyScript.Atk.Text.Sltw.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public interface ISingleLineWidgetApi

The ISingleLineWidgetApi type exposes the following members.

Properties
  NameDescription
Public propertyAutoScrollEnabled
Get and Set whether the widget scrolls automatically.
Public propertyAutoScrollMargin
Amount of content left on the screen after the widget has automatically scrolled to the end of the content.
Public propertyAutoTypesetEnabled
Get and Set whether the widget turns ink into typeset letters automatically.
Public propertyBaselineColor
The color of the baseline.
Public propertyBaselinePosition
The position of the baseline from the top of the writing area.
Public propertyBaselineThickness
The thickness of the baseline.
Public propertyCharacterCandidateListSize
Maximum number of character candidates. Widget must be configured again for this setting to take effect.
Public propertyCursorBottomMargin
Bottom margin of the cursor bar in pixels.
Public propertyCursorColor
Gets or sets the color of the cursor.
Public propertyCursorIndex
Positioning the cursor inside the text selects the word at the position of the cursor. Moving the cursor out of the bounds of the text (i.e. at a negative index or past the length of the text) hides the cursor and clears the selection.
Public propertyCursorTopMargin
Top margin of the cursor bar in pixels.
Public propertyErrorCode
Get an error code describing the last configuration error.
Public propertyErrorString
Get a string describing the last configuration error.
Public propertyInkColor
The color of the ink.
Public propertyInkEffect
The rendering effect applied to the ink.
Public propertyInkWidth
The width of the ink.
Public propertyIsTransientSpaceEnabled
Enable or disable transient space feature. A space mark is shown right after the content in the baseline, as a dashed line. This space mark is called transient space. If the user writes into the transient space area, the space mark disappears and this indicates that no space shall be added between the actual content and what the user is writing. If the user writes beyond the transient space area, a space character shall be added by the widget between the actual content and what the user is writing.
Public propertyIsUserScrolling
Indicates whether the user is currently scrolling the writing area. This method returns true only if the widget is scrolling in response to the user scrolling via the scrollbar. This method returns false if the widget is currently scrolling due to auto-scrolling or in response of any of the scrolling methods.
Public propertyLeftScrollArrowDisabledImageUri
The appearance of the left scroll arrow when disabled. Left scroll arrow is disabled if uri is null.
Public propertyLeftScrollArrowImageUri
The appearance of the left scroll arrow. Left scroll arrow is disabled if uri is null.
Public propertyLeftScrollArrowPressedImageUri
The appearance of the left scroll arrow when pressed. Left scroll arrow is disabled if uri is null.
Public propertyLongPressDelay
The delay after which long press event is triggered.
Public propertyRightScrollArrowDisabledImageUri
The appearance of the right scroll arrow when disabled. Right scroll arrow is disabled if uri is null.
Public propertyRightScrollArrowImageUri
The appearance of the right scroll arrow. Right scroll arrow is disabled if uri is null.
Public propertyRightScrollArrowPressedImageUri
The appearance of the right scroll arrow when pressed. Right scroll arrow is disabled if uri is null.
Public propertyScrollbarBackground
The appearance of the scrollbar background.
Public propertyScrollbarBackgroundColor
The background color of the scrollbar.
Public propertyScrollbarPattern
The appearance of the scrolling tiled pattern of the scrollbar. Scrollbar is disabled if this drawable is null.
Public propertyScrollbarPatternPressed
The appearance of the scrolling tiled pattern of the scrollbar when pressed.
Public propertySpeedQualityCompromise
Speed/quality compromise rating. Widget must be configured again for this setting to take effect.
Public propertyText
the text managed by this widget.
Public propertyTextColor
Color of the text for all the states (normal, selected).
Public propertyTextMargin
The text margin before the text.
Public propertyTextSize
Size of the text and disable automatic font size selection.
Public propertyTextSizes
Range of allowed text sizes used for automatic font size selection.
Public propertyTypeface
The typeface and style in which the text should be displayed.
Public propertyWordCandidateListSize
Maximum number of word candidates. Widget must be configured again for this setting to take effect.
Public propertyWritingAreaBackground
Gets or sets the background of the writing area.
Public propertyWritingAreaBackgroundColor
The background of the writing area to the given color.
Public propertyWritingAreaScrollX
Return the horizontal scrolling offset of the writing area.
Public propertyWritingAreaScrollY
Return the vertical scrolling offset of the writing area.
Top
Methods
  NameDescription
Public methodAddSearchDir
Add given directory to handwriting resources search path. Directory name can point to a folder in the file system, or to a directory in a zip file. Handwriting resources can be loaded directly from the assets folder of an apk file, as shown below.
            widget.addSearchDir("zip://" + getContext().getPackageCodePath() + "!/assets/conf/text");
            
Public methodAddStroke
Add a stroke to the widget.
Public methodAutoScrollDelayWhenNearlyEmpty
Return the delay after which the widget scrolls automatically when the writing area is nearly empty.
Public methodAutoScrollDelayWhenNearlyFull
Return the delay after which the widget scrolls automatically when the writing area is nearly full.
Public methodAutoTypesetDelayWhenNearlyEmpty
Return the delay after which the widget turns ink into characters when the writing area is nearly empty.
Public methodAutoTypesetDelayWhenNearlyFull
Return the delay after which the widget turns ink into characters when the writing area is nearly full.
Public methodCenterTo
Center the writing area around the given character index. The widget scrolls the writing area so that the given character index is located at the center of the screen, if possible. The scroll operation is canceled and this method does nothing if the user is currently scrolling the writing area.
Public methodCharacterCandidates
Return alternate candidate info for the character at specified index. This method computes the character range of the character at specified index, and provides alternate candidates. Alternate candidates can be selected by calling the ReplaceCharacters(Int32, Int32, String) method with parameters from the candidate information object.
Public methodClear
Clear ink and text contained in the widget.
Public methodClearSearchPath
Clear handwriting resources search path.
Public methodClearSelection
Clear the current text selection.
Public methodConfigure
Configure handwriting recognition engine. This method is non-blocking and returns immediately. Configuration is a lengthy process that may take up to several seconds, depending on the handwriting resources to be configured. It is recommended to setup a configuration listener to detect the end of the configuration process. When the device is rotated, Android completely recreates the UI without restarting the process of the application. After the device has been rotated, you need to configure the new instance of ISingleLineWidgetApi by calling this method again.
Public methodDisableGesture
Disable detection of the specified gesture. Several gestures may be enabled at once by combining several gesture flags using an OR operation.
Public methodEnableGesture
Enable detection of the specified gesture. Several gestures may be enabled at once by combining several gesture flags using an OR operation.
Public methodGetUserLexicon
User lexicon (array of words).
Public methodIsGestureEnabled
Return whether specified gesture is enabled.
Public methodMoveCursorToVisibleIndex
Moves the index of the cursor to visible.
Public methodPenAbort
Simulate a pen abort event.
Public methodPenDown
Simulate a pen down event. This simulates a user that starts writing.
Public methodPenMove
Simulate a pen move event. This simulates a user writing.
Public methodPenUp
Simulate a pen up event. This simulates a user that ends writing.
Public methodReplaceCharacters
Replace characters in the text. This method can be used to select an alternate handwriting recognition candidate for any word or character. The specified character range shall span a word or a single character, and the provided replacement text shall be one of the possible candidates to trigger a word or character candidate change. Characters may be inserted at any location in the text by calling this method with the same start and end character indices and a non-empty replacement string. Characters may be deleted from the text by calling this method with a non-empty characters range and an empty or null replacement string.
Public methodScrollTo
Scroll the writing area to the given character index. The widget defines margins on each side of the screen that are used to clamp the position of the cursor handle while scrolling. When the handle hits the left margin and the writing area can scroll left, the handle remains at the boundary of the left margin and the widget starts to scroll left. Same thing for the right margin. The widget scrolls the writing area so that the given character index is positioned on the boundary of the left scroll margin, for left-to-right languages. For right-to-left languages, the given character index is positioned on the boundary of the right scroll margin. The widget does not scroll if it is already scrolled all the way to the left or to the right and the requested character index is visible. Also, the widget does not scroll if the requested character index is already visible and is not inside the left or right scroll margins. The scroll operation is canceled and this method does nothing if the user is currently scrolling the writing area.
Public methodScrollToCursor
Scroll the writing area, if needed, so that the cursor is visible. The scroll operation is canceled and this method does nothing if the user is currently scrolling the writing area.
Public methodSelectCharacter
Select the character at given index. Selecting a portion of text clears the current selection and paints the character at given index using the selection color.Only typeset characters can be selected, this method has no effect on ink. Selected characters are shown in selection color once they become typeset.
Public methodSelectionIndex
Return the current selection index.
Public methodSelectWord
Select the word at given index. Selecting a portion of text clears the current selection and paints the word at given index using the selection color.Only typeset characters can be selected, this method has no effect on ink. Selected words are shown in selection color once they become typeset.
Public methodSetAutoScrollDelay
Set the delay after which the writing area scrolls automatically once the user has finished writing.
Public methodSetAutoScrollDelays
Set parameters of the auto-scroll delay. The writing area scrolls automatically after a delay once the user has finished writing. This delay is computed from the nearly full / nearly empty delay values provided to this method. After each stroke, the widget computes the amount of visible space left on the screen and available for writing. If the visible portion of the writing area is nearly full, the widget will compute a scroll delay that is close to the delayWhenNearlyFull value. If the visible portion of the writing area is nearly empty, the widget will compute a scroll delay that is close to the delayWhenNearlyEmpty value. In-between delay values are computed if the visible portion of the writing area is half full. Typically, leaving delays as their default values, the widget scrolls the writing area automatically after a long delay if there is a lot of space available for writing. The widget scrolls the writing area automatically after a short delay if there is little space available for writing.
Public methodSetAutoTypesetDelay
Set delay after which the widget turns ink into typeset letters automatically.
Public methodSetAutoTypesetDelays
Set parameters of the auto-typeset delay. The widget turns ink into characters (typesets) automatically after a delay once the user has finished writing. This delay is computed from the nearly full / nearly empty delay values provided to this method. After each stroke, the widget computes the amount of visible space left on the screen and available for writing. If the visible portion of the writing area is nearly full, the widget will compute a typeset delay that is close to the delayWhenNearlyFull value. If the visible portion of the writing area is nearly empty, the widget will compute a typeset delay that is close to the delayWhenNearlyEmpty value. In-between delay values are computed if the visible portion of the writing area is half full. Typically, leaving delays as their default values, the widget triggers a typeset of the ink after a short delay if there is a lot of space available for writing. The widget triggers a typeset of the ink after a long delay if there is little space available for writing.
Public methodSetCursorMargins
Set cursor bar margins.
Public methodSetOnConfiguredListener
Register a callback to invoke when configuration ends.
Public methodSetOnEraseGestureListener
Register a callback to invoke when an erase gesture is detected.
Public methodSetOnInsertGestureListener
Register a callback to invoke when an insert gesture is detected.
Public methodSetOnJoinGestureListener
Register a callback to invoke when a join gesture is detected.
Public methodSetOnLongPressGestureListener
Register a callback to invoke when a long press gesture is detected.
Public methodSetOnPenAbortListener
Register a callback to invoke when user aborts writing.
Public methodSetOnPenDownListener
Register a callback to invoke when user starts writing.
Public methodSetOnPenMoveListener
Register a callback to invoke when user is writing.
Public methodSetOnPenUpListener
Register a callback to invoke when user ends writing.
Public methodSetOnReturnGestureListener
Register a callback to invoke when a return gesture is detected.
Public methodSetOnScrollbarTouchDown
Register a callback to invoke when user starts scrolling using the scrollbar.
Public methodSetOnScrollbarTouchUp
Register a callback to invoke when user finishes scrolling using the scrollbar.
Public methodSetOnSelectGestureListener
Register a callback to invoke when a select gesture is detected.
Public methodSetOnSingleTapGestureListener
Register a callback to invoke when a single tap gesture is detected.
Public methodSetOnTextChangedListener
Register a callback to invoke when the text changes.
Public methodSetOnUnderlineGestureListener
Register a callback to invoke when an underline gesture is detected.
Public methodSetOnUserScrollListener
Register a callback to invoke when user is scrolling using the scrollbar.
Public methodSetUserLexicon
User lexicon (array of words). Widget must be configured again for this setting to take effect. Sets the user lexicon.
Public methodSmoothCenterTo
Center smoothly the writing area around the given character index. The widget scrolls the writing area so that the given character index is located at the center of the screen, if possible. The scroll operation is canceled and this method does nothing if the user is currently scrolling the writing area.
Public methodSmoothScrollTo
Scroll smoothly the writing area to the given character index. The widget defines margins on each side of the screen that are used to clamp the position of the cursor handle while scrolling. When the handle hits the left margin and the writing area can scroll left, the handle remains at the boundary of the left margin and the widget starts to scroll left. Same thing for the right margin. The widget scrolls the writing area so that the given character index is positioned on the boundary of the left scroll margin, for left-to-right languages. For right-to-left languages, the given character index is positioned on the boundary of the right scroll margin. The widget does not scroll if it is already scrolled all the way to the left or to the right and the requested character index is visible. Also, the widget does not scroll if the requested character index is already visible and is not inside the left or right scroll margins. The scroll operation is canceled and this method does nothing if the user is currently scrolling the writing area.
Public methodSmoothScrollToCursor
Scroll smoothly the writing area, if needed, so that the cursor is visible. The scroll operation is canceled and this method does nothing if the user is currently scrolling the writing area.
Public methodWordCandidates
Return alternate candidate info for the word at specified index. This method computes the character range of the word at specified index, and provides alternate candidates and possible completions. Alternate candidates can be selected by calling the ReplaceCharacters(Int32, Int32, String) method with parameters from the candidate information object.
Top
See Also