////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package flash.text.ime
{
import flash.geom.Rectangle;
//
// IIMEClient
//
/**
* Dispatched when the user begins to use an IME (input method editor).
* @eventType flash.events.IMEEvent.IME_START_COMPOSITION
* @playerversion Flash 10
* @playerversion AIR 1.5
* @langversion 3.0
*/
[Event(name="imeStartComposition", type="flash.IMEEvent.IME_START_COMPOSITION")]
/**
* Dispatched when the user enters text. For IME (input method editor) clients, the receiver should
* insert the string contained in the event object's text
property at the current insertion point.
* @eventType flash.events.TextEvent.TEXT_INPUT
* @playerversion Flash 10
* @playerversion AIR 1.5
* @langversion 3.0
*/
[Event(name="textInput", type="flash.TextEvent.TEXT_INPUT")]
/**
* Interface for IME (input method editor) clients. Components based on the flash.text.engine package must implement
* this interface to support editing text inline using an IME. This interface is not used with TextField objects.
* TextLayoutFramework (TLF) uses this interface to support inline IME, so clients using TLF do not need to implement this
* interface.
*
To support inline IME, set the imeClient
property of an ImeEvent.IME_START_COMPOSITION
event to
* an object which implements this interface.
null
if either or both of the indexes are invalid.
* The same value should be returned independant of whether startIndex
is greater or less than endIndex
.
*/
function getTextBounds(startIndex:int, endIndex:int):Rectangle;
/**
* The zero-based character index value of the start of the current edit session text (i.e.
* all text in the inline session that is still not yet confirmed to the document).
*
* @return the index of the first character of the composition, or -1
if there is no active composition.
*
* @playerversion Flash 10.1
* @langversion 3.0
*/
function get compositionStartIndex():int;
/**
* The zero-based character index value of the end of the current edit session text (i.e.
* all text in the inline session that is still not yet confirmed to the document).
*
* @return the index of the last character of the composition, or -1
if there is no active composition.
*
* @playerversion Flash 10.1
* @langversion 3.0
*/
function get compositionEndIndex():int;
/**
* Indicates whether the text in the component is vertical or not. This will affect the positioning
* of the candidate window (beside vertical text, below horizontal text).
*
* @return true
if the text is vertical, otherwise false.
*
* @playerversion Flash 10.1
* @langversion 3.0
*/
function get verticalTextLayout():Boolean;
/**
* The zero-based character index value of the first character in the current selection.
*
* @return the index of the character at the anchor end of the selection, or -1
if no text is selected.
*
* @playerversion Flash 10.1
* @langversion 3.0
*/
function get selectionAnchorIndex():int;
/**
* The zero-based character index value of the last character in the current selection.
*
* @return the index of the character at the active end of the selection, or -1
if no text is selected.
*
* @playerversion Flash 10.1
* @langversion 3.0
*/
function get selectionActiveIndex():int;
/**
* Sets the range of selected text in the component.
* If either of the arguments is out of bounds the selection should not be changed.
*
* @param anchorIndex The zero-based index value of the character at the anchor end of the selection
* @param activeIndex The zero-based index value of the character at the active end of the selection.
*
* @playerversion Flash 10.1
* @langversion 3.0
*/
function selectRange(anchorIndex:int, activeIndex:int):void;
/**
* Gets the specified range of text from the component. This method is called during IME reconversion.
*
* @param startIndex an integer that specifies the starting location of the range of text to be retrieved.
* @param endIndex an integer that specifies the ending location of the range of text to be retrieved.
*
* @return The requested text, or null
if no text is available in the requested range
* or if either or both of the indexes are invalid. The same value should be returned
* independant of whether startIndex
is greater or less than endIndex
.
*
* @playerversion Flash 10.1
* @langversion 3.0
*/
function getTextInRange(startIndex:int, endIndex:int):String;
} // end of class
} // end of package