@awayjs/scene 0.13.265 → 0.13.267

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/.eslintrc +100 -100
  2. package/README.md +61 -61
  3. package/bundle/awayjs-scene.umd.js +2 -2
  4. package/bundle/awayjs-scene.umd.js.map +1 -1
  5. package/copyVersionToIndex.js +23 -23
  6. package/dist/index.d.ts +76 -75
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +67 -66
  9. package/dist/lib/Scene.d.ts +84 -84
  10. package/dist/lib/Scene.js +288 -288
  11. package/dist/lib/Settings.d.ts +16 -16
  12. package/dist/lib/Settings.js +60 -60
  13. package/dist/lib/adapters/IDisplayObjectAdapter.d.ts +13 -13
  14. package/dist/lib/adapters/IDisplayObjectAdapter.js +1 -1
  15. package/dist/lib/adapters/IFilter.d.ts +24 -24
  16. package/dist/lib/adapters/IFilter.js +1 -1
  17. package/dist/lib/adapters/IMovieClipAdapter.d.ts +14 -14
  18. package/dist/lib/adapters/IMovieClipAdapter.js +1 -1
  19. package/dist/lib/adapters/ITextfieldAdapter.d.ts +4 -4
  20. package/dist/lib/adapters/ITextfieldAdapter.js +1 -1
  21. package/dist/lib/base/IBitmapDrawable.d.ts +11 -11
  22. package/dist/lib/base/IBitmapDrawable.js +1 -1
  23. package/dist/lib/base/IFrameLabel.d.ts +4 -4
  24. package/dist/lib/base/IFrameLabel.js +1 -1
  25. package/dist/lib/base/IFrameScript.d.ts +5 -5
  26. package/dist/lib/base/IFrameScript.js +1 -1
  27. package/dist/lib/base/MouseButtons.d.ts +26 -22
  28. package/dist/lib/base/MouseButtons.d.ts.map +1 -1
  29. package/dist/lib/base/MouseButtons.js +1 -1
  30. package/dist/lib/base/Timeline.d.ts +148 -148
  31. package/dist/lib/base/Timeline.js +535 -535
  32. package/dist/lib/base/TimelineActionType.d.ts +18 -18
  33. package/dist/lib/base/TimelineActionType.js +1 -1
  34. package/dist/lib/controllers/ControllerBase.d.ts +14 -14
  35. package/dist/lib/controllers/ControllerBase.js +60 -60
  36. package/dist/lib/controllers/FirstPersonController.d.ts +78 -78
  37. package/dist/lib/controllers/FirstPersonController.js +228 -228
  38. package/dist/lib/controllers/FollowController.d.ts +12 -12
  39. package/dist/lib/controllers/FollowController.js +27 -27
  40. package/dist/lib/controllers/HoverController.d.ts +105 -105
  41. package/dist/lib/controllers/HoverController.js +302 -302
  42. package/dist/lib/controllers/LookAtController.d.ts +14 -14
  43. package/dist/lib/controllers/LookAtController.js +68 -68
  44. package/dist/lib/controllers/SpringController.d.ts +38 -38
  45. package/dist/lib/controllers/SpringController.js +59 -59
  46. package/dist/lib/display/Billboard.d.ts +147 -147
  47. package/dist/lib/display/Billboard.js +426 -426
  48. package/dist/lib/display/Camera.d.ts +40 -40
  49. package/dist/lib/display/Camera.js +90 -90
  50. package/dist/lib/display/DisplayObject.d.ts +938 -938
  51. package/dist/lib/display/DisplayObject.js +1641 -1641
  52. package/dist/lib/display/DisplayObjectContainer.d.ts +325 -325
  53. package/dist/lib/display/DisplayObjectContainer.js +480 -480
  54. package/dist/lib/display/LineSegment.d.ts +84 -84
  55. package/dist/lib/display/LineSegment.js +215 -215
  56. package/dist/lib/display/LoaderContainer.d.ts +504 -504
  57. package/dist/lib/display/LoaderContainer.js +603 -603
  58. package/dist/lib/display/MorphSprite.d.ts +20 -20
  59. package/dist/lib/display/MorphSprite.js +254 -254
  60. package/dist/lib/display/MovieClip.d.ts +152 -152
  61. package/dist/lib/display/MovieClip.js +735 -735
  62. package/dist/lib/display/SimpleButton.d.ts +158 -158
  63. package/dist/lib/display/SimpleButton.js +228 -228
  64. package/dist/lib/display/Skybox.d.ts +156 -156
  65. package/dist/lib/display/Skybox.js +309 -309
  66. package/dist/lib/display/Sprite.d.ts +70 -70
  67. package/dist/lib/display/Sprite.js +144 -144
  68. package/dist/lib/display/TextField.d.ts +1109 -1109
  69. package/dist/lib/display/TextField.js +3109 -3109
  70. package/dist/lib/display/TextSprite.d.ts +10 -10
  71. package/dist/lib/display/TextSprite.js +25 -25
  72. package/dist/lib/elements/SkyboxElements.d.ts +29 -29
  73. package/dist/lib/elements/SkyboxElements.js +127 -127
  74. package/dist/lib/errors/CastError.d.ts +4 -4
  75. package/dist/lib/errors/CastError.js +10 -10
  76. package/dist/lib/events/CameraEvent.d.ts +16 -16
  77. package/dist/lib/events/CameraEvent.js +30 -30
  78. package/dist/lib/events/FocusEvent.d.ts +42 -42
  79. package/dist/lib/events/FocusEvent.js +43 -43
  80. package/dist/lib/events/KeyboardEvent.d.ts +21 -21
  81. package/dist/lib/events/KeyboardEvent.js +43 -43
  82. package/dist/lib/events/MouseEvent.d.ts +91 -184
  83. package/dist/lib/events/MouseEvent.d.ts.map +1 -1
  84. package/dist/lib/events/MouseEvent.js +122 -191
  85. package/dist/lib/events/PointerEvent.d.ts +94 -0
  86. package/dist/lib/events/PointerEvent.d.ts.map +1 -0
  87. package/dist/lib/events/PointerEvent.js +73 -0
  88. package/dist/lib/events/ResizeEvent.d.ts +15 -15
  89. package/dist/lib/events/ResizeEvent.js +38 -38
  90. package/dist/lib/events/TextfieldEvent.d.ts +19 -19
  91. package/dist/lib/events/TextfieldEvent.js +28 -28
  92. package/dist/lib/events/TouchEvent.d.ts +55 -0
  93. package/dist/lib/events/TouchEvent.d.ts.map +1 -0
  94. package/dist/lib/events/TouchEvent.js +89 -0
  95. package/dist/lib/factories/DefaultSceneGraphFactory.d.ts +26 -26
  96. package/dist/lib/factories/DefaultSceneGraphFactory.js +54 -54
  97. package/dist/lib/factories/ISceneGraphFactory.d.ts +20 -20
  98. package/dist/lib/factories/ISceneGraphFactory.js +1 -1
  99. package/dist/lib/image/SceneImage2D.d.ts +236 -236
  100. package/dist/lib/image/SceneImage2D.js +687 -687
  101. package/dist/lib/managers/DefaultFontManager.d.ts +14 -14
  102. package/dist/lib/managers/DefaultFontManager.js +101 -101
  103. package/dist/lib/managers/DeviceFontManager.d.ts +8 -8
  104. package/dist/lib/managers/DeviceFontManager.js +44 -44
  105. package/dist/lib/managers/FrameScriptManager.d.ts +36 -36
  106. package/dist/lib/managers/FrameScriptManager.js +377 -377
  107. package/dist/lib/managers/IInputRecorder.d.ts +3 -3
  108. package/dist/lib/managers/IInputRecorder.js +1 -1
  109. package/dist/lib/managers/MouseManager.d.ts +76 -89
  110. package/dist/lib/managers/MouseManager.d.ts.map +1 -1
  111. package/dist/lib/managers/MouseManager.js +812 -761
  112. package/dist/lib/prefabs/PrefabBase.d.ts +19 -19
  113. package/dist/lib/prefabs/PrefabBase.js +42 -42
  114. package/dist/lib/prefabs/PrimitiveCapsulePrefab.d.ts +56 -56
  115. package/dist/lib/prefabs/PrimitiveCapsulePrefab.js +269 -269
  116. package/dist/lib/prefabs/PrimitiveConePrefab.d.ts +21 -21
  117. package/dist/lib/prefabs/PrimitiveConePrefab.js +43 -43
  118. package/dist/lib/prefabs/PrimitiveCubePrefab.d.ts +74 -74
  119. package/dist/lib/prefabs/PrimitiveCubePrefab.js +545 -545
  120. package/dist/lib/prefabs/PrimitiveCylinderPrefab.d.ts +79 -79
  121. package/dist/lib/prefabs/PrimitiveCylinderPrefab.js +584 -584
  122. package/dist/lib/prefabs/PrimitivePlanePrefab.d.ts +65 -65
  123. package/dist/lib/prefabs/PrimitivePlanePrefab.js +300 -300
  124. package/dist/lib/prefabs/PrimitivePolygonPrefab.d.ts +29 -29
  125. package/dist/lib/prefabs/PrimitivePolygonPrefab.js +64 -64
  126. package/dist/lib/prefabs/PrimitivePrefabBase.d.ts +67 -67
  127. package/dist/lib/prefabs/PrimitivePrefabBase.js +158 -158
  128. package/dist/lib/prefabs/PrimitiveSpherePrefab.d.ts +48 -48
  129. package/dist/lib/prefabs/PrimitiveSpherePrefab.js +294 -294
  130. package/dist/lib/prefabs/PrimitiveTorusPrefab.d.ts +55 -55
  131. package/dist/lib/prefabs/PrimitiveTorusPrefab.js +260 -260
  132. package/dist/lib/text/AntiAliasType.d.ts +24 -24
  133. package/dist/lib/text/AntiAliasType.js +28 -28
  134. package/dist/lib/text/BitmapFontChar.d.ts +39 -39
  135. package/dist/lib/text/BitmapFontChar.js +42 -42
  136. package/dist/lib/text/BitmapFontTable.d.ts +80 -80
  137. package/dist/lib/text/BitmapFontTable.js +203 -203
  138. package/dist/lib/text/FNTGenerator.d.ts +10 -10
  139. package/dist/lib/text/FNTGenerator.js +74 -74
  140. package/dist/lib/text/FNTGeneratorCanvas.d.ts +22 -22
  141. package/dist/lib/text/FNTGeneratorCanvas.js +205 -205
  142. package/dist/lib/text/FNTGeneratrorBase.d.ts +7 -7
  143. package/dist/lib/text/FNTGeneratrorBase.js +7 -7
  144. package/dist/lib/text/Font.d.ts +38 -38
  145. package/dist/lib/text/Font.js +109 -109
  146. package/dist/lib/text/FontLookUpMode.d.ts +5 -5
  147. package/dist/lib/text/FontLookUpMode.js +7 -7
  148. package/dist/lib/text/FontStyleName.d.ts +6 -6
  149. package/dist/lib/text/FontStyleName.js +7 -7
  150. package/dist/lib/text/GridFitType.d.ts +31 -31
  151. package/dist/lib/text/GridFitType.js +35 -35
  152. package/dist/lib/text/HTMLTextProcessor.d.ts +8 -8
  153. package/dist/lib/text/HTMLTextProcessor.js +423 -423
  154. package/dist/lib/text/IFontTable.d.ts +16 -16
  155. package/dist/lib/text/IFontTable.js +1 -1
  156. package/dist/lib/text/TesselatedFontChar.d.ts +58 -58
  157. package/dist/lib/text/TesselatedFontChar.js +66 -66
  158. package/dist/lib/text/TesselatedFontTable.d.ts +95 -95
  159. package/dist/lib/text/TesselatedFontTable.js +992 -992
  160. package/dist/lib/text/TextFieldAutoSize.d.ts +28 -28
  161. package/dist/lib/text/TextFieldAutoSize.js +32 -32
  162. package/dist/lib/text/TextFieldType.d.ts +20 -20
  163. package/dist/lib/text/TextFieldType.js +24 -24
  164. package/dist/lib/text/TextFormat.d.ts +273 -273
  165. package/dist/lib/text/TextFormat.js +440 -440
  166. package/dist/lib/text/TextFormatAlign.d.ts +26 -26
  167. package/dist/lib/text/TextFormatAlign.js +30 -30
  168. package/dist/lib/text/TextInteractionMode.d.ts +21 -21
  169. package/dist/lib/text/TextInteractionMode.js +25 -25
  170. package/dist/lib/text/TextLineMetrics.d.ts +61 -61
  171. package/dist/lib/text/TextLineMetrics.js +42 -42
  172. package/dist/lib/text/TextShape.d.ts +20 -20
  173. package/dist/lib/text/TextShape.js +75 -75
  174. package/dist/lib/tools/Merge.d.ts +81 -81
  175. package/dist/lib/tools/Merge.js +266 -266
  176. package/dist/lib/utils/Cast.d.ts +20 -20
  177. package/dist/lib/utils/Cast.js +271 -271
  178. package/index.ts +92 -91
  179. package/lib/Scene.ts +343 -343
  180. package/lib/Settings.ts +83 -83
  181. package/lib/adapters/IDisplayObjectAdapter.ts +23 -23
  182. package/lib/adapters/IFilter.ts +25 -25
  183. package/lib/adapters/IMovieClipAdapter.ts +24 -24
  184. package/lib/adapters/ITextfieldAdapter.ts +6 -6
  185. package/lib/base/IBitmapDrawable.ts +13 -13
  186. package/lib/base/IFrameLabel.ts +3 -3
  187. package/lib/base/IFrameScript.ts +4 -4
  188. package/lib/base/MouseButtons.ts +31 -26
  189. package/lib/base/Timeline.ts +727 -727
  190. package/lib/base/TimelineActionType.ts +18 -18
  191. package/lib/controllers/ControllerBase.ts +66 -66
  192. package/lib/controllers/FirstPersonController.ts +241 -241
  193. package/lib/controllers/FollowController.ts +22 -22
  194. package/lib/controllers/HoverController.ts +304 -304
  195. package/lib/controllers/LookAtController.ts +75 -75
  196. package/lib/controllers/SpringController.ts +91 -91
  197. package/lib/display/Billboard.ts +504 -504
  198. package/lib/display/Camera.ts +89 -89
  199. package/lib/display/DisplayObject.ts +1893 -1893
  200. package/lib/display/DisplayObjectContainer.ts +538 -538
  201. package/lib/display/LineSegment.ts +248 -248
  202. package/lib/display/LoaderContainer.ts +651 -651
  203. package/lib/display/MorphSprite.ts +347 -347
  204. package/lib/display/MovieClip.ts +879 -879
  205. package/lib/display/SimpleButton.ts +224 -224
  206. package/lib/display/Skybox.ts +379 -379
  207. package/lib/display/Sprite.ts +165 -165
  208. package/lib/display/TextField.ts +3958 -3958
  209. package/lib/display/TextSprite.ts +22 -22
  210. package/lib/elements/SkyboxElements.ts +141 -141
  211. package/lib/errors/CastError.ts +6 -6
  212. package/lib/events/CameraEvent.ts +29 -29
  213. package/lib/events/FocusEvent.ts +69 -69
  214. package/lib/events/KeyboardEvent.ts +40 -40
  215. package/lib/events/MouseEvent.ts +147 -287
  216. package/lib/events/PointerEvent.ts +146 -0
  217. package/lib/events/ResizeEvent.ts +31 -31
  218. package/lib/events/TextfieldEvent.ts +28 -28
  219. package/lib/events/TouchEvent.ts +107 -0
  220. package/lib/factories/DefaultSceneGraphFactory.ts +56 -56
  221. package/lib/factories/ISceneGraphFactory.ts +28 -28
  222. package/lib/image/SceneImage2D.ts +1020 -1020
  223. package/lib/managers/DefaultFontManager.ts +124 -124
  224. package/lib/managers/DeviceFontManager.ts +55 -55
  225. package/lib/managers/FrameScriptManager.ts +431 -431
  226. package/lib/managers/IInputRecorder.ts +2 -2
  227. package/lib/managers/MouseManager.ts +948 -884
  228. package/lib/prefabs/PrefabBase.ts +47 -47
  229. package/lib/prefabs/PrimitiveCapsulePrefab.ts +286 -286
  230. package/lib/prefabs/PrimitiveConePrefab.ts +37 -37
  231. package/lib/prefabs/PrimitiveCubePrefab.ts +630 -630
  232. package/lib/prefabs/PrimitiveCylinderPrefab.ts +657 -657
  233. package/lib/prefabs/PrimitivePlanePrefab.ts +352 -352
  234. package/lib/prefabs/PrimitivePolygonPrefab.ts +53 -53
  235. package/lib/prefabs/PrimitivePrefabBase.ts +177 -177
  236. package/lib/prefabs/PrimitiveSpherePrefab.ts +336 -336
  237. package/lib/prefabs/PrimitiveTorusPrefab.ts +282 -282
  238. package/lib/text/AntiAliasType.ts +24 -24
  239. package/lib/text/BitmapFontChar.ts +53 -53
  240. package/lib/text/BitmapFontTable.ts +232 -232
  241. package/lib/text/FNTGenerator.ts +100 -100
  242. package/lib/text/FNTGeneratorCanvas.ts +287 -287
  243. package/lib/text/FNTGeneratrorBase.ts +10 -10
  244. package/lib/text/Font.ts +114 -114
  245. package/lib/text/FontLookUpMode.ts +5 -5
  246. package/lib/text/FontStyleName.ts +6 -6
  247. package/lib/text/GridFitType.ts +32 -32
  248. package/lib/text/HTMLTextProcessor.ts +418 -418
  249. package/lib/text/IFontTable.ts +17 -17
  250. package/lib/text/TesselatedFontChar.ts +80 -80
  251. package/lib/text/TesselatedFontTable.ts +1221 -1221
  252. package/lib/text/TextFieldAutoSize.ts +30 -30
  253. package/lib/text/TextFieldType.ts +21 -21
  254. package/lib/text/TextFormat.ts +601 -601
  255. package/lib/text/TextFormatAlign.ts +28 -28
  256. package/lib/text/TextInteractionMode.ts +21 -21
  257. package/lib/text/TextLineMetrics.ts +74 -74
  258. package/lib/text/TextShape.ts +90 -90
  259. package/lib/tools/Merge.ts +311 -311
  260. package/lib/utils/Cast.ts +304 -304
  261. package/package.json +74 -74
  262. package/rollup.config.js +33 -33
  263. package/scripts/build.sh +2 -2
  264. package/scripts/gendocs.sh +14 -14
  265. package/scripts/genexamples.sh +14 -14
  266. package/scripts/genfull.sh +14 -14
  267. package/system.config.js +51 -51
  268. package/tsconfig.json +18 -18
@@ -1,1110 +1,1110 @@
1
- import { Rectangle, Vector3D } from '@awayjs/core';
2
- import { IPartitionEntity } from '@awayjs/view';
3
- import { Shape } from '@awayjs/graphics';
4
- import { AntiAliasType } from '../text/AntiAliasType';
5
- import { GridFitType } from '../text/GridFitType';
6
- import { TextFieldType } from '../text/TextFieldType';
7
- import { TextFormat } from '../text/TextFormat';
8
- import { TextInteractionMode } from '../text/TextInteractionMode';
9
- import { TextLineMetrics } from '../text/TextLineMetrics';
10
- import { DisplayObject } from './DisplayObject';
11
- import { DisplayObjectContainer } from './DisplayObjectContainer';
12
- import { TextShape } from '../text/TextShape';
13
- import { MouseEvent } from '../events/MouseEvent';
14
- interface IWord {
15
- start: number;
16
- x: number;
17
- y: number;
18
- width: number;
19
- len: number;
20
- }
21
- declare class WordStore {
22
- store: Array<IWord>;
23
- index: number;
24
- constructor(size?: number);
25
- put(start: number, x: number, y: number, width: number, len: number): IWord;
26
- get last(): IWord;
27
- get length(): number;
28
- set length(v: number);
29
- get(index: number): IWord;
30
- free(): void;
31
- dispose(): void;
32
- }
33
- /**
34
- * The TextField class is used to create display objects for text display and
35
- * input. <ph outputclass="flexonly">You can use the TextField class to
36
- * perform low-level text rendering. However, in Flex, you typically use the
37
- * Label, Text, TextArea, and TextInput controls to process text. <ph
38
- * outputclass="flashonly">You can give a text field an instance name in the
39
- * Property inspector and use the methods and properties of the TextField
40
- * class to manipulate it with ActionScript. TextField instance names are
41
- * displayed in the Movie Explorer and in the Insert Target Path dialog box in
42
- * the Actions panel.
43
- *
44
- * <p>To create a text field dynamically, use the <code>TextField()</code>
45
- * constructor.</p>
46
- *
47
- * <p>The methods of the TextField class let you set, select, and manipulate
48
- * text in a dynamic or input text field that you create during authoring or
49
- * at runtime. </p>
50
- *
51
- * <p>ActionScript provides several ways to format your text at runtime. The
52
- * TextFormat class lets you set character and paragraph formatting for
53
- * TextField objects. You can apply Cascading Style Sheets(CSS) styles to
54
- * text fields by using the <code>TextField.styleSheet</code> property and the
55
- * StyleSheet class. You can use CSS to style built-in HTML tags, define new
56
- * formatting tags, or apply styles. You can assign HTML formatted text, which
57
- * optionally uses CSS styles, directly to a text field. HTML text that you
58
- * assign to a text field can contain embedded media(movie clips, SWF files,
59
- * GIF files, PNG files, and JPEG files). The text wraps around the embedded
60
- * media in the same way that a web browser wraps text around media embedded
61
- * in an HTML document. </p>
62
- *
63
- * <p>Flash Player supports a subset of HTML tags that you can use to format
64
- * text. See the list of supported HTML tags in the description of the
65
- * <code>htmlText</code> property.</p>
66
- *
67
- * @event change Dispatched after a control value is
68
- * modified, unlike the
69
- * <code>textInput</code> event, which is
70
- * dispatched before the value is modified.
71
- * Unlike the W3C DOM Event Model version of
72
- * the <code>change</code> event, which
73
- * dispatches the event only after the
74
- * control loses focus, the ActionScript 3.0
75
- * version of the <code>change</code> event
76
- * is dispatched any time the control
77
- * changes. For example, if a user types text
78
- * into a text field, a <code>change</code>
79
- * event is dispatched after every keystroke.
80
- * @event link Dispatched when a user clicks a hyperlink
81
- * in an HTML-enabled text field, where the
82
- * URL begins with "event:". The remainder of
83
- * the URL after "event:" is placed in the
84
- * text property of the LINK event.
85
- *
86
- * <p><b>Note:</b> The default behavior,
87
- * adding the text to the text field, occurs
88
- * only when Flash Player generates the
89
- * event, which in this case happens when a
90
- * user attempts to input text. You cannot
91
- * put text into a text field by sending it
92
- * <code>textInput</code> events.</p>
93
- * @event scroll Dispatched by a TextField object
94
- * <i>after</i> the user scrolls.
95
- * @event textInput Flash Player dispatches the
96
- * <code>textInput</code> event when a user
97
- * enters one or more characters of text.
98
- * Various text input methods can generate
99
- * this event, including standard keyboards,
100
- * input method editors(IMEs), voice or
101
- * speech recognition systems, and even the
102
- * act of pasting plain text with no
103
- * formatting or style information.
104
- * @event textInteractionModeChange Flash Player dispatches the
105
- * <code>textInteractionModeChange</code>
106
- * event when a user changes the interaction
107
- * mode of a text field. for example on
108
- * Android, one can toggle from NORMAL mode
109
- * to SELECTION mode using context menu
110
- * options
111
- */
112
- export declare class TextField extends DisplayObjectContainer {
113
- private _onClipboardPasteDelegate;
114
- private static _textFields;
115
- static assetType: string;
116
- static getNewTextField(): TextField;
117
- static clearPool(): void;
118
- private static _onChangedEvent;
119
- textOffsetX: number;
120
- textOffsetY: number;
121
- private _width;
122
- private _height;
123
- private _graphics;
124
- private _bottomScrollV;
125
- private _caretIndex;
126
- private _maxScrollH;
127
- private _maxScrollV;
128
- private _numLines;
129
- private _selectionBeginIndex;
130
- private _selectionEndIndex;
131
- private _biggestLine;
132
- /**
133
- * Renderable text, used for computing a glyphs
134
- * @private
135
- */
136
- private _iText;
137
- /**
138
- * Place where is diff is begun to end
139
- * @private
140
- */
141
- private _iTextDiffStart;
142
- /**
143
- * Original text passed to field
144
- * @private
145
- */
146
- private _text;
147
- private _iTextWoLineBreaks;
148
- private _textInteractionMode;
149
- private _textWidth;
150
- private _textHeight;
151
- private _charBoundaries;
152
- private _firstCharInParagraph;
153
- private _imageReference;
154
- private _lineMetrics;
155
- private _paragraphLength;
156
- _textFormat: TextFormat;
157
- _newTextFormat: TextFormat;
158
- _textFormats: TextFormat[];
159
- _textFormatsIdx: number[];
160
- textShapes: StringMap<TextShape>;
161
- private inMaskMode;
162
- private maskChild;
163
- private textChild;
164
- private targetGraphics;
165
- private cursorShape;
166
- private bgShapeSelect;
167
- private cursorIntervalID;
168
- cursorBlinking: boolean;
169
- showSelection: boolean;
170
- _textDirty: Boolean;
171
- _positionsDirty: Boolean;
172
- _glyphsDirty: Boolean;
173
- _shapesDirty: Boolean;
174
- _textShapesDirty: Boolean;
175
- chars_codes: number[];
176
- chars_width: number[];
177
- tf_per_char: TextFormat[];
178
- words: WordStore;
179
- _lastWordsCount: number;
180
- private _textRuns_formats;
181
- private _textRuns_words;
182
- private _paragraph_textRuns_indices;
183
- private _maxWidthLine;
184
- private _labelData;
185
- html: boolean;
186
- private lines_wordStartIndices;
187
- private lines_wordEndIndices;
188
- private lines_start_y;
189
- private lines_start_x;
190
- private lines_charIdx_start;
191
- private lines_charIdx_end;
192
- private lines_width;
193
- private lines_height;
194
- private lines_numSpacesPerline;
195
- private char_positions_x;
196
- private char_positions_y;
197
- sourceTextField: TextField;
198
- private _maskWidth;
199
- private _maskHeight;
200
- private _maskTextOffsetX;
201
- private _maskTextOffsetY;
202
- bgShape: Shape;
203
- isStatic: boolean;
204
- updateMaskMode(): void;
205
- getMouseCursor(): string;
206
- get isInFocus(): boolean;
207
- set isInFocus(value: boolean);
208
- setFocus(value: boolean, fromMouseDown?: boolean, sendSoftKeyEvent?: boolean): void;
209
- private enableInput;
210
- findCharIdxForMouse(event: MouseEvent): number;
211
- private startSelectionByMouseDelegate;
212
- private startSelectionByMouse;
213
- private stopSelectionByMouseDelegate;
214
- private stopSelectionByMouse;
215
- private updateSelectionByMouseDelegate;
216
- private updateSelectionByMouse;
217
- private drawSelectionGraphics;
218
- private scrollToCursor;
219
- private drawCursor;
220
- private drawSelectedBG;
221
- drawBG(): void;
222
- drawBorder(): void;
223
- getTextShapeForIdentifierAndFormat(id: string, format: TextFormat): TextShape;
224
- /**
225
- * When set to <code>true</code> and the text field is not in focus, Flash
226
- * Player highlights the selection in the text field in gray. When set to
227
- * <code>false</code> and the text field is not in focus, Flash Player does
228
- * not highlight the selection in the text field.
229
- *
230
- * @default false
231
- */
232
- alwaysShowSelection: boolean;
233
- /**
234
- * The type of anti-aliasing used for this text field. Use
235
- * <code>flash.text.AntiAliasType</code> constants for this property. You can
236
- * control this setting only if the font is embedded(with the
237
- * <code>embedFonts</code> property set to <code>true</code>). The default
238
- * setting is <code>flash.text.AntiAliasType.NORMAL</code>.
239
- *
240
- * <p>To set values for this property, use the following string values:</p>
241
- */
242
- antiAliasType: AntiAliasType;
243
- /**
244
- * Controls automatic sizing and alignment of text fields. Acceptable values
245
- * for the <code>TextFieldAutoSize</code> constants:
246
- * <code>TextFieldAutoSize.NONE</code>(the default),
247
- * <code>TextFieldAutoSize.LEFT</code>, <code>TextFieldAutoSize.RIGHT</code>,
248
- * and <code>TextFieldAutoSize.CENTER</code>.
249
- *
250
- * <p>If <code>autoSize</code> is set to <code>TextFieldAutoSize.NONE</code>
251
- * (the default) no resizing occurs.</p>
252
- *
253
- * <p>If <code>autoSize</code> is set to <code>TextFieldAutoSize.LEFT</code>,
254
- * the text is treated as left-justified text, meaning that the left margin
255
- * of the text field remains fixed and any resizing of a single line of the
256
- * text field is on the right margin. If the text includes a line break(for
257
- * example, <code>"\n"</code> or <code>"\r"</code>), the bottom is also
258
- * resized to fit the next line of text. If <code>wordWrap</code> is also set
259
- * to <code>true</code>, only the bottom of the text field is resized and the
260
- * right side remains fixed.</p>
261
- *
262
- * <p>If <code>autoSize</code> is set to
263
- * <code>TextFieldAutoSize.RIGHT</code>, the text is treated as
264
- * right-justified text, meaning that the right margin of the text field
265
- * remains fixed and any resizing of a single line of the text field is on
266
- * the left margin. If the text includes a line break(for example,
267
- * <code>"\n" or "\r")</code>, the bottom is also resized to fit the next
268
- * line of text. If <code>wordWrap</code> is also set to <code>true</code>,
269
- * only the bottom of the text field is resized and the left side remains
270
- * fixed.</p>
271
- *
272
- * <p>If <code>autoSize</code> is set to
273
- * <code>TextFieldAutoSize.CENTER</code>, the text is treated as
274
- * center-justified text, meaning that any resizing of a single line of the
275
- * text field is equally distributed to both the right and left margins. If
276
- * the text includes a line break(for example, <code>"\n"</code> or
277
- * <code>"\r"</code>), the bottom is also resized to fit the next line of
278
- * text. If <code>wordWrap</code> is also set to <code>true</code>, only the
279
- * bottom of the text field is resized and the left and right sides remain
280
- * fixed.</p>
281
- *
282
- * @throws ArgumentError The <code>autoSize</code> specified is not a member
283
- * of flash.text.TextFieldAutoSize.
284
- */
285
- private _autoSize;
286
- get autoSize(): string;
287
- set autoSize(value: string);
288
- private _internalScale;
289
- get internalScale(): Vector3D;
290
- _iInternalUpdate(): void;
291
- /**
292
- *
293
- * @returns {string}
294
- */
295
- get assetType(): string;
296
- /**
297
- * Specifies whether the text field has a background fill. If
298
- * <code>true</code>, the text field has a background fill. If
299
- * <code>false</code>, the text field has no background fill. Use the
300
- * <code>backgroundColor</code> property to set the background color of a
301
- * text field.
302
- *
303
- * @default false
304
- */
305
- private _background;
306
- get background(): boolean;
307
- set background(value: boolean);
308
- /**
309
- * The color of the text field background. The default value is
310
- * <code>0xFFFFFF</code>(white). This property can be retrieved or set, even
311
- * if there currently is no background, but the color is visible only if the
312
- * text field has the <code>background</code> property set to
313
- * <code>true</code>.
314
- */
315
- private _backgroundColor;
316
- get backgroundColor(): number;
317
- set backgroundColor(value: number);
318
- /**
319
- * Specifies whether the text field has a border. If <code>true</code>, the
320
- * text field has a border. If <code>false</code>, the text field has no
321
- * border. Use the <code>borderColor</code> property to set the border color.
322
- *
323
- * @default false
324
- */
325
- private _border;
326
- get border(): boolean;
327
- set border(value: boolean);
328
- /**
329
- * The color of the text field border. The default value is
330
- * <code>0x000000</code>(black). This property can be retrieved or set, even
331
- * if there currently is no border, but the color is visible only if the text
332
- * field has the <code>border</code> property set to <code>true</code>.
333
- */
334
- private _borderColor;
335
- get borderColor(): number;
336
- set borderColor(value: number);
337
- /**
338
- * An integer(1-based index) that indicates the bottommost line that is
339
- * currently visible in the specified text field. Think of the text field as
340
- * a window onto a block of text. The <code>scrollV</code> property is the
341
- * 1-based index of the topmost visible line in the window.
342
- *
343
- * <p>All the text between the lines indicated by <code>scrollV</code> and
344
- * <code>bottomScrollV</code> is currently visible in the text field.</p>
345
- */
346
- get bottomScrollV(): number;
347
- set bottomScrollV(value: number);
348
- /**
349
- * The index of the insertion point(caret) position. If no insertion point
350
- * is displayed, the value is the position the insertion point would be if
351
- * you restored focus to the field(typically where the insertion point last
352
- * was, or 0 if the field has not had focus).
353
- *
354
- * <p>Selection span indexes are zero-based(for example, the first position
355
- * is 0, the second position is 1, and so on).</p>
356
- */
357
- get caretIndex(): number;
358
- /**
359
- * A Boolean value that specifies whether extra white space(spaces, line
360
- * breaks, and so on) in a text field with HTML text is removed. The default
361
- * value is <code>false</code>. The <code>condenseWhite</code> property only
362
- * affects text set with the <code>htmlText</code> property, not the
363
- * <code>text</code> property. If you set text with the <code>text</code>
364
- * property, <code>condenseWhite</code> is ignored.
365
- *
366
- * <p>If <code>condenseWhite</code> is set to <code>true</code>, use standard
367
- * HTML commands such as <code><BR></code> and <code><P></code> to place line
368
- * breaks in the text field.</p>
369
- *
370
- * <p>Set the <code>condenseWhite</code> property before setting the
371
- * <code>htmlText</code> property.</p>
372
- */
373
- condenseWhite: boolean;
374
- /**
375
- * Specifies the format applied to newly inserted text, such as text entered
376
- * by a user or text inserted with the <code>replaceSelectedText()</code>
377
- * method.
378
- *
379
- * <p><b>Note:</b> When selecting characters to be replaced with
380
- * <code>setSelection()</code> and <code>replaceSelectedText()</code>, the
381
- * <code>defaultTextFormat</code> will be applied only if the text has been
382
- * selected up to and including the last character. Here is an example:</p>
383
- * <pre xml:space="preserve"> public my_txt:TextField new TextField();
384
- * my_txt.text = "Flash Macintosh version"; public my_fmt:TextFormat = new
385
- * TextFormat(); my_fmt.color = 0xFF0000; my_txt.defaultTextFormat = my_fmt;
386
- * my_txt.setSelection(6,15); // partial text selected - defaultTextFormat
387
- * not applied my_txt.setSelection(6,23); // text selected to end -
388
- * defaultTextFormat applied my_txt.replaceSelectedText("Windows version");
389
- * </pre>
390
- *
391
- * <p>When you access the <code>defaultTextFormat</code> property, the
392
- * returned TextFormat object has all of its properties defined. No property
393
- * is <code>null</code>.</p>
394
- *
395
- * <p><b>Note:</b> You can't set this property if a style sheet is applied to
396
- * the text field.</p>
397
- *
398
- * @throws Error This method cannot be used on a text field with a style
399
- * sheet.
400
- */
401
- /**
402
- * Specifies whether the text field is a password text field. If the value of
403
- * this property is <code>true</code>, the text field is treated as a
404
- * password text field and hides the input characters using asterisks instead
405
- * of the actual characters. If <code>false</code>, the text field is not
406
- * treated as a password text field. When password mode is enabled, the Cut
407
- * and Copy commands and their corresponding keyboard shortcuts will not
408
- * function. This security mechanism prevents an unscrupulous user from using
409
- * the shortcuts to discover a password on an unattended computer.
410
- *
411
- * @default false
412
- */
413
- displayAsPassword: boolean;
414
- /**
415
- * Specifies whether to render by using embedded font outlines. If
416
- * <code>false</code>, Flash Player renders the text field by using device
417
- * fonts.
418
- *
419
- * <p>If you set the <code>embedFonts</code> property to <code>true</code>
420
- * for a text field, you must specify a font for that text by using the
421
- * <code>font</code> property of a TextFormat object applied to the text
422
- * field. If the specified font is not embedded in the SWF file, the text is
423
- * not displayed.</p>
424
- *
425
- * @default false
426
- */
427
- embedFonts: boolean;
428
- /**
429
- * The type of grid fitting used for this text field. This property applies
430
- * only if the <code>flash.text.AntiAliasType</code> property of the text
431
- * field is set to <code>flash.text.AntiAliasType.ADVANCED</code>.
432
- *
433
- * <p>The type of grid fitting used determines whether Flash Player forces
434
- * strong horizontal and vertical lines to fit to a pixel or subpixel grid,
435
- * or not at all.</p>
436
- *
437
- * <p>For the <code>flash.text.GridFitType</code> property, you can use the
438
- * following string values:</p>
439
- *
440
- * @default pixel
441
- */
442
- gridFitType: GridFitType;
443
- /**
444
- *
445
- */
446
- get height(): number;
447
- set height(val: number);
448
- /**
449
- * Contains the HTML representation of the text field contents.
450
- *
451
- * <p>Flash Player supports the following HTML tags:</p>
452
- *
453
- * <p>Flash Player and AIR also support explicit character codes, such as
454
- * &#38;(ASCII ampersand) and &#x20AC;(Unicode € symbol). </p>
455
- */
456
- private _htmlText;
457
- get htmlText(): string;
458
- set htmlText(value: string);
459
- /**
460
- * The number of characters in a text field. A character such as tab
461
- * (<code>\t</code>) counts as one character.
462
- */
463
- get length(): number;
464
- /**
465
- * The maximum number of characters that the text field can contain, as
466
- * entered by a user. A script can insert more text than
467
- * <code>maxChars</code> allows; the <code>maxChars</code> property indicates
468
- * only how much text a user can enter. If the value of this property is
469
- * <code>0</code>, a user can enter an unlimited amount of text.
470
- *
471
- * @default 0
472
- */
473
- maxChars: number;
474
- /**
475
- * The maximum value of <code>scrollH</code>.
476
- */
477
- get maxScrollH(): number;
478
- /**
479
- * The maximum value of <code>scrollV</code>.
480
- */
481
- get maxScrollV(): number;
482
- /**
483
- * A Boolean value that indicates whether Flash Player automatically scrolls
484
- * multiline text fields when the user clicks a text field and rolls the
485
- * mouse wheel. By default, this value is <code>true</code>. This property is
486
- * useful if you want to prevent mouse wheel scrolling of text fields, or
487
- * implement your own text field scrolling.
488
- */
489
- mouseWheelEnabled: boolean;
490
- /**
491
- * Indicates whether field is a multiline text field. If the value is
492
- * <code>true</code>, the text field is multiline; if the value is
493
- * <code>false</code>, the text field is a single-line text field. In a field
494
- * of type <code>TextFieldType.INPUT</code>, the <code>multiline</code> value
495
- * determines whether the <code>Enter</code> key creates a new line(a value
496
- * of <code>false</code>, and the <code>Enter</code> key is ignored). If you
497
- * paste text into a <code>TextField</code> with a <code>multiline</code>
498
- * value of <code>false</code>, newlines are stripped out of the text.
499
- *
500
- * @default false
501
- */
502
- multiline: boolean;
503
- /**
504
- * Defines the number of text lines in a multiline text field. If
505
- * <code>wordWrap</code> property is set to <code>true</code>, the number of
506
- * lines increases when text wraps.
507
- */
508
- get numLines(): number;
509
- /**
510
- * Indicates the set of characters that a user can enter into the text field.
511
- * If the value of the <code>restrict</code> property is <code>null</code>,
512
- * you can enter any character. If the value of the <code>restrict</code>
513
- * property is an empty string, you cannot enter any character. If the value
514
- * of the <code>restrict</code> property is a string of characters, you can
515
- * enter only characters in the string into the text field. The string is
516
- * scanned from left to right. You can specify a range by using the hyphen
517
- * (-) character. Only user interaction is restricted; a script can put any
518
- * text into the text field. <ph outputclass="flashonly">This property does
519
- * not synchronize with the Embed font options in the Property inspector.
520
- *
521
- * <p>If the string begins with a caret(^) character, all characters are
522
- * initially accepted and succeeding characters in the string are excluded
523
- * from the set of accepted characters. If the string does not begin with a
524
- * caret(^) character, no characters are initially accepted and succeeding
525
- * characters in the string are included in the set of accepted
526
- * characters.</p>
527
- *
528
- * <p>The following example allows only uppercase characters, spaces, and
529
- * numbers to be entered into a text field:</p>
530
- * <pre xml:space="preserve"> my_txt.restrict = "A-Z 0-9"; </pre>
531
- *
532
- * <p>The following example includes all characters, but excludes lowercase
533
- * letters:</p>
534
- * <pre xml:space="preserve"> my_txt.restrict = "^a-z"; </pre>
535
- *
536
- * <p>You can use a backslash to enter a ^ or - verbatim. The accepted
537
- * backslash sequences are \-, \^ or \\. The backslash must be an actual
538
- * character in the string, so when specified in ActionScript, a double
539
- * backslash must be used. For example, the following code includes only the
540
- * dash(-) and caret(^):</p>
541
- * <pre xml:space="preserve"> my_txt.restrict = "\\-\\^"; </pre>
542
- *
543
- * <p>The ^ can be used anywhere in the string to toggle between including
544
- * characters and excluding characters. The following code includes only
545
- * uppercase letters, but excludes the uppercase letter Q:</p>
546
- * <pre xml:space="preserve"> my_txt.restrict = "A-Z^Q"; </pre>
547
- *
548
- * <p>You can use the <code>\u</code> escape sequence to construct
549
- * <code>restrict</code> strings. The following code includes only the
550
- * characters from ASCII 32(space) to ASCII 126(tilde).</p>
551
- * <pre xml:space="preserve"> my_txt.restrict = "\u0020-\u007E"; </pre>
552
- *
553
- * @default null
554
- */
555
- _restrict: string;
556
- _restrictRegex: RegExp;
557
- get restrict(): string;
558
- set restrict(value: string);
559
- /**
560
- * The current horizontal scrolling position. If the <code>scrollH</code>
561
- * property is 0, the text is not horizontally scrolled. This property value
562
- * is an integer that represents the horizontal position in pixels.
563
- *
564
- * <p>The units of horizontal scrolling are pixels, whereas the units of
565
- * vertical scrolling are lines. Horizontal scrolling is measured in pixels
566
- * because most fonts you typically use are proportionally spaced; that is,
567
- * the characters can have different widths. Flash Player performs vertical
568
- * scrolling by line because users usually want to see a complete line of
569
- * text rather than a partial line. Even if a line uses multiple fonts, the
570
- * height of the line adjusts to fit the largest font in use.</p>
571
- *
572
- * <p><b>Note: </b>The <code>scrollH</code> property is zero-based, not
573
- * 1-based like the <code>scrollV</code> vertical scrolling property.</p>
574
- */
575
- private _scrollH;
576
- get scrollH(): number;
577
- set scrollH(value: number);
578
- /**
579
- * The vertical position of text in a text field. The <code>scrollV</code>
580
- * property is useful for directing users to a specific paragraph in a long
581
- * passage, or creating scrolling text fields.
582
- *
583
- * <p>The units of vertical scrolling are lines, whereas the units of
584
- * horizontal scrolling are pixels. If the first line displayed is the first
585
- * line in the text field, scrollV is set to 1(not 0). Horizontal scrolling
586
- * is measured in pixels because most fonts are proportionally spaced; that
587
- * is, the characters can have different widths. Flash performs vertical
588
- * scrolling by line because users usually want to see a complete line of
589
- * text rather than a partial line. Even if there are multiple fonts on a
590
- * line, the height of the line adjusts to fit the largest font in use.</p>
591
- */
592
- _scrollV: number;
593
- get scrollV(): number;
594
- set scrollV(value: number);
595
- /**
596
- * A Boolean value that indicates whether the text field is selectable. The
597
- * value <code>true</code> indicates that the text is selectable. The
598
- * <code>selectable</code> property controls whether a text field is
599
- * selectable, not whether a text field is editable. A dynamic text field can
600
- * be selectable even if it is not editable. If a dynamic text field is not
601
- * selectable, the user cannot select its text.
602
- *
603
- * <p>If <code>selectable</code> is set to <code>false</code>, the text in
604
- * the text field does not respond to selection commands from the mouse or
605
- * keyboard, and the text cannot be copied with the Copy command. If
606
- * <code>selectable</code> is set to <code>true</code>, the text in the text
607
- * field can be selected with the mouse or keyboard, and the text can be
608
- * copied with the Copy command. You can select text this way even if the
609
- * text field is a dynamic text field instead of an input text field. </p>
610
- *
611
- * @default true
612
- */
613
- private _selectable;
614
- get selectable(): boolean;
615
- set selectable(value: boolean);
616
- /**
617
- * The zero-based character index value of the first character in the current
618
- * selection. For example, the first character is 0, the second character is
619
- * 1, and so on. If no text is selected, this property is the value of
620
- * <code>caretIndex</code>.
621
- */
622
- get selectionBeginIndex(): number;
623
- /**
624
- * The zero-based character index value of the last character in the current
625
- * selection. For example, the first character is 0, the second character is
626
- * 1, and so on. If no text is selected, this property is the value of
627
- * <code>caretIndex</code>.
628
- */
629
- get selectionEndIndex(): number;
630
- /**
631
- * The sharpness of the glyph edges in this text field. This property applies
632
- * only if the <code>flash.text.AntiAliasType</code> property of the text
633
- * field is set to <code>flash.text.AntiAliasType.ADVANCED</code>. The range
634
- * for <code>sharpness</code> is a number from -400 to 400. If you attempt to
635
- * set <code>sharpness</code> to a value outside that range, Flash sets the
636
- * property to the nearest value in the range(either -400 or 400).
637
- *
638
- * @default 0
639
- */
640
- sharpness: number;
641
- /**
642
- * Attaches a style sheet to the text field. For information on creating
643
- * style sheets, see the StyleSheet class and the <i>ActionScript 3.0
644
- * Developer's Guide</i>.
645
- *
646
- * <p>You can change the style sheet associated with a text field at any
647
- * time. If you change the style sheet in use, the text field is redrawn with
648
- * the new style sheet. You can set the style sheet to <code>null</code> or
649
- * <code>undefined</code> to remove the style sheet. If the style sheet in
650
- * use is removed, the text field is redrawn without a style sheet. </p>
651
- *
652
- * <p><b>Note:</b> If the style sheet is removed, the contents of both
653
- * <code>TextField.text</code> and <code> TextField.htmlText</code> change to
654
- * incorporate the formatting previously applied by the style sheet. To
655
- * preserve the original <code>TextField.htmlText</code> contents without the
656
- * formatting, save the value in a variable before removing the style
657
- * sheet.</p>
658
- */
659
- styleSheet: StyleSheet;
660
- /**
661
- * A string that is the current text in the text field. Lines are separated
662
- * by the carriage return character(<code>'\r'</code>, ASCII 13). This
663
- * property contains unformatted text in the text field, without HTML tags.
664
- *
665
- * <p>To get the text in HTML form, use the <code>htmlText</code>
666
- * property.</p>
667
- */
668
- get text(): string;
669
- set text(value: string);
670
- setLabelData(labelData: any): void;
671
- get newTextFormat(): TextFormat;
672
- set newTextFormat(value: TextFormat);
673
- get textFormat(): TextFormat;
674
- set textFormat(value: TextFormat);
675
- /**
676
- * Indicates the horizontal scale(percentage) of the object as applied from
677
- * the registration point. The default registration point is(0,0). 1.0
678
- * equals 100% scale.
679
- *
680
- * <p>Scaling the local coordinate system changes the <code>x</code> and
681
- * <code>y</code> property values, which are defined in whole pixels. </p>
682
- */
683
- get scaleX(): number;
684
- set scaleX(val: number);
685
- /**
686
- * Indicates the vertical scale(percentage) of an object as applied from the
687
- * registration point of the object. The default registration point is(0,0).
688
- * 1.0 is 100% scale.
689
- *
690
- * <p>Scaling the local coordinate system changes the <code>x</code> and
691
- * <code>y</code> property values, which are defined in whole pixels. </p>
692
- */
693
- get scaleY(): number;
694
- set scaleY(val: number);
695
- /**
696
- * The color of the text in a text field, in hexadecimal format. The
697
- * hexadecimal color system uses six digits to represent color values. Each
698
- * digit has 16 possible values or characters. The characters range from 0-9
699
- * and then A-F. For example, black is <code>0x000000</code>; white is
700
- * <code>0xFFFFFF</code>.
701
- *
702
- * @default 0(0x000000)
703
- */
704
- _textColor: number;
705
- get textColor(): number;
706
- set textColor(value: number);
707
- private getTextColorForTextFormat;
708
- /**
709
- * The interaction mode property, Default value is
710
- * TextInteractionMode.NORMAL. On mobile platforms, the normal mode implies
711
- * that the text can be scrolled but not selected. One can switch to the
712
- * selectable mode through the in-built context menu on the text field. On
713
- * Desktop, the normal mode implies that the text is in scrollable as well as
714
- * selection mode.
715
- */
716
- get textInteractionMode(): TextInteractionMode;
717
- /**
718
- * The width of the text in pixels.
719
- */
720
- get textWidth(): number;
721
- /**
722
- * The width of the text in pixels.
723
- */
724
- get textHeight(): number;
725
- /**
726
- * The thickness of the glyph edges in this text field. This property applies
727
- * only when <code>AntiAliasType</code> is set to
728
- * <code>AntiAliasType.ADVANCED</code>.
729
- *
730
- * <p>The range for <code>thickness</code> is a number from -200 to 200. If
731
- * you attempt to set <code>thickness</code> to a value outside that range,
732
- * the property is set to the nearest value in the range(either -200 or
733
- * 200).</p>
734
- *
735
- * @default 0
736
- */
737
- thickness: number;
738
- /**
739
- * The type of the text field. Either one of the following TextFieldType
740
- * constants: <code>TextFieldType.DYNAMIC</code>, which specifies a dynamic
741
- * text field, which a user cannot edit, or <code>TextFieldType.INPUT</code>,
742
- * which specifies an input text field, which a user can edit.
743
- *
744
- * @default dynamic
745
- * @throws ArgumentError The <code>type</code> specified is not a member of
746
- * flash.text.TextFieldType.
747
- */
748
- _type: TextFieldType;
749
- get type(): TextFieldType;
750
- set type(value: TextFieldType);
751
- /**
752
- * Specifies whether to copy and paste the text formatting along with the
753
- * text. When set to <code>true</code>, Flash Player copies and pastes
754
- * formatting(such as alignment, bold, and italics) when you copy and paste
755
- * between text fields. Both the origin and destination text fields for the
756
- * copy and paste procedure must have <code>useRichTextClipboard</code> set
757
- * to <code>true</code>. The default value is <code>false</code>.
758
- */
759
- useRichTextClipboard: boolean;
760
- /**
761
- * A Boolean value that indicates whether the text field has word wrap. If
762
- * the value of <code>wordWrap</code> is <code>true</code>, the text field
763
- * has word wrap; if the value is <code>false</code>, the text field does not
764
- * have word wrap. The default value is <code>false</code>.
765
- */
766
- _wordWrap: boolean;
767
- get x(): number;
768
- set x(val: number);
769
- /**
770
- *
771
- */
772
- get width(): number;
773
- set width(val: number);
774
- set wordWrap(val: boolean);
775
- /**
776
- * The width of the text in pixels.
777
- */
778
- get wordWrap(): boolean;
779
- /**
780
- * Creates a new TextField instance. After you create the TextField instance,
781
- * call the <code>addChild()</code> or <code>addChildAt()</code> method of
782
- * the parent DisplayObjectContainer object to add the TextField instance to
783
- * the display list.
784
- *
785
- * <p>The default size for a text field is 100 x 100 pixels.</p>
786
- */
787
- constructor();
788
- advanceFrame(): void;
789
- getEntity(): IPartitionEntity;
790
- clear(): void;
791
- /**
792
- * @inheritDoc
793
- */
794
- dispose(): void;
795
- /**
796
- * @inheritDoc
797
- */
798
- disposeValues(): void;
799
- /**
800
- * Reconstructs the Graphics for this Text-field.
801
- */
802
- reConstruct(buildGraphics?: boolean): void;
803
- reset(): void;
804
- private onClipboardPaste;
805
- private _resetParagraph;
806
- private buildParagraphs;
807
- private adjustPositionForAutoSize;
808
- private getWordPositions;
809
- staticMatrix: any;
810
- private buildGlyphsForLabelData;
811
- private buildGlyphs;
812
- private buildShapes;
813
- /**
814
- * Appends the string specified by the <code>newText</code> parameter to the
815
- * end of the text of the text field. This method is more efficient than an
816
- * addition assignment(<code>+=</code>) on a <code>text</code> property
817
- * (such as <code>someTextField.text += moreText</code>), particularly for a
818
- * text field that contains a significant amount of content.
819
- *
820
- * @param newText The string to append to the existing text.
821
- */
822
- appendText(newText: string): void;
823
- /**
824
- * *tells the Textfield that a paragraph is defined completly.
825
- * e.g. the textfield will start a new line for future added text.
826
- */
827
- closeParagraph(): void;
828
- /**
829
- * Returns a rectangle that is the bounding box of the character.
830
- *
831
- * @param charIndex The zero-based index value for the character(for
832
- * example, the first position is 0, the second position is
833
- * 1, and so on).
834
- * @return A rectangle with <code>x</code> and <code>y</code> minimum and
835
- * maximum values defining the bounding box of the character.
836
- */
837
- getCharBoundaries(charIndex: number): Rectangle;
838
- /**
839
- * Returns the zero-based index value of the character at the point specified
840
- * by the <code>x</code> and <code>y</code> parameters.
841
- *
842
- * @param x The <i>x</i> coordinate of the character.
843
- * @param y The <i>y</i> coordinate of the character.
844
- * @return The zero-based index value of the character(for example, the
845
- * first position is 0, the second position is 1, and so on). Returns
846
- * -1 if the point is not over any character.
847
- */
848
- getCharIndexAtPoint(x: number, y: number, lineIdx?: number): number;
849
- /**
850
- * Given a character index, returns the index of the first character in the
851
- * same paragraph.
852
- *
853
- * @param charIndex The zero-based index value of the character(for example,
854
- * the first character is 0, the second character is 1, and
855
- * so on).
856
- * @return The zero-based index value of the first character in the same
857
- * paragraph.
858
- * @throws RangeError The character index specified is out of range.
859
- */
860
- getFirstCharInParagraph(charIndex: number): number;
861
- /**
862
- * Returns a DisplayObject reference for the given <code>id</code>, for an
863
- * image or SWF file that has been added to an HTML-formatted text field by
864
- * using an <code><img></code> tag. The <code><img></code> tag is in the
865
- * following format:
866
- *
867
- * <p><pre xml:space="preserve"><code> <img src = 'filename.jpg' id =
868
- * 'instanceName' ></code></pre></p>
869
- *
870
- * @param id The <code>id</code> to match(in the <code>id</code> attribute
871
- * of the <code><img></code> tag).
872
- * @return The display object corresponding to the image or SWF file with the
873
- * matching <code>id</code> attribute in the <code><img></code> tag
874
- * of the text field. For media loaded from an external source, this
875
- * object is a Loader object, and, once loaded, the media object is a
876
- * child of that Loader object. For media embedded in the SWF file,
877
- * it is the loaded object. If no <code><img></code> tag with the
878
- * matching <code>id</code> exists, the method returns
879
- * <code>null</code>.
880
- */
881
- getImageReference(id: string): DisplayObject;
882
- /**
883
- * Returns the zero-based index value of the line at the point specified by
884
- * the <code>x</code> and <code>y</code> parameters.
885
- *
886
- * @param x The <i>x</i> coordinate of the line.
887
- * @param y The <i>y</i> coordinate of the line.
888
- * @return The zero-based index value of the line(for example, the first
889
- * line is 0, the second line is 1, and so on). Returns -1 if the
890
- * point is not over any line.
891
- */
892
- getLineIndexAtPoint(x: number, y: number): number;
893
- /**
894
- * Returns the zero-based index value of the line containing the character
895
- * specified by the <code>charIndex</code> parameter.
896
- *
897
- * @param charIndex The zero-based index value of the character(for example,
898
- * the first character is 0, the second character is 1, and
899
- * so on).
900
- * @return The zero-based index value of the line.
901
- * @throws RangeError The character index specified is out of range.
902
- */
903
- getLineIndexOfChar(charIndex: number): number;
904
- /**
905
- * Returns the number of characters in a specific text line.
906
- *
907
- * @param lineIndex The line number for which you want the length.
908
- * @return The number of characters in the line.
909
- * @throws RangeError The line number specified is out of range.
910
- */
911
- getLineLength(lineIndex: number): number;
912
- /**
913
- * Returns metrics information about a given text line.
914
- *
915
- * @param lineIndex The line number for which you want metrics information.
916
- * @return A TextLineMetrics object.
917
- * @throws RangeError The line number specified is out of range.
918
- */
919
- getLineMetrics(lineIndex: number): TextLineMetrics;
920
- /**
921
- * Returns the character index of the first character in the line that the
922
- * <code>lineIndex</code> parameter specifies.
923
- *
924
- * @param lineIndex The zero-based index value of the line(for example, the
925
- * first line is 0, the second line is 1, and so on).
926
- * @return The zero-based index value of the first character in the line.
927
- * @throws RangeError The line number specified is out of range.
928
- */
929
- getLineOffset(lineIndex: number): number;
930
- /**
931
- * Returns the text of the line specified by the <code>lineIndex</code>
932
- * parameter.
933
- *
934
- * @param lineIndex The zero-based index value of the line(for example, the
935
- * first line is 0, the second line is 1, and so on).
936
- * @return The text string contained in the specified line.
937
- * @throws RangeError The line number specified is out of range.
938
- */
939
- getLineText(lineIndex: number): string;
940
- /**
941
- * Given a character index, returns the length of the paragraph containing
942
- * the given character. The length is relative to the first character in the
943
- * paragraph(as returned by <code>getFirstCharInParagraph()</code>), not to
944
- * the character index passed in.
945
- *
946
- * @param charIndex The zero-based index value of the character(for example,
947
- * the first character is 0, the second character is 1, and
948
- * so on).
949
- * @return Returns the number of characters in the paragraph.
950
- * @throws RangeError The character index specified is out of range.
951
- */
952
- getParagraphLength(charIndex: number): number;
953
- /**
954
- * Returns a TextFormat object that contains formatting information for the
955
- * range of text that the <code>beginIndex</code> and <code>endIndex</code>
956
- * parameters specify. Only properties that are common to the entire text
957
- * specified are set in the resulting TextFormat object. Any property that is
958
- * <i>mixed</i>, meaning that it has different values at different points in
959
- * the text, has a value of <code>null</code>.
960
- *
961
- * <p>If you do not specify values for these parameters, this method is
962
- * applied to all the text in the text field. </p>
963
- *
964
- * <p>The following table describes three possible usages:</p>
965
- *
966
- * @return The TextFormat object that represents the formatting properties
967
- * for the specified text.
968
- * @throws RangeError The <code>beginIndex</code> or <code>endIndex</code>
969
- * specified is out of range.
970
- */
971
- getTextFormat(beginIndex?: number, endIndex?: number): TextFormat;
972
- /**
973
- * Replaces the current selection with the contents of the <code>value</code>
974
- * parameter. The text is inserted at the position of the current selection,
975
- * using the current default character format and default paragraph format.
976
- * The text is not treated as HTML.
977
- *
978
- * <p>You can use the <code>replaceSelectedText()</code> method to insert and
979
- * delete text without disrupting the character and paragraph formatting of
980
- * the rest of the text.</p>
981
- *
982
- * <p><b>Note:</b> This method does not work if a style sheet is applied to
983
- * the text field.</p>
984
- *
985
- * @param value The string to replace the currently selected text.
986
- * @throws Error This method cannot be used on a text field with a style
987
- * sheet.
988
- */
989
- replaceSelectedText(value: string): void;
990
- /**
991
- * Replaces the range of characters that the <code>beginIndex</code> and
992
- * <code>endIndex</code> parameters specify with the contents of the
993
- * <code>newText</code> parameter. As designed, the text from
994
- * <code>beginIndex</code> to <code>endIndex-1</code> is replaced.
995
- *
996
- * <p><b>Note:</b> This method does not work if a style sheet is applied to
997
- * the text field.</p>
998
- *
999
- * @param beginIndex The zero-based index value for the start position of the
1000
- * replacement range.
1001
- * @param endIndex The zero-based index position of the first character
1002
- * after the desired text span.
1003
- * @param newText The text to use to replace the specified range of
1004
- * characters.
1005
- * @throws Error This method cannot be used on a text field with a style
1006
- * sheet.
1007
- */
1008
- replaceText(beginIndex: number, endIndex: number, newText: string): void;
1009
- /**
1010
- * Sets as selected the text designated by the index values of the first and
1011
- * last characters, which are specified with the <code>beginIndex</code> and
1012
- * <code>endIndex</code> parameters. If the two parameter values are the
1013
- * same, this method sets the insertion point, as if you set the
1014
- * <code>caretIndex</code> property.
1015
- *
1016
- * @param beginIndex The zero-based index value of the first character in the
1017
- * selection(for example, the first character is 0, the
1018
- * second character is 1, and so on).
1019
- * @param endIndex The zero-based index value of the last character in the
1020
- * selection.
1021
- */
1022
- setSelection(beginIndex: number, endIndex: number): void;
1023
- /**
1024
- * Applies the text formatting that the <code>format</code> parameter
1025
- * specifies to the specified text in a text field. The value of
1026
- * <code>format</code> must be a TextFormat object that specifies the desired
1027
- * text formatting changes. Only the non-null properties of
1028
- * <code>format</code> are applied to the text field. Any property of
1029
- * <code>format</code> that is set to <code>null</code> is not applied. By
1030
- * default, all of the properties of a newly created TextFormat object are
1031
- * set to <code>null</code>.
1032
- *
1033
- * <p><b>Note:</b> This method does not work if a style sheet is applied to
1034
- * the text field.</p>
1035
- *
1036
- * <p>The <code>setTextFormat()</code> method changes the text formatting
1037
- * applied to a range of characters or to the entire body of text in a text
1038
- * field. To apply the properties of format to all text in the text field, do
1039
- * not specify values for <code>beginIndex</code> and <code>endIndex</code>.
1040
- * To apply the properties of the format to a range of text, specify values
1041
- * for the <code>beginIndex</code> and the <code>endIndex</code> parameters.
1042
- * You can use the <code>length</code> property to determine the index
1043
- * values.</p>
1044
- *
1045
- * <p>The two types of formatting information in a TextFormat object are
1046
- * character level formatting and paragraph level formatting. Each character
1047
- * in a text field can have its own character formatting settings, such as
1048
- * font name, font size, bold, and italic.</p>
1049
- *
1050
- * <p>For paragraphs, the first character of the paragraph is examined for
1051
- * the paragraph formatting settings for the entire paragraph. Examples of
1052
- * paragraph formatting settings are left margin, right margin, and
1053
- * indentation.</p>
1054
- *
1055
- * <p>Any text inserted manually by the user, or replaced by the
1056
- * <code>replaceSelectedText()</code> method, receives the default text field
1057
- * formatting for new text, and not the formatting specified for the text
1058
- * insertion point. To set the default formatting for new text, use
1059
- * <code>defaultTextFormat</code>.</p>
1060
- *
1061
- * @param format A TextFormat object that contains character and paragraph
1062
- * formatting information.
1063
- * @throws Error This method cannot be used on a text field with a style
1064
- * sheet.
1065
- * @throws RangeError The <code>beginIndex</code> or <code>endIndex</code>
1066
- * specified is out of range.
1067
- */
1068
- setTextFormat(format: TextFormat, beginIndex?: number, endIndex?: number): void;
1069
- /**
1070
- * Returns true if an embedded font is available with the specified
1071
- * <code>fontName</code> and <code>fontStyle</code> where
1072
- * <code>Font.fontType</code> is <code>flash.text.FontType.EMBEDDED</code>.
1073
- * Starting with Flash Player 10, two kinds of embedded fonts can appear in a
1074
- * SWF file. Normal embedded fonts are only used with TextField objects. CFF
1075
- * embedded fonts are only used with the flash.text.engine classes. The two
1076
- * types are distinguished by the <code>fontType</code> property of the
1077
- * <code>Font</code> class, as returned by the <code>enumerateFonts()</code>
1078
- * function.
1079
- *
1080
- * <p>TextField cannot use a font of type <code>EMBEDDED_CFF</code>. If
1081
- * <code>embedFonts</code> is set to <code>true</code> and the only font
1082
- * available at run time with the specified name and style is of type
1083
- * <code>EMBEDDED_CFF</code>, Flash Player fails to render the text, as if no
1084
- * embedded font were available with the specified name and style.</p>
1085
- *
1086
- * <p>If both <code>EMBEDDED</code> and <code>EMBEDDED_CFF</code> fonts are
1087
- * available with the same name and style, the <code>EMBEDDED</code> font is
1088
- * selected and text renders with the <code>EMBEDDED</code> font.</p>
1089
- *
1090
- * @param fontName The name of the embedded font to check.
1091
- * @param fontStyle Specifies the font style to check. Use
1092
- * <code>flash.text.FontStyle</code>
1093
- * @return <code>true</code> if a compatible embedded font is available,
1094
- * otherwise <code>false</code>.
1095
- * @throws ArgumentError The <code>fontStyle</code> specified is not a member
1096
- * of <code>flash.text.FontStyle</code>.
1097
- */
1098
- static isFontCompatible(fontName: string, fontStyle: string): boolean;
1099
- onKeyDelegate: (e: any) => void;
1100
- onKey(e: any): void;
1101
- addCharCode(charCode: number): void;
1102
- private deleteSelectedText;
1103
- addChar(char: string, isShift?: boolean, isCTRL?: boolean, isAlt?: boolean): void;
1104
- private _insertNewText;
1105
- clone(): TextField;
1106
- copyTo(newInstance: TextField): void;
1107
- private _clearTextShapes;
1108
- }
1109
- export {};
1
+ import { Rectangle, Vector3D } from '@awayjs/core';
2
+ import { IPartitionEntity } from '@awayjs/view';
3
+ import { Shape } from '@awayjs/graphics';
4
+ import { AntiAliasType } from '../text/AntiAliasType';
5
+ import { GridFitType } from '../text/GridFitType';
6
+ import { TextFieldType } from '../text/TextFieldType';
7
+ import { TextFormat } from '../text/TextFormat';
8
+ import { TextInteractionMode } from '../text/TextInteractionMode';
9
+ import { TextLineMetrics } from '../text/TextLineMetrics';
10
+ import { DisplayObject } from './DisplayObject';
11
+ import { DisplayObjectContainer } from './DisplayObjectContainer';
12
+ import { TextShape } from '../text/TextShape';
13
+ import { MouseEvent } from '../events/MouseEvent';
14
+ interface IWord {
15
+ start: number;
16
+ x: number;
17
+ y: number;
18
+ width: number;
19
+ len: number;
20
+ }
21
+ declare class WordStore {
22
+ store: Array<IWord>;
23
+ index: number;
24
+ constructor(size?: number);
25
+ put(start: number, x: number, y: number, width: number, len: number): IWord;
26
+ get last(): IWord;
27
+ get length(): number;
28
+ set length(v: number);
29
+ get(index: number): IWord;
30
+ free(): void;
31
+ dispose(): void;
32
+ }
33
+ /**
34
+ * The TextField class is used to create display objects for text display and
35
+ * input. <ph outputclass="flexonly">You can use the TextField class to
36
+ * perform low-level text rendering. However, in Flex, you typically use the
37
+ * Label, Text, TextArea, and TextInput controls to process text. <ph
38
+ * outputclass="flashonly">You can give a text field an instance name in the
39
+ * Property inspector and use the methods and properties of the TextField
40
+ * class to manipulate it with ActionScript. TextField instance names are
41
+ * displayed in the Movie Explorer and in the Insert Target Path dialog box in
42
+ * the Actions panel.
43
+ *
44
+ * <p>To create a text field dynamically, use the <code>TextField()</code>
45
+ * constructor.</p>
46
+ *
47
+ * <p>The methods of the TextField class let you set, select, and manipulate
48
+ * text in a dynamic or input text field that you create during authoring or
49
+ * at runtime. </p>
50
+ *
51
+ * <p>ActionScript provides several ways to format your text at runtime. The
52
+ * TextFormat class lets you set character and paragraph formatting for
53
+ * TextField objects. You can apply Cascading Style Sheets(CSS) styles to
54
+ * text fields by using the <code>TextField.styleSheet</code> property and the
55
+ * StyleSheet class. You can use CSS to style built-in HTML tags, define new
56
+ * formatting tags, or apply styles. You can assign HTML formatted text, which
57
+ * optionally uses CSS styles, directly to a text field. HTML text that you
58
+ * assign to a text field can contain embedded media(movie clips, SWF files,
59
+ * GIF files, PNG files, and JPEG files). The text wraps around the embedded
60
+ * media in the same way that a web browser wraps text around media embedded
61
+ * in an HTML document. </p>
62
+ *
63
+ * <p>Flash Player supports a subset of HTML tags that you can use to format
64
+ * text. See the list of supported HTML tags in the description of the
65
+ * <code>htmlText</code> property.</p>
66
+ *
67
+ * @event change Dispatched after a control value is
68
+ * modified, unlike the
69
+ * <code>textInput</code> event, which is
70
+ * dispatched before the value is modified.
71
+ * Unlike the W3C DOM Event Model version of
72
+ * the <code>change</code> event, which
73
+ * dispatches the event only after the
74
+ * control loses focus, the ActionScript 3.0
75
+ * version of the <code>change</code> event
76
+ * is dispatched any time the control
77
+ * changes. For example, if a user types text
78
+ * into a text field, a <code>change</code>
79
+ * event is dispatched after every keystroke.
80
+ * @event link Dispatched when a user clicks a hyperlink
81
+ * in an HTML-enabled text field, where the
82
+ * URL begins with "event:". The remainder of
83
+ * the URL after "event:" is placed in the
84
+ * text property of the LINK event.
85
+ *
86
+ * <p><b>Note:</b> The default behavior,
87
+ * adding the text to the text field, occurs
88
+ * only when Flash Player generates the
89
+ * event, which in this case happens when a
90
+ * user attempts to input text. You cannot
91
+ * put text into a text field by sending it
92
+ * <code>textInput</code> events.</p>
93
+ * @event scroll Dispatched by a TextField object
94
+ * <i>after</i> the user scrolls.
95
+ * @event textInput Flash Player dispatches the
96
+ * <code>textInput</code> event when a user
97
+ * enters one or more characters of text.
98
+ * Various text input methods can generate
99
+ * this event, including standard keyboards,
100
+ * input method editors(IMEs), voice or
101
+ * speech recognition systems, and even the
102
+ * act of pasting plain text with no
103
+ * formatting or style information.
104
+ * @event textInteractionModeChange Flash Player dispatches the
105
+ * <code>textInteractionModeChange</code>
106
+ * event when a user changes the interaction
107
+ * mode of a text field. for example on
108
+ * Android, one can toggle from NORMAL mode
109
+ * to SELECTION mode using context menu
110
+ * options
111
+ */
112
+ export declare class TextField extends DisplayObjectContainer {
113
+ private _onClipboardPasteDelegate;
114
+ private static _textFields;
115
+ static assetType: string;
116
+ static getNewTextField(): TextField;
117
+ static clearPool(): void;
118
+ private static _onChangedEvent;
119
+ textOffsetX: number;
120
+ textOffsetY: number;
121
+ private _width;
122
+ private _height;
123
+ private _graphics;
124
+ private _bottomScrollV;
125
+ private _caretIndex;
126
+ private _maxScrollH;
127
+ private _maxScrollV;
128
+ private _numLines;
129
+ private _selectionBeginIndex;
130
+ private _selectionEndIndex;
131
+ private _biggestLine;
132
+ /**
133
+ * Renderable text, used for computing a glyphs
134
+ * @private
135
+ */
136
+ private _iText;
137
+ /**
138
+ * Place where is diff is begun to end
139
+ * @private
140
+ */
141
+ private _iTextDiffStart;
142
+ /**
143
+ * Original text passed to field
144
+ * @private
145
+ */
146
+ private _text;
147
+ private _iTextWoLineBreaks;
148
+ private _textInteractionMode;
149
+ private _textWidth;
150
+ private _textHeight;
151
+ private _charBoundaries;
152
+ private _firstCharInParagraph;
153
+ private _imageReference;
154
+ private _lineMetrics;
155
+ private _paragraphLength;
156
+ _textFormat: TextFormat;
157
+ _newTextFormat: TextFormat;
158
+ _textFormats: TextFormat[];
159
+ _textFormatsIdx: number[];
160
+ textShapes: StringMap<TextShape>;
161
+ private inMaskMode;
162
+ private maskChild;
163
+ private textChild;
164
+ private targetGraphics;
165
+ private cursorShape;
166
+ private bgShapeSelect;
167
+ private cursorIntervalID;
168
+ cursorBlinking: boolean;
169
+ showSelection: boolean;
170
+ _textDirty: Boolean;
171
+ _positionsDirty: Boolean;
172
+ _glyphsDirty: Boolean;
173
+ _shapesDirty: Boolean;
174
+ _textShapesDirty: Boolean;
175
+ chars_codes: number[];
176
+ chars_width: number[];
177
+ tf_per_char: TextFormat[];
178
+ words: WordStore;
179
+ _lastWordsCount: number;
180
+ private _textRuns_formats;
181
+ private _textRuns_words;
182
+ private _paragraph_textRuns_indices;
183
+ private _maxWidthLine;
184
+ private _labelData;
185
+ html: boolean;
186
+ private lines_wordStartIndices;
187
+ private lines_wordEndIndices;
188
+ private lines_start_y;
189
+ private lines_start_x;
190
+ private lines_charIdx_start;
191
+ private lines_charIdx_end;
192
+ private lines_width;
193
+ private lines_height;
194
+ private lines_numSpacesPerline;
195
+ private char_positions_x;
196
+ private char_positions_y;
197
+ sourceTextField: TextField;
198
+ private _maskWidth;
199
+ private _maskHeight;
200
+ private _maskTextOffsetX;
201
+ private _maskTextOffsetY;
202
+ bgShape: Shape;
203
+ isStatic: boolean;
204
+ updateMaskMode(): void;
205
+ getMouseCursor(): string;
206
+ get isInFocus(): boolean;
207
+ set isInFocus(value: boolean);
208
+ setFocus(value: boolean, fromMouseDown?: boolean, sendSoftKeyEvent?: boolean): void;
209
+ private enableInput;
210
+ findCharIdxForMouse(event: MouseEvent): number;
211
+ private startSelectionByMouseDelegate;
212
+ private startSelectionByMouse;
213
+ private stopSelectionByMouseDelegate;
214
+ private stopSelectionByMouse;
215
+ private updateSelectionByMouseDelegate;
216
+ private updateSelectionByMouse;
217
+ private drawSelectionGraphics;
218
+ private scrollToCursor;
219
+ private drawCursor;
220
+ private drawSelectedBG;
221
+ drawBG(): void;
222
+ drawBorder(): void;
223
+ getTextShapeForIdentifierAndFormat(id: string, format: TextFormat): TextShape;
224
+ /**
225
+ * When set to <code>true</code> and the text field is not in focus, Flash
226
+ * Player highlights the selection in the text field in gray. When set to
227
+ * <code>false</code> and the text field is not in focus, Flash Player does
228
+ * not highlight the selection in the text field.
229
+ *
230
+ * @default false
231
+ */
232
+ alwaysShowSelection: boolean;
233
+ /**
234
+ * The type of anti-aliasing used for this text field. Use
235
+ * <code>flash.text.AntiAliasType</code> constants for this property. You can
236
+ * control this setting only if the font is embedded(with the
237
+ * <code>embedFonts</code> property set to <code>true</code>). The default
238
+ * setting is <code>flash.text.AntiAliasType.NORMAL</code>.
239
+ *
240
+ * <p>To set values for this property, use the following string values:</p>
241
+ */
242
+ antiAliasType: AntiAliasType;
243
+ /**
244
+ * Controls automatic sizing and alignment of text fields. Acceptable values
245
+ * for the <code>TextFieldAutoSize</code> constants:
246
+ * <code>TextFieldAutoSize.NONE</code>(the default),
247
+ * <code>TextFieldAutoSize.LEFT</code>, <code>TextFieldAutoSize.RIGHT</code>,
248
+ * and <code>TextFieldAutoSize.CENTER</code>.
249
+ *
250
+ * <p>If <code>autoSize</code> is set to <code>TextFieldAutoSize.NONE</code>
251
+ * (the default) no resizing occurs.</p>
252
+ *
253
+ * <p>If <code>autoSize</code> is set to <code>TextFieldAutoSize.LEFT</code>,
254
+ * the text is treated as left-justified text, meaning that the left margin
255
+ * of the text field remains fixed and any resizing of a single line of the
256
+ * text field is on the right margin. If the text includes a line break(for
257
+ * example, <code>"\n"</code> or <code>"\r"</code>), the bottom is also
258
+ * resized to fit the next line of text. If <code>wordWrap</code> is also set
259
+ * to <code>true</code>, only the bottom of the text field is resized and the
260
+ * right side remains fixed.</p>
261
+ *
262
+ * <p>If <code>autoSize</code> is set to
263
+ * <code>TextFieldAutoSize.RIGHT</code>, the text is treated as
264
+ * right-justified text, meaning that the right margin of the text field
265
+ * remains fixed and any resizing of a single line of the text field is on
266
+ * the left margin. If the text includes a line break(for example,
267
+ * <code>"\n" or "\r")</code>, the bottom is also resized to fit the next
268
+ * line of text. If <code>wordWrap</code> is also set to <code>true</code>,
269
+ * only the bottom of the text field is resized and the left side remains
270
+ * fixed.</p>
271
+ *
272
+ * <p>If <code>autoSize</code> is set to
273
+ * <code>TextFieldAutoSize.CENTER</code>, the text is treated as
274
+ * center-justified text, meaning that any resizing of a single line of the
275
+ * text field is equally distributed to both the right and left margins. If
276
+ * the text includes a line break(for example, <code>"\n"</code> or
277
+ * <code>"\r"</code>), the bottom is also resized to fit the next line of
278
+ * text. If <code>wordWrap</code> is also set to <code>true</code>, only the
279
+ * bottom of the text field is resized and the left and right sides remain
280
+ * fixed.</p>
281
+ *
282
+ * @throws ArgumentError The <code>autoSize</code> specified is not a member
283
+ * of flash.text.TextFieldAutoSize.
284
+ */
285
+ private _autoSize;
286
+ get autoSize(): string;
287
+ set autoSize(value: string);
288
+ private _internalScale;
289
+ get internalScale(): Vector3D;
290
+ _iInternalUpdate(): void;
291
+ /**
292
+ *
293
+ * @returns {string}
294
+ */
295
+ get assetType(): string;
296
+ /**
297
+ * Specifies whether the text field has a background fill. If
298
+ * <code>true</code>, the text field has a background fill. If
299
+ * <code>false</code>, the text field has no background fill. Use the
300
+ * <code>backgroundColor</code> property to set the background color of a
301
+ * text field.
302
+ *
303
+ * @default false
304
+ */
305
+ private _background;
306
+ get background(): boolean;
307
+ set background(value: boolean);
308
+ /**
309
+ * The color of the text field background. The default value is
310
+ * <code>0xFFFFFF</code>(white). This property can be retrieved or set, even
311
+ * if there currently is no background, but the color is visible only if the
312
+ * text field has the <code>background</code> property set to
313
+ * <code>true</code>.
314
+ */
315
+ private _backgroundColor;
316
+ get backgroundColor(): number;
317
+ set backgroundColor(value: number);
318
+ /**
319
+ * Specifies whether the text field has a border. If <code>true</code>, the
320
+ * text field has a border. If <code>false</code>, the text field has no
321
+ * border. Use the <code>borderColor</code> property to set the border color.
322
+ *
323
+ * @default false
324
+ */
325
+ private _border;
326
+ get border(): boolean;
327
+ set border(value: boolean);
328
+ /**
329
+ * The color of the text field border. The default value is
330
+ * <code>0x000000</code>(black). This property can be retrieved or set, even
331
+ * if there currently is no border, but the color is visible only if the text
332
+ * field has the <code>border</code> property set to <code>true</code>.
333
+ */
334
+ private _borderColor;
335
+ get borderColor(): number;
336
+ set borderColor(value: number);
337
+ /**
338
+ * An integer(1-based index) that indicates the bottommost line that is
339
+ * currently visible in the specified text field. Think of the text field as
340
+ * a window onto a block of text. The <code>scrollV</code> property is the
341
+ * 1-based index of the topmost visible line in the window.
342
+ *
343
+ * <p>All the text between the lines indicated by <code>scrollV</code> and
344
+ * <code>bottomScrollV</code> is currently visible in the text field.</p>
345
+ */
346
+ get bottomScrollV(): number;
347
+ set bottomScrollV(value: number);
348
+ /**
349
+ * The index of the insertion point(caret) position. If no insertion point
350
+ * is displayed, the value is the position the insertion point would be if
351
+ * you restored focus to the field(typically where the insertion point last
352
+ * was, or 0 if the field has not had focus).
353
+ *
354
+ * <p>Selection span indexes are zero-based(for example, the first position
355
+ * is 0, the second position is 1, and so on).</p>
356
+ */
357
+ get caretIndex(): number;
358
+ /**
359
+ * A Boolean value that specifies whether extra white space(spaces, line
360
+ * breaks, and so on) in a text field with HTML text is removed. The default
361
+ * value is <code>false</code>. The <code>condenseWhite</code> property only
362
+ * affects text set with the <code>htmlText</code> property, not the
363
+ * <code>text</code> property. If you set text with the <code>text</code>
364
+ * property, <code>condenseWhite</code> is ignored.
365
+ *
366
+ * <p>If <code>condenseWhite</code> is set to <code>true</code>, use standard
367
+ * HTML commands such as <code><BR></code> and <code><P></code> to place line
368
+ * breaks in the text field.</p>
369
+ *
370
+ * <p>Set the <code>condenseWhite</code> property before setting the
371
+ * <code>htmlText</code> property.</p>
372
+ */
373
+ condenseWhite: boolean;
374
+ /**
375
+ * Specifies the format applied to newly inserted text, such as text entered
376
+ * by a user or text inserted with the <code>replaceSelectedText()</code>
377
+ * method.
378
+ *
379
+ * <p><b>Note:</b> When selecting characters to be replaced with
380
+ * <code>setSelection()</code> and <code>replaceSelectedText()</code>, the
381
+ * <code>defaultTextFormat</code> will be applied only if the text has been
382
+ * selected up to and including the last character. Here is an example:</p>
383
+ * <pre xml:space="preserve"> public my_txt:TextField new TextField();
384
+ * my_txt.text = "Flash Macintosh version"; public my_fmt:TextFormat = new
385
+ * TextFormat(); my_fmt.color = 0xFF0000; my_txt.defaultTextFormat = my_fmt;
386
+ * my_txt.setSelection(6,15); // partial text selected - defaultTextFormat
387
+ * not applied my_txt.setSelection(6,23); // text selected to end -
388
+ * defaultTextFormat applied my_txt.replaceSelectedText("Windows version");
389
+ * </pre>
390
+ *
391
+ * <p>When you access the <code>defaultTextFormat</code> property, the
392
+ * returned TextFormat object has all of its properties defined. No property
393
+ * is <code>null</code>.</p>
394
+ *
395
+ * <p><b>Note:</b> You can't set this property if a style sheet is applied to
396
+ * the text field.</p>
397
+ *
398
+ * @throws Error This method cannot be used on a text field with a style
399
+ * sheet.
400
+ */
401
+ /**
402
+ * Specifies whether the text field is a password text field. If the value of
403
+ * this property is <code>true</code>, the text field is treated as a
404
+ * password text field and hides the input characters using asterisks instead
405
+ * of the actual characters. If <code>false</code>, the text field is not
406
+ * treated as a password text field. When password mode is enabled, the Cut
407
+ * and Copy commands and their corresponding keyboard shortcuts will not
408
+ * function. This security mechanism prevents an unscrupulous user from using
409
+ * the shortcuts to discover a password on an unattended computer.
410
+ *
411
+ * @default false
412
+ */
413
+ displayAsPassword: boolean;
414
+ /**
415
+ * Specifies whether to render by using embedded font outlines. If
416
+ * <code>false</code>, Flash Player renders the text field by using device
417
+ * fonts.
418
+ *
419
+ * <p>If you set the <code>embedFonts</code> property to <code>true</code>
420
+ * for a text field, you must specify a font for that text by using the
421
+ * <code>font</code> property of a TextFormat object applied to the text
422
+ * field. If the specified font is not embedded in the SWF file, the text is
423
+ * not displayed.</p>
424
+ *
425
+ * @default false
426
+ */
427
+ embedFonts: boolean;
428
+ /**
429
+ * The type of grid fitting used for this text field. This property applies
430
+ * only if the <code>flash.text.AntiAliasType</code> property of the text
431
+ * field is set to <code>flash.text.AntiAliasType.ADVANCED</code>.
432
+ *
433
+ * <p>The type of grid fitting used determines whether Flash Player forces
434
+ * strong horizontal and vertical lines to fit to a pixel or subpixel grid,
435
+ * or not at all.</p>
436
+ *
437
+ * <p>For the <code>flash.text.GridFitType</code> property, you can use the
438
+ * following string values:</p>
439
+ *
440
+ * @default pixel
441
+ */
442
+ gridFitType: GridFitType;
443
+ /**
444
+ *
445
+ */
446
+ get height(): number;
447
+ set height(val: number);
448
+ /**
449
+ * Contains the HTML representation of the text field contents.
450
+ *
451
+ * <p>Flash Player supports the following HTML tags:</p>
452
+ *
453
+ * <p>Flash Player and AIR also support explicit character codes, such as
454
+ * &#38;(ASCII ampersand) and &#x20AC;(Unicode € symbol). </p>
455
+ */
456
+ private _htmlText;
457
+ get htmlText(): string;
458
+ set htmlText(value: string);
459
+ /**
460
+ * The number of characters in a text field. A character such as tab
461
+ * (<code>\t</code>) counts as one character.
462
+ */
463
+ get length(): number;
464
+ /**
465
+ * The maximum number of characters that the text field can contain, as
466
+ * entered by a user. A script can insert more text than
467
+ * <code>maxChars</code> allows; the <code>maxChars</code> property indicates
468
+ * only how much text a user can enter. If the value of this property is
469
+ * <code>0</code>, a user can enter an unlimited amount of text.
470
+ *
471
+ * @default 0
472
+ */
473
+ maxChars: number;
474
+ /**
475
+ * The maximum value of <code>scrollH</code>.
476
+ */
477
+ get maxScrollH(): number;
478
+ /**
479
+ * The maximum value of <code>scrollV</code>.
480
+ */
481
+ get maxScrollV(): number;
482
+ /**
483
+ * A Boolean value that indicates whether Flash Player automatically scrolls
484
+ * multiline text fields when the user clicks a text field and rolls the
485
+ * mouse wheel. By default, this value is <code>true</code>. This property is
486
+ * useful if you want to prevent mouse wheel scrolling of text fields, or
487
+ * implement your own text field scrolling.
488
+ */
489
+ mouseWheelEnabled: boolean;
490
+ /**
491
+ * Indicates whether field is a multiline text field. If the value is
492
+ * <code>true</code>, the text field is multiline; if the value is
493
+ * <code>false</code>, the text field is a single-line text field. In a field
494
+ * of type <code>TextFieldType.INPUT</code>, the <code>multiline</code> value
495
+ * determines whether the <code>Enter</code> key creates a new line(a value
496
+ * of <code>false</code>, and the <code>Enter</code> key is ignored). If you
497
+ * paste text into a <code>TextField</code> with a <code>multiline</code>
498
+ * value of <code>false</code>, newlines are stripped out of the text.
499
+ *
500
+ * @default false
501
+ */
502
+ multiline: boolean;
503
+ /**
504
+ * Defines the number of text lines in a multiline text field. If
505
+ * <code>wordWrap</code> property is set to <code>true</code>, the number of
506
+ * lines increases when text wraps.
507
+ */
508
+ get numLines(): number;
509
+ /**
510
+ * Indicates the set of characters that a user can enter into the text field.
511
+ * If the value of the <code>restrict</code> property is <code>null</code>,
512
+ * you can enter any character. If the value of the <code>restrict</code>
513
+ * property is an empty string, you cannot enter any character. If the value
514
+ * of the <code>restrict</code> property is a string of characters, you can
515
+ * enter only characters in the string into the text field. The string is
516
+ * scanned from left to right. You can specify a range by using the hyphen
517
+ * (-) character. Only user interaction is restricted; a script can put any
518
+ * text into the text field. <ph outputclass="flashonly">This property does
519
+ * not synchronize with the Embed font options in the Property inspector.
520
+ *
521
+ * <p>If the string begins with a caret(^) character, all characters are
522
+ * initially accepted and succeeding characters in the string are excluded
523
+ * from the set of accepted characters. If the string does not begin with a
524
+ * caret(^) character, no characters are initially accepted and succeeding
525
+ * characters in the string are included in the set of accepted
526
+ * characters.</p>
527
+ *
528
+ * <p>The following example allows only uppercase characters, spaces, and
529
+ * numbers to be entered into a text field:</p>
530
+ * <pre xml:space="preserve"> my_txt.restrict = "A-Z 0-9"; </pre>
531
+ *
532
+ * <p>The following example includes all characters, but excludes lowercase
533
+ * letters:</p>
534
+ * <pre xml:space="preserve"> my_txt.restrict = "^a-z"; </pre>
535
+ *
536
+ * <p>You can use a backslash to enter a ^ or - verbatim. The accepted
537
+ * backslash sequences are \-, \^ or \\. The backslash must be an actual
538
+ * character in the string, so when specified in ActionScript, a double
539
+ * backslash must be used. For example, the following code includes only the
540
+ * dash(-) and caret(^):</p>
541
+ * <pre xml:space="preserve"> my_txt.restrict = "\\-\\^"; </pre>
542
+ *
543
+ * <p>The ^ can be used anywhere in the string to toggle between including
544
+ * characters and excluding characters. The following code includes only
545
+ * uppercase letters, but excludes the uppercase letter Q:</p>
546
+ * <pre xml:space="preserve"> my_txt.restrict = "A-Z^Q"; </pre>
547
+ *
548
+ * <p>You can use the <code>\u</code> escape sequence to construct
549
+ * <code>restrict</code> strings. The following code includes only the
550
+ * characters from ASCII 32(space) to ASCII 126(tilde).</p>
551
+ * <pre xml:space="preserve"> my_txt.restrict = "\u0020-\u007E"; </pre>
552
+ *
553
+ * @default null
554
+ */
555
+ _restrict: string;
556
+ _restrictRegex: RegExp;
557
+ get restrict(): string;
558
+ set restrict(value: string);
559
+ /**
560
+ * The current horizontal scrolling position. If the <code>scrollH</code>
561
+ * property is 0, the text is not horizontally scrolled. This property value
562
+ * is an integer that represents the horizontal position in pixels.
563
+ *
564
+ * <p>The units of horizontal scrolling are pixels, whereas the units of
565
+ * vertical scrolling are lines. Horizontal scrolling is measured in pixels
566
+ * because most fonts you typically use are proportionally spaced; that is,
567
+ * the characters can have different widths. Flash Player performs vertical
568
+ * scrolling by line because users usually want to see a complete line of
569
+ * text rather than a partial line. Even if a line uses multiple fonts, the
570
+ * height of the line adjusts to fit the largest font in use.</p>
571
+ *
572
+ * <p><b>Note: </b>The <code>scrollH</code> property is zero-based, not
573
+ * 1-based like the <code>scrollV</code> vertical scrolling property.</p>
574
+ */
575
+ private _scrollH;
576
+ get scrollH(): number;
577
+ set scrollH(value: number);
578
+ /**
579
+ * The vertical position of text in a text field. The <code>scrollV</code>
580
+ * property is useful for directing users to a specific paragraph in a long
581
+ * passage, or creating scrolling text fields.
582
+ *
583
+ * <p>The units of vertical scrolling are lines, whereas the units of
584
+ * horizontal scrolling are pixels. If the first line displayed is the first
585
+ * line in the text field, scrollV is set to 1(not 0). Horizontal scrolling
586
+ * is measured in pixels because most fonts are proportionally spaced; that
587
+ * is, the characters can have different widths. Flash performs vertical
588
+ * scrolling by line because users usually want to see a complete line of
589
+ * text rather than a partial line. Even if there are multiple fonts on a
590
+ * line, the height of the line adjusts to fit the largest font in use.</p>
591
+ */
592
+ _scrollV: number;
593
+ get scrollV(): number;
594
+ set scrollV(value: number);
595
+ /**
596
+ * A Boolean value that indicates whether the text field is selectable. The
597
+ * value <code>true</code> indicates that the text is selectable. The
598
+ * <code>selectable</code> property controls whether a text field is
599
+ * selectable, not whether a text field is editable. A dynamic text field can
600
+ * be selectable even if it is not editable. If a dynamic text field is not
601
+ * selectable, the user cannot select its text.
602
+ *
603
+ * <p>If <code>selectable</code> is set to <code>false</code>, the text in
604
+ * the text field does not respond to selection commands from the mouse or
605
+ * keyboard, and the text cannot be copied with the Copy command. If
606
+ * <code>selectable</code> is set to <code>true</code>, the text in the text
607
+ * field can be selected with the mouse or keyboard, and the text can be
608
+ * copied with the Copy command. You can select text this way even if the
609
+ * text field is a dynamic text field instead of an input text field. </p>
610
+ *
611
+ * @default true
612
+ */
613
+ private _selectable;
614
+ get selectable(): boolean;
615
+ set selectable(value: boolean);
616
+ /**
617
+ * The zero-based character index value of the first character in the current
618
+ * selection. For example, the first character is 0, the second character is
619
+ * 1, and so on. If no text is selected, this property is the value of
620
+ * <code>caretIndex</code>.
621
+ */
622
+ get selectionBeginIndex(): number;
623
+ /**
624
+ * The zero-based character index value of the last character in the current
625
+ * selection. For example, the first character is 0, the second character is
626
+ * 1, and so on. If no text is selected, this property is the value of
627
+ * <code>caretIndex</code>.
628
+ */
629
+ get selectionEndIndex(): number;
630
+ /**
631
+ * The sharpness of the glyph edges in this text field. This property applies
632
+ * only if the <code>flash.text.AntiAliasType</code> property of the text
633
+ * field is set to <code>flash.text.AntiAliasType.ADVANCED</code>. The range
634
+ * for <code>sharpness</code> is a number from -400 to 400. If you attempt to
635
+ * set <code>sharpness</code> to a value outside that range, Flash sets the
636
+ * property to the nearest value in the range(either -400 or 400).
637
+ *
638
+ * @default 0
639
+ */
640
+ sharpness: number;
641
+ /**
642
+ * Attaches a style sheet to the text field. For information on creating
643
+ * style sheets, see the StyleSheet class and the <i>ActionScript 3.0
644
+ * Developer's Guide</i>.
645
+ *
646
+ * <p>You can change the style sheet associated with a text field at any
647
+ * time. If you change the style sheet in use, the text field is redrawn with
648
+ * the new style sheet. You can set the style sheet to <code>null</code> or
649
+ * <code>undefined</code> to remove the style sheet. If the style sheet in
650
+ * use is removed, the text field is redrawn without a style sheet. </p>
651
+ *
652
+ * <p><b>Note:</b> If the style sheet is removed, the contents of both
653
+ * <code>TextField.text</code> and <code> TextField.htmlText</code> change to
654
+ * incorporate the formatting previously applied by the style sheet. To
655
+ * preserve the original <code>TextField.htmlText</code> contents without the
656
+ * formatting, save the value in a variable before removing the style
657
+ * sheet.</p>
658
+ */
659
+ styleSheet: StyleSheet;
660
+ /**
661
+ * A string that is the current text in the text field. Lines are separated
662
+ * by the carriage return character(<code>'\r'</code>, ASCII 13). This
663
+ * property contains unformatted text in the text field, without HTML tags.
664
+ *
665
+ * <p>To get the text in HTML form, use the <code>htmlText</code>
666
+ * property.</p>
667
+ */
668
+ get text(): string;
669
+ set text(value: string);
670
+ setLabelData(labelData: any): void;
671
+ get newTextFormat(): TextFormat;
672
+ set newTextFormat(value: TextFormat);
673
+ get textFormat(): TextFormat;
674
+ set textFormat(value: TextFormat);
675
+ /**
676
+ * Indicates the horizontal scale(percentage) of the object as applied from
677
+ * the registration point. The default registration point is(0,0). 1.0
678
+ * equals 100% scale.
679
+ *
680
+ * <p>Scaling the local coordinate system changes the <code>x</code> and
681
+ * <code>y</code> property values, which are defined in whole pixels. </p>
682
+ */
683
+ get scaleX(): number;
684
+ set scaleX(val: number);
685
+ /**
686
+ * Indicates the vertical scale(percentage) of an object as applied from the
687
+ * registration point of the object. The default registration point is(0,0).
688
+ * 1.0 is 100% scale.
689
+ *
690
+ * <p>Scaling the local coordinate system changes the <code>x</code> and
691
+ * <code>y</code> property values, which are defined in whole pixels. </p>
692
+ */
693
+ get scaleY(): number;
694
+ set scaleY(val: number);
695
+ /**
696
+ * The color of the text in a text field, in hexadecimal format. The
697
+ * hexadecimal color system uses six digits to represent color values. Each
698
+ * digit has 16 possible values or characters. The characters range from 0-9
699
+ * and then A-F. For example, black is <code>0x000000</code>; white is
700
+ * <code>0xFFFFFF</code>.
701
+ *
702
+ * @default 0(0x000000)
703
+ */
704
+ _textColor: number;
705
+ get textColor(): number;
706
+ set textColor(value: number);
707
+ private getTextColorForTextFormat;
708
+ /**
709
+ * The interaction mode property, Default value is
710
+ * TextInteractionMode.NORMAL. On mobile platforms, the normal mode implies
711
+ * that the text can be scrolled but not selected. One can switch to the
712
+ * selectable mode through the in-built context menu on the text field. On
713
+ * Desktop, the normal mode implies that the text is in scrollable as well as
714
+ * selection mode.
715
+ */
716
+ get textInteractionMode(): TextInteractionMode;
717
+ /**
718
+ * The width of the text in pixels.
719
+ */
720
+ get textWidth(): number;
721
+ /**
722
+ * The width of the text in pixels.
723
+ */
724
+ get textHeight(): number;
725
+ /**
726
+ * The thickness of the glyph edges in this text field. This property applies
727
+ * only when <code>AntiAliasType</code> is set to
728
+ * <code>AntiAliasType.ADVANCED</code>.
729
+ *
730
+ * <p>The range for <code>thickness</code> is a number from -200 to 200. If
731
+ * you attempt to set <code>thickness</code> to a value outside that range,
732
+ * the property is set to the nearest value in the range(either -200 or
733
+ * 200).</p>
734
+ *
735
+ * @default 0
736
+ */
737
+ thickness: number;
738
+ /**
739
+ * The type of the text field. Either one of the following TextFieldType
740
+ * constants: <code>TextFieldType.DYNAMIC</code>, which specifies a dynamic
741
+ * text field, which a user cannot edit, or <code>TextFieldType.INPUT</code>,
742
+ * which specifies an input text field, which a user can edit.
743
+ *
744
+ * @default dynamic
745
+ * @throws ArgumentError The <code>type</code> specified is not a member of
746
+ * flash.text.TextFieldType.
747
+ */
748
+ _type: TextFieldType;
749
+ get type(): TextFieldType;
750
+ set type(value: TextFieldType);
751
+ /**
752
+ * Specifies whether to copy and paste the text formatting along with the
753
+ * text. When set to <code>true</code>, Flash Player copies and pastes
754
+ * formatting(such as alignment, bold, and italics) when you copy and paste
755
+ * between text fields. Both the origin and destination text fields for the
756
+ * copy and paste procedure must have <code>useRichTextClipboard</code> set
757
+ * to <code>true</code>. The default value is <code>false</code>.
758
+ */
759
+ useRichTextClipboard: boolean;
760
+ /**
761
+ * A Boolean value that indicates whether the text field has word wrap. If
762
+ * the value of <code>wordWrap</code> is <code>true</code>, the text field
763
+ * has word wrap; if the value is <code>false</code>, the text field does not
764
+ * have word wrap. The default value is <code>false</code>.
765
+ */
766
+ _wordWrap: boolean;
767
+ get x(): number;
768
+ set x(val: number);
769
+ /**
770
+ *
771
+ */
772
+ get width(): number;
773
+ set width(val: number);
774
+ set wordWrap(val: boolean);
775
+ /**
776
+ * The width of the text in pixels.
777
+ */
778
+ get wordWrap(): boolean;
779
+ /**
780
+ * Creates a new TextField instance. After you create the TextField instance,
781
+ * call the <code>addChild()</code> or <code>addChildAt()</code> method of
782
+ * the parent DisplayObjectContainer object to add the TextField instance to
783
+ * the display list.
784
+ *
785
+ * <p>The default size for a text field is 100 x 100 pixels.</p>
786
+ */
787
+ constructor();
788
+ advanceFrame(): void;
789
+ getEntity(): IPartitionEntity;
790
+ clear(): void;
791
+ /**
792
+ * @inheritDoc
793
+ */
794
+ dispose(): void;
795
+ /**
796
+ * @inheritDoc
797
+ */
798
+ disposeValues(): void;
799
+ /**
800
+ * Reconstructs the Graphics for this Text-field.
801
+ */
802
+ reConstruct(buildGraphics?: boolean): void;
803
+ reset(): void;
804
+ private onClipboardPaste;
805
+ private _resetParagraph;
806
+ private buildParagraphs;
807
+ private adjustPositionForAutoSize;
808
+ private getWordPositions;
809
+ staticMatrix: any;
810
+ private buildGlyphsForLabelData;
811
+ private buildGlyphs;
812
+ private buildShapes;
813
+ /**
814
+ * Appends the string specified by the <code>newText</code> parameter to the
815
+ * end of the text of the text field. This method is more efficient than an
816
+ * addition assignment(<code>+=</code>) on a <code>text</code> property
817
+ * (such as <code>someTextField.text += moreText</code>), particularly for a
818
+ * text field that contains a significant amount of content.
819
+ *
820
+ * @param newText The string to append to the existing text.
821
+ */
822
+ appendText(newText: string): void;
823
+ /**
824
+ * *tells the Textfield that a paragraph is defined completly.
825
+ * e.g. the textfield will start a new line for future added text.
826
+ */
827
+ closeParagraph(): void;
828
+ /**
829
+ * Returns a rectangle that is the bounding box of the character.
830
+ *
831
+ * @param charIndex The zero-based index value for the character(for
832
+ * example, the first position is 0, the second position is
833
+ * 1, and so on).
834
+ * @return A rectangle with <code>x</code> and <code>y</code> minimum and
835
+ * maximum values defining the bounding box of the character.
836
+ */
837
+ getCharBoundaries(charIndex: number): Rectangle;
838
+ /**
839
+ * Returns the zero-based index value of the character at the point specified
840
+ * by the <code>x</code> and <code>y</code> parameters.
841
+ *
842
+ * @param x The <i>x</i> coordinate of the character.
843
+ * @param y The <i>y</i> coordinate of the character.
844
+ * @return The zero-based index value of the character(for example, the
845
+ * first position is 0, the second position is 1, and so on). Returns
846
+ * -1 if the point is not over any character.
847
+ */
848
+ getCharIndexAtPoint(x: number, y: number, lineIdx?: number): number;
849
+ /**
850
+ * Given a character index, returns the index of the first character in the
851
+ * same paragraph.
852
+ *
853
+ * @param charIndex The zero-based index value of the character(for example,
854
+ * the first character is 0, the second character is 1, and
855
+ * so on).
856
+ * @return The zero-based index value of the first character in the same
857
+ * paragraph.
858
+ * @throws RangeError The character index specified is out of range.
859
+ */
860
+ getFirstCharInParagraph(charIndex: number): number;
861
+ /**
862
+ * Returns a DisplayObject reference for the given <code>id</code>, for an
863
+ * image or SWF file that has been added to an HTML-formatted text field by
864
+ * using an <code><img></code> tag. The <code><img></code> tag is in the
865
+ * following format:
866
+ *
867
+ * <p><pre xml:space="preserve"><code> <img src = 'filename.jpg' id =
868
+ * 'instanceName' ></code></pre></p>
869
+ *
870
+ * @param id The <code>id</code> to match(in the <code>id</code> attribute
871
+ * of the <code><img></code> tag).
872
+ * @return The display object corresponding to the image or SWF file with the
873
+ * matching <code>id</code> attribute in the <code><img></code> tag
874
+ * of the text field. For media loaded from an external source, this
875
+ * object is a Loader object, and, once loaded, the media object is a
876
+ * child of that Loader object. For media embedded in the SWF file,
877
+ * it is the loaded object. If no <code><img></code> tag with the
878
+ * matching <code>id</code> exists, the method returns
879
+ * <code>null</code>.
880
+ */
881
+ getImageReference(id: string): DisplayObject;
882
+ /**
883
+ * Returns the zero-based index value of the line at the point specified by
884
+ * the <code>x</code> and <code>y</code> parameters.
885
+ *
886
+ * @param x The <i>x</i> coordinate of the line.
887
+ * @param y The <i>y</i> coordinate of the line.
888
+ * @return The zero-based index value of the line(for example, the first
889
+ * line is 0, the second line is 1, and so on). Returns -1 if the
890
+ * point is not over any line.
891
+ */
892
+ getLineIndexAtPoint(x: number, y: number): number;
893
+ /**
894
+ * Returns the zero-based index value of the line containing the character
895
+ * specified by the <code>charIndex</code> parameter.
896
+ *
897
+ * @param charIndex The zero-based index value of the character(for example,
898
+ * the first character is 0, the second character is 1, and
899
+ * so on).
900
+ * @return The zero-based index value of the line.
901
+ * @throws RangeError The character index specified is out of range.
902
+ */
903
+ getLineIndexOfChar(charIndex: number): number;
904
+ /**
905
+ * Returns the number of characters in a specific text line.
906
+ *
907
+ * @param lineIndex The line number for which you want the length.
908
+ * @return The number of characters in the line.
909
+ * @throws RangeError The line number specified is out of range.
910
+ */
911
+ getLineLength(lineIndex: number): number;
912
+ /**
913
+ * Returns metrics information about a given text line.
914
+ *
915
+ * @param lineIndex The line number for which you want metrics information.
916
+ * @return A TextLineMetrics object.
917
+ * @throws RangeError The line number specified is out of range.
918
+ */
919
+ getLineMetrics(lineIndex: number): TextLineMetrics;
920
+ /**
921
+ * Returns the character index of the first character in the line that the
922
+ * <code>lineIndex</code> parameter specifies.
923
+ *
924
+ * @param lineIndex The zero-based index value of the line(for example, the
925
+ * first line is 0, the second line is 1, and so on).
926
+ * @return The zero-based index value of the first character in the line.
927
+ * @throws RangeError The line number specified is out of range.
928
+ */
929
+ getLineOffset(lineIndex: number): number;
930
+ /**
931
+ * Returns the text of the line specified by the <code>lineIndex</code>
932
+ * parameter.
933
+ *
934
+ * @param lineIndex The zero-based index value of the line(for example, the
935
+ * first line is 0, the second line is 1, and so on).
936
+ * @return The text string contained in the specified line.
937
+ * @throws RangeError The line number specified is out of range.
938
+ */
939
+ getLineText(lineIndex: number): string;
940
+ /**
941
+ * Given a character index, returns the length of the paragraph containing
942
+ * the given character. The length is relative to the first character in the
943
+ * paragraph(as returned by <code>getFirstCharInParagraph()</code>), not to
944
+ * the character index passed in.
945
+ *
946
+ * @param charIndex The zero-based index value of the character(for example,
947
+ * the first character is 0, the second character is 1, and
948
+ * so on).
949
+ * @return Returns the number of characters in the paragraph.
950
+ * @throws RangeError The character index specified is out of range.
951
+ */
952
+ getParagraphLength(charIndex: number): number;
953
+ /**
954
+ * Returns a TextFormat object that contains formatting information for the
955
+ * range of text that the <code>beginIndex</code> and <code>endIndex</code>
956
+ * parameters specify. Only properties that are common to the entire text
957
+ * specified are set in the resulting TextFormat object. Any property that is
958
+ * <i>mixed</i>, meaning that it has different values at different points in
959
+ * the text, has a value of <code>null</code>.
960
+ *
961
+ * <p>If you do not specify values for these parameters, this method is
962
+ * applied to all the text in the text field. </p>
963
+ *
964
+ * <p>The following table describes three possible usages:</p>
965
+ *
966
+ * @return The TextFormat object that represents the formatting properties
967
+ * for the specified text.
968
+ * @throws RangeError The <code>beginIndex</code> or <code>endIndex</code>
969
+ * specified is out of range.
970
+ */
971
+ getTextFormat(beginIndex?: number, endIndex?: number): TextFormat;
972
+ /**
973
+ * Replaces the current selection with the contents of the <code>value</code>
974
+ * parameter. The text is inserted at the position of the current selection,
975
+ * using the current default character format and default paragraph format.
976
+ * The text is not treated as HTML.
977
+ *
978
+ * <p>You can use the <code>replaceSelectedText()</code> method to insert and
979
+ * delete text without disrupting the character and paragraph formatting of
980
+ * the rest of the text.</p>
981
+ *
982
+ * <p><b>Note:</b> This method does not work if a style sheet is applied to
983
+ * the text field.</p>
984
+ *
985
+ * @param value The string to replace the currently selected text.
986
+ * @throws Error This method cannot be used on a text field with a style
987
+ * sheet.
988
+ */
989
+ replaceSelectedText(value: string): void;
990
+ /**
991
+ * Replaces the range of characters that the <code>beginIndex</code> and
992
+ * <code>endIndex</code> parameters specify with the contents of the
993
+ * <code>newText</code> parameter. As designed, the text from
994
+ * <code>beginIndex</code> to <code>endIndex-1</code> is replaced.
995
+ *
996
+ * <p><b>Note:</b> This method does not work if a style sheet is applied to
997
+ * the text field.</p>
998
+ *
999
+ * @param beginIndex The zero-based index value for the start position of the
1000
+ * replacement range.
1001
+ * @param endIndex The zero-based index position of the first character
1002
+ * after the desired text span.
1003
+ * @param newText The text to use to replace the specified range of
1004
+ * characters.
1005
+ * @throws Error This method cannot be used on a text field with a style
1006
+ * sheet.
1007
+ */
1008
+ replaceText(beginIndex: number, endIndex: number, newText: string): void;
1009
+ /**
1010
+ * Sets as selected the text designated by the index values of the first and
1011
+ * last characters, which are specified with the <code>beginIndex</code> and
1012
+ * <code>endIndex</code> parameters. If the two parameter values are the
1013
+ * same, this method sets the insertion point, as if you set the
1014
+ * <code>caretIndex</code> property.
1015
+ *
1016
+ * @param beginIndex The zero-based index value of the first character in the
1017
+ * selection(for example, the first character is 0, the
1018
+ * second character is 1, and so on).
1019
+ * @param endIndex The zero-based index value of the last character in the
1020
+ * selection.
1021
+ */
1022
+ setSelection(beginIndex: number, endIndex: number): void;
1023
+ /**
1024
+ * Applies the text formatting that the <code>format</code> parameter
1025
+ * specifies to the specified text in a text field. The value of
1026
+ * <code>format</code> must be a TextFormat object that specifies the desired
1027
+ * text formatting changes. Only the non-null properties of
1028
+ * <code>format</code> are applied to the text field. Any property of
1029
+ * <code>format</code> that is set to <code>null</code> is not applied. By
1030
+ * default, all of the properties of a newly created TextFormat object are
1031
+ * set to <code>null</code>.
1032
+ *
1033
+ * <p><b>Note:</b> This method does not work if a style sheet is applied to
1034
+ * the text field.</p>
1035
+ *
1036
+ * <p>The <code>setTextFormat()</code> method changes the text formatting
1037
+ * applied to a range of characters or to the entire body of text in a text
1038
+ * field. To apply the properties of format to all text in the text field, do
1039
+ * not specify values for <code>beginIndex</code> and <code>endIndex</code>.
1040
+ * To apply the properties of the format to a range of text, specify values
1041
+ * for the <code>beginIndex</code> and the <code>endIndex</code> parameters.
1042
+ * You can use the <code>length</code> property to determine the index
1043
+ * values.</p>
1044
+ *
1045
+ * <p>The two types of formatting information in a TextFormat object are
1046
+ * character level formatting and paragraph level formatting. Each character
1047
+ * in a text field can have its own character formatting settings, such as
1048
+ * font name, font size, bold, and italic.</p>
1049
+ *
1050
+ * <p>For paragraphs, the first character of the paragraph is examined for
1051
+ * the paragraph formatting settings for the entire paragraph. Examples of
1052
+ * paragraph formatting settings are left margin, right margin, and
1053
+ * indentation.</p>
1054
+ *
1055
+ * <p>Any text inserted manually by the user, or replaced by the
1056
+ * <code>replaceSelectedText()</code> method, receives the default text field
1057
+ * formatting for new text, and not the formatting specified for the text
1058
+ * insertion point. To set the default formatting for new text, use
1059
+ * <code>defaultTextFormat</code>.</p>
1060
+ *
1061
+ * @param format A TextFormat object that contains character and paragraph
1062
+ * formatting information.
1063
+ * @throws Error This method cannot be used on a text field with a style
1064
+ * sheet.
1065
+ * @throws RangeError The <code>beginIndex</code> or <code>endIndex</code>
1066
+ * specified is out of range.
1067
+ */
1068
+ setTextFormat(format: TextFormat, beginIndex?: number, endIndex?: number): void;
1069
+ /**
1070
+ * Returns true if an embedded font is available with the specified
1071
+ * <code>fontName</code> and <code>fontStyle</code> where
1072
+ * <code>Font.fontType</code> is <code>flash.text.FontType.EMBEDDED</code>.
1073
+ * Starting with Flash Player 10, two kinds of embedded fonts can appear in a
1074
+ * SWF file. Normal embedded fonts are only used with TextField objects. CFF
1075
+ * embedded fonts are only used with the flash.text.engine classes. The two
1076
+ * types are distinguished by the <code>fontType</code> property of the
1077
+ * <code>Font</code> class, as returned by the <code>enumerateFonts()</code>
1078
+ * function.
1079
+ *
1080
+ * <p>TextField cannot use a font of type <code>EMBEDDED_CFF</code>. If
1081
+ * <code>embedFonts</code> is set to <code>true</code> and the only font
1082
+ * available at run time with the specified name and style is of type
1083
+ * <code>EMBEDDED_CFF</code>, Flash Player fails to render the text, as if no
1084
+ * embedded font were available with the specified name and style.</p>
1085
+ *
1086
+ * <p>If both <code>EMBEDDED</code> and <code>EMBEDDED_CFF</code> fonts are
1087
+ * available with the same name and style, the <code>EMBEDDED</code> font is
1088
+ * selected and text renders with the <code>EMBEDDED</code> font.</p>
1089
+ *
1090
+ * @param fontName The name of the embedded font to check.
1091
+ * @param fontStyle Specifies the font style to check. Use
1092
+ * <code>flash.text.FontStyle</code>
1093
+ * @return <code>true</code> if a compatible embedded font is available,
1094
+ * otherwise <code>false</code>.
1095
+ * @throws ArgumentError The <code>fontStyle</code> specified is not a member
1096
+ * of <code>flash.text.FontStyle</code>.
1097
+ */
1098
+ static isFontCompatible(fontName: string, fontStyle: string): boolean;
1099
+ onKeyDelegate: (e: any) => void;
1100
+ onKey(e: any): void;
1101
+ addCharCode(charCode: number): void;
1102
+ private deleteSelectedText;
1103
+ addChar(char: string, isShift?: boolean, isCTRL?: boolean, isAlt?: boolean): void;
1104
+ private _insertNewText;
1105
+ clone(): TextField;
1106
+ copyTo(newInstance: TextField): void;
1107
+ private _clearTextShapes;
1108
+ }
1109
+ export {};
1110
1110
  //# sourceMappingURL=TextField.d.ts.map