C# Class SIL.FieldWorks.Common.RootSites.IbusRootSiteEventHandler

Inheritance: IIbusEventHandler
ファイルを表示 Open project: sillsdev/FieldWorks Class Usage Examples

Private Properties

Property Type Description
CheckAttributesForCommittingKeyboard void
CreateTsStringUsingSelectionProps ITsString
GetSelectionProps ITsTextProps[]
OnCommitText void
OnPreeditClosed void
OnPreeditOpened void
OnUpdatePreeditText void
Reset bool
SetupForTypingEventHandler SelectionHelper
TrimBeginningBackspaces int
UpdateSelectionForReplacingPreeditText void

Public Methods

Method Description
CommitOrReset ( ) : bool

Commits the or reset.

IbusRootSiteEventHandler ( SimpleRootSite simpleRootSite ) : System

Initializes a new instance of the SIL.FieldWorks.Common.RootSites.IbusRootSiteEventHandler class.

OnCommitText ( object ibusText ) : void

This method gets called when the IBus CommitText event is raised and indicates that the composition is ending. The temporarily inserted composition string will be replaced with ibusText. It's in the discretion of the IBus 'keyboard' to decide when it calls OnCommitText. Typically this is done when the user selects a string in the pop-up composition window, or when he types a character that isn't part of the previous composition sequence.

OnDeleteSurroundingText ( int offset, int nChars ) : void

Called when the IBus DeleteSurroundingText is raised to delete surrounding characters.

OnHidePreeditText ( ) : void

Called when the IBus HidePreeditText event is raised to cancel/remove the composition, e.g. after the user pressed the ESC key or the application lost focus.

OnIbusKeyPress ( int keySym, int scanCode, int index ) : void

Called when the IBus ForwardKeyEvent is raised, i.e. when IBus wants the application to process a key event. One example is when IBus raises the ForwardKeyEvent and passes backspace to delete the character to the left of the cursor so that it can be replaced with a new modified character.

Reset ( ) : bool

Called by the IBusKeyboardAdapter to cancel any open compositions, e.g. after the user pressed the ESC key or if the application loses focus.

Private Methods

Method Description
CheckAttributesForCommittingKeyboard ( IBusText text ) : void
CreateTsStringUsingSelectionProps ( string text, ITsTextProps selectionProps, bool underLine ) : ITsString

Helper method that returns a TsString with properties read from Selection. TODO: typing next to verse numbers shouldn't preserve selection.

GetSelectionProps ( SelectionHelper selectionHelper ) : ITsTextProps[]
OnCommitText ( string text, bool checkIfFocused ) : void
OnPreeditClosed ( ) : void
OnPreeditOpened ( ) : void
OnUpdatePreeditText ( object obj, int cursorPos ) : void
Reset ( bool cancel ) : bool

Reset the selection and optionally cancel any open compositions.

SetupForTypingEventHandler ( bool checkIfFocused, bool rollBackPreviousTask ) : SelectionHelper
TrimBeginningBackspaces ( string &text ) : int

Trim beginning backspaces, if any. Return number trimmed.

UpdateSelectionForReplacingPreeditText ( SelectionHelper selHelper, int countBackspace ) : void

Method Details

CommitOrReset() public method

Commits the or reset.
public CommitOrReset ( ) : bool
return bool

IbusRootSiteEventHandler() public method

Initializes a new instance of the SIL.FieldWorks.Common.RootSites.IbusRootSiteEventHandler class.
public IbusRootSiteEventHandler ( SimpleRootSite simpleRootSite ) : System
simpleRootSite SimpleRootSite
return System

OnCommitText() public method

This method gets called when the IBus CommitText event is raised and indicates that the composition is ending. The temporarily inserted composition string will be replaced with ibusText. It's in the discretion of the IBus 'keyboard' to decide when it calls OnCommitText. Typically this is done when the user selects a string in the pop-up composition window, or when he types a character that isn't part of the previous composition sequence.
public OnCommitText ( object ibusText ) : void
ibusText object
return void

OnDeleteSurroundingText() public method

Called when the IBus DeleteSurroundingText is raised to delete surrounding characters.
public OnDeleteSurroundingText ( int offset, int nChars ) : void
offset int The character offset from the cursor position of the text to be /// deleted. A negative value indicates a position before the cursor.
nChars int The number of characters to be deleted.
return void

OnHidePreeditText() public method

Called when the IBus HidePreeditText event is raised to cancel/remove the composition, e.g. after the user pressed the ESC key or the application lost focus.
public OnHidePreeditText ( ) : void
return void

OnIbusKeyPress() public method

Called when the IBus ForwardKeyEvent is raised, i.e. when IBus wants the application to process a key event. One example is when IBus raises the ForwardKeyEvent and passes backspace to delete the character to the left of the cursor so that it can be replaced with a new modified character.
public OnIbusKeyPress ( int keySym, int scanCode, int index ) : void
keySym int Key symbol.
scanCode int Scan code.
index int Index of the KeyCode vector. This more or less tells the state of /// the modifier keys: 0=unshifted, 1=shifted (the other values I don't know and are irrelevant). ///
return void

Reset() public method

Called by the IBusKeyboardAdapter to cancel any open compositions, e.g. after the user pressed the ESC key or if the application loses focus.
public Reset ( ) : bool
return bool