# Class TCEFOSRIMEHandler

Description
Hierarchy
Fields
Methods
Properties

## Unit

uCEFOSRIMEHandler

## Declaration

`type TCEFOSRIMEHandler = class(TObject)`

## Description

Class used to handle the IME window.

## Hierarchy

- TObject
- TCEFOSRIMEHandler

## Overview

### Fields

Protected | `FHWND: HWND;`
Protected | `FCompositionRange: TCefRange;`
Protected | `FCursorIndex: cardinal;`
Protected | `FIMERect: TCefRect;`
Protected | `FSystemCaret: boolean;`
Protected | `FInputLanguageID: LANGID;`
Protected | `FCompositionBounds: TCefRectDynArray;`
Protected | `FIsComposing: boolean;`
Protected | `FIMM32DLL: THandle;`

### Methods

Protected | `function GetPrimaryLangID: word;`
Protected | `function GetSubLangID: word;`
Protected | `function GetInitialized: boolean;`
Protected | `procedure GetCompositionInfo(imc : HIMC; aParam : LPARAM; var composition_text : ustring; var underlines : TCefCompositionUnderlineDynArray; var composition_start : integer);`
Protected | `function GetString(imc : HIMC; aParam : WParam; aType : integer; var aResult : ustring) : boolean;`
Protected | `function IsSelectionAttribute(aAttribute : AnsiChar) : boolean;`
Protected | `procedure GetCompositionSelectionRange(imc : HIMC; var target_start, target_end : cardinal);`
Protected | `procedure GetCompositionUnderlines(imc : HIMC; target_start, target_end : cardinal; var underlines : TCefCompositionUnderlineDynArray);`
Public | `constructor Create(aHWND : HWND);`
Public | `destructor Destroy; override;`
Public | `procedure SetInputLanguage;`
Public | `procedure CreateImeWindow;`
Public | `procedure DestroyImeWindow;`
Public | `procedure CleanupComposition;`
Public | `procedure ResetComposition;`
Public | `function GetResult(aParam : LPARAM; var aResult : ustring) : boolean;`
Public | `function GetComposition(aParam : LPARAM; var composition_text : ustring; var underlines : TCefCompositionUnderlineDynArray; var composition_start : integer) : boolean;`
Public | `procedure EnableIME;`
Public | `procedure DisableIME;`
Public | `procedure CancelIME;`
Public | `procedure UpdateCaretPosition(index : cardinal);`
Public | `procedure ChangeCompositionRange(const selection_range : TCefRange; const character_bounds : TCefRectDynArray);`
Public | `procedure MoveImeWindow;`

### Properties

Public | `property IsComposing : boolean read FIsComposing;`
Public | `property InputLanguageID : LANGID read FInputLanguageID;`
Public | `property PrimaryLangID : word read GetPrimaryLangID;`
Public | `property SubLangID : word read GetSubLangID;`
Public | `property Initialized : boolean read GetInitialized;`

## Description

### Fields

Protected | `FHWND: HWND;`
This item has no description.

Protected | `FCompositionRange: TCefRange;`
This item has no description.

Protected | `FCursorIndex: cardinal;`
This item has no description.

Protected | `FIMERect: TCefRect;`
This item has no description.

Protected | `FSystemCaret: boolean;`
This item has no description.

Protected | `FInputLanguageID: LANGID;`
This item has no description.

Protected | `FCompositionBounds: TCefRectDynArray;`
This item has no description.

Protected | `FIsComposing: boolean;`
This item has no description.

Protected | `FIMM32DLL: THandle;`
This item has no description.

### Methods

Protected | `function GetPrimaryLangID: word;`
This item has no description.

Protected | `function GetSubLangID: word;`
This item has no description.

Protected | `function GetInitialized: boolean;`
This item has no description.

Protected | `procedure GetCompositionInfo(imc : HIMC; aParam : LPARAM; var composition_text : ustring; var underlines : TCefCompositionUnderlineDynArray; var composition_start : integer);`
This item has no description.

Protected | `function GetString(imc : HIMC; aParam : WParam; aType : integer; var aResult : ustring) : boolean;`
This item has no description.

Protected | `function IsSelectionAttribute(aAttribute : AnsiChar) : boolean;`
This item has no description.

Protected | `procedure GetCompositionSelectionRange(imc : HIMC; var target_start, target_end : cardinal);`
This item has no description.

Protected | `procedure GetCompositionUnderlines(imc : HIMC; target_start, target_end : cardinal; var underlines : TCefCompositionUnderlineDynArray);`
This item has no description.

Public | `constructor Create(aHWND : HWND);`
This item has no description.

Public | `destructor Destroy; override;`
This item has no description.

Public | `procedure SetInputLanguage;`
Sets InputLanguageID using the name of the active input locale identifier obtained from a GetKeyboardLayoutNameW call. <see href="https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getkeyboardlayoutnamew">See the GetKeyboardLayoutNameW article.)

Public | `procedure CreateImeWindow;`
Calls CreateCaret for some languages in order to creates a new shape for the system caret and assigns ownership of the caret to the specified window. <see href="https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createcaret">See the CreateCaret article.)

Public | `procedure DestroyImeWindow;`
Calls DestroyCaret for some languages in order to destroy the caret's current shape, frees the caret from the window, and removes the caret from the screen. <see href="https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroycaret">See the DestroyCaret article.)

Public | `procedure CleanupComposition;`
Cleans up the all resources attached to the given IMM32Manager object, and reset its composition status. <see href="https://learn.microsoft.com/en-us/windows/win32/api/imm/nf-imm-immnotifyime">See the ImmNotifyIME article.)

Public | `procedure ResetComposition;`
Reset the composition status. Cancel the ongoing composition if it exists.

Public | `function GetResult(aParam : LPARAM; var aResult : ustring) : boolean;`
Retrieve a composition result of the ongoing composition if it exists.

Public | `function GetComposition(aParam : LPARAM; var composition_text : ustring; var underlines : TCefCompositionUnderlineDynArray; var composition_start : integer) : boolean;`
Retrieve the current composition status of the ongoing composition. Includes composition text, underline information and selection range in the composition text. IMM32 does not support char selection.

Public | `procedure EnableIME;`
Enable the IME attached to the given window, i.e. allows user-input events to be dispatched to the IME. In Chromium, this function is used when a renderer process moves its input focus to another edit control, or a renrerer process moves the position of the focused edit control.

Public | `procedure DisableIME;`
Disable the IME attached to the given window, i.e. prohibits any user-input events from being dispatched to the IME. In Chromium, this function is used when a renreder process sets its input focus to a password input.

Public | `procedure CancelIME;`
Cancels an ongoing composition of the IME.

Public | `procedure UpdateCaretPosition(index : cardinal);`
Updates the IME caret position of the given window.

Public | `procedure ChangeCompositionRange(const selection_range : TCefRange; const character_bounds : TCefRectDynArray);`
Updates the composition range. |selected_range| is the range of characters that have been selected. |character_bounds| is the bounds of each character in view device coordinates.

Public | `procedure MoveImeWindow;`
Updates the position of the IME windows.

### Properties

Public | `property IsComposing : boolean read FIsComposing;`
Retrieves whether or not there is an ongoing composition.

Public | `property InputLanguageID : LANGID read FInputLanguageID;`
The current input Language ID retrieved from Windows used for processing language-specific operations in IME.

Public | `property PrimaryLangID : word read GetPrimaryLangID;`
Returns the primary language ID based on the InputLanguageID value.

Public | `property SubLangID : word read GetSubLangID;`
Returns the sublanguage ID based on the InputLanguageID value.

Public | `property Initialized : boolean read GetInitialized;`
Resturns True if the library was loaded successfully.

Generated by PasDoc 1.0.4.