//////////////////////////////////////////////////////////////////////////////// // // 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 flashx.textLayout.edit { import flashx.textLayout.elements.TextFlow; import flashx.textLayout.elements.TextRange; import flashx.textLayout.formats.ITextLayoutFormat; import flashx.textLayout.formats.TextLayoutFormat; import flashx.textLayout.tlf_internal; use namespace tlf_internal; import flashx.textLayout.tlf_internal; use namespace tlf_internal; /** * The SelectionState class represents a selection in a text flow. * *
A selection range has an anchor point, representing the point at which the selection of text began, and an * active point, representing the point to which the selection is extended. The active point can be before or after * the anchor point in the text. If a selection is modified (for example, by a user shift-clicking with the mouse), * the active point changes while the anchor point always remains in the same position.
* * @see flashx.textLayout.edit.ISelectionManager#getSelectionState() * @see flashx.textLayout.elements.TextFlow * @see flashx.textLayout.elements.TextRange * * @playerversion Flash 10 * @playerversion AIR 1.5 * @langversion 3.0 */ public class SelectionState extends TextRange { /** Format that are associated with the caret position & will be applied to inserted text */ private var _pointFormat:ITextLayoutFormat; private var _selectionManagerOperationState:Boolean; /** * Creates a SelectionState object. * *Note: Do not construct a SelectionState object in order to create a selection. To
* create a selection in a text flow, call the setSelection()
method of the relevant
* ISelectionManager instance (which is the SelectionManager or EditManager object assigned
* to the interactionManager
property of the text flow).
The pointFormat
styles are cleared if the selection is changed.
Note: The pointFormat
object does not include inherited styles. To
* get all the applicable style definitions, use the getCommonCharacterFormat()
* method of the ISelectionManager class.