import { EventDispatcher } from '../events/EventDispatcher'; /** * Dispatched when a user has completed an * input method editor (IME) composition * and the reading string is available. * @eventType flash.events.IMEEvent.IME_COMPOSITION * [Event(name="imeComposition", type="flash.events.IMEEvent")] * The IME class lets you directly manipulate the operating system's input method * editor (IME) in the Flash runtime application that is running on a client computer. You can * determine whether an IME is installed, whether or not the IME is currently enabled, and which IME is * enabled. You can disable or enable the IME in the application, and you can perform other limited * functions, depending on the operating system. * *
AIR profile support: This feature is supported
* on desktop operating systems, but it is not supported on all mobile devices. It is also not supported on
* AIR for TV devices. You can test for support at run time using the
*
IMEs let users type non-ASCII text characters in multibyte languages * such as Chinese, Japanese, and Korean. For more information on working with IMEs, see the * documentation for the operating system for which you are developing applications. * For additional resources, see the following websites: *
* If an IME is not active on the user's computer, calls to IME methods or properties,
* other than
The following table shows the platform coverage of this class:
*~~ Not all Windows IMEs support all of these operations. * The only IME * that supports them all is the Japanese IME.
~~~~ * On the Macintosh, only the Japanese IME supports these methods, and third-party IMEs do not support them.
*The ActionScript 3.0 version of this class does not support Macintosh Classic.
*/ export class IME extends EventDispatcher { constructor () { super(); } /** * The conversion mode of the current IME. * Possible values are IME mode string constants that indicate the conversion mode: * ALPHANUMERIC_FULLALPHANUMERIC_HALFCHINESEJAPANESE_HIRAGANAJAPANESE_KATAKANA_FULLJAPANESE_ * KATAKANA_HALFKOREANUNKNOWN (read-only value; this value cannot be set) * @throws Error A set attempt was not successful. */ public static get conversionMode (): string { console.log('conversionMode not implemented yet in flash/IME'); return ''; } public static set conversionMode (mode: string) { console.log('conversionMode not implemented yet in flash/IME'); } /** * Indicates whether the system IME is enabled (true) or disabled (false). * An enabled IME performs multibyte input; a disabled IME performs alphanumeric input. * @throws Error A set attempt was not successful. */ public static get enabled (): boolean { console.log('enabled not implemented yet in flash/IME'); return false; } public static set enabled (enabled: boolean) { console.log('enabled not implemented yet in flash/IME'); } /** * The isSupported property is set to true if the IME class is * available on the current platform, otherwise it is set to false. */ public static get isSupported (): boolean { console.log('isSupported not implemented yet in flash/IME'); return false; } /** * Causes the runtime to abandon any composition that is in progress. Call this method when the user clicks * outside of the composition area or when the interactive object that has focus is being destroyed or reset. * The runtime confirms the composition by calling confirmComposition() in the client. The * runtime also resets the IME to inform the operating system that the composition has been abandoned. */ public static compositionAbandoned () { console.log('compositionAbandoned not implemented yet in flash/IME'); } /** * Call this method when the selection within the composition has been updated, either interactively or * programmatically. * @param start Specifies the offset in bytes of the start of the selection. * @param end Specifies the offset in bytes of the end of the selection. */ public static compositionSelectionChanged (start: number, end: number) { console.log('compositionSelectionChanged not implemented yet in flash/IME'); } /** * Instructs the IME to select the first candidate for the current composition string. * @throws Error The call was not successful. */ public static doConversion () { console.log('doConversion not implemented yet in flash/IME'); } /** * Sets the IME composition string. When this string is set, the user * can select IME candidates before committing the result to the text * field that currently has focus. * If no text field has focus, this method fails and throws an error. * @param composition The string to send to the IME. * @throws Error The call is not successful. */ public static setCompositionString (composition: string) { console.log('setCompositionString not implemented yet in flash/IME'); } }