/TheKnightErrant/src/mx/managers/IFocusManager.as

https://github.com/yangboz/godpaper · ActionScript · 293 lines · 27 code · 29 blank · 237 comment · 0 complexity · 71f1c1b1b72cd373a280cd68e2a85497 MD5 · raw file

  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // ADOBE SYSTEMS INCORPORATED
  4. // Copyright 2005-2007 Adobe Systems Incorporated
  5. // All Rights Reserved.
  6. //
  7. // NOTICE: Adobe permits you to use, modify, and distribute this file
  8. // in accordance with the terms of the license agreement accompanying it.
  9. //
  10. ////////////////////////////////////////////////////////////////////////////////
  11. package mx.managers
  12. {
  13. //import flash.display.DisplayObject;
  14. import flash.events.IEventDispatcher;
  15. import flash.display.InteractiveObject;
  16. import flash.display.Sprite;
  17. //import mx.core.IButton;
  18. //import mx.core.IUIComponent;
  19. /**
  20. * The IFocusManager interface defines the interface that components must implement
  21. * to manage the focus on components in response to mouse activity or
  22. * keyboard activity (Tab key), and to support a default button.
  23. *
  24. * @see mx.managers.FocusManager
  25. *
  26. * @langversion 3.0
  27. * @playerversion Flash 9
  28. * @playerversion AIR 1.1
  29. * @productversion Flex 3
  30. */
  31. public interface IFocusManager extends IEventDispatcher
  32. {
  33. //--------------------------------------------------------------------------
  34. //
  35. // Properties
  36. //
  37. //--------------------------------------------------------------------------
  38. //----------------------------------
  39. // defaultButton
  40. //----------------------------------
  41. /**
  42. * A reference to the original default Button control.
  43. * Pressing the Enter key while the focus is on any control
  44. * activates the Button control by dispatching a <code>click</code> event
  45. * on the Button control, just as if it was clicked with the mouse.
  46. * The actual default Button control changes if focus is given to another
  47. * Button control, but switches back to the original if focus is not
  48. * on a button.
  49. *
  50. * <p>This property is managed by Flex containers; do not set it directly
  51. * to specify the default button.</p>
  52. *
  53. * <p>The <code>defaultButton</code> must be of class
  54. * <code>mx.controls.Button</code> even though this property
  55. * is of type <code>IUIComponent</code>.</p>
  56. *
  57. * @langversion 3.0
  58. * @playerversion Flash 9
  59. * @playerversion AIR 1.1
  60. * @productversion Flex 3
  61. */
  62. function get defaultButton():IButton;
  63. /**
  64. * @private
  65. */
  66. function set defaultButton(value:IButton):void;
  67. //----------------------------------
  68. // defaultButtonEnabled
  69. //----------------------------------
  70. /**
  71. * A flag that indicates whether the FocusManager should
  72. * check for the Enter key being pressed to activate the default button.
  73. * TextArea and other components that want to recognize
  74. * the <code>Enter</code> key
  75. * set this property to <code>false</code> to disable the Enter
  76. * key from dispatching a <code>click</code> event on the
  77. * default button, if it exists.
  78. *
  79. * @langversion 3.0
  80. * @playerversion Flash 9
  81. * @playerversion AIR 1.1
  82. * @productversion Flex 3
  83. */
  84. function get defaultButtonEnabled():Boolean;
  85. /**
  86. * @private
  87. */
  88. function set defaultButtonEnabled(value:Boolean):void;
  89. //----------------------------------
  90. // focusPane
  91. //----------------------------------
  92. /**
  93. * A single Sprite that is moved from container to container
  94. * as the focus moves to those containers.
  95. * The Sprite is used as the parent of the visual indicator
  96. * that a component has focus.
  97. *
  98. * @langversion 3.0
  99. * @playerversion Flash 9
  100. * @playerversion AIR 1.1
  101. * @productversion Flex 3
  102. */
  103. function get focusPane():Sprite;
  104. /**
  105. * @private
  106. */
  107. function set focusPane(value:Sprite):void;
  108. //----------------------------------
  109. // nextTabIndex
  110. //----------------------------------
  111. /**
  112. * The next unique tab index to use in this tab loop.
  113. *
  114. * @langversion 3.0
  115. * @playerversion Flash 9
  116. * @playerversion AIR 1.1
  117. * @productversion Flex 3
  118. */
  119. function get nextTabIndex():int;
  120. //----------------------------------
  121. // showFocusIndicator
  122. //----------------------------------
  123. /**
  124. * A flag that indicates whether to display an indicator that
  125. * a component has focus.
  126. * If <code>true</code> a component receiving focus
  127. * draws a visible indicator that it has focus.
  128. *
  129. * <p>By default, this is <code>false</code> until the user uses
  130. * the Tab key, then it is set to <code>true</code>.</p>
  131. *
  132. * <p>In general it is better to use
  133. * the <code>showFocus()</code> and <code>hideFocus()</code> methods
  134. * to change this property as those methods also update the
  135. * visual indicator that a component has focus.</p>
  136. *
  137. * @langversion 3.0
  138. * @playerversion Flash 9
  139. * @playerversion AIR 1.1
  140. * @productversion Flex 3
  141. */
  142. function get showFocusIndicator():Boolean;
  143. /**
  144. * @private
  145. */
  146. function set showFocusIndicator(value:Boolean):void;
  147. //--------------------------------------------------------------------------
  148. //
  149. // Methods
  150. //
  151. //--------------------------------------------------------------------------
  152. /**
  153. * Gets the IFocusManagerComponent component that currently has the focus.
  154. * Calling this method is recommended instead of using the Stage object
  155. * because it indicates which component has focus.
  156. * The Stage might return a subcomponent in that component.
  157. *
  158. * @return IFocusManagerComponent object that has focus.
  159. *
  160. * @langversion 3.0
  161. * @playerversion Flash 9
  162. * @playerversion AIR 1.1
  163. * @productversion Flex 3
  164. */
  165. function getFocus():IFocusManagerComponent;
  166. /**
  167. * Sets focus to an IFocusManagerComponent component. Does not check for
  168. * the components visibility, enabled state, or any other conditions.
  169. *
  170. * @param o A component that can receive focus.
  171. *
  172. * @langversion 3.0
  173. * @playerversion Flash 9
  174. * @playerversion AIR 1.1
  175. * @productversion Flex 3
  176. */
  177. function setFocus(o:IFocusManagerComponent):void;
  178. /**
  179. * Sets <code>showFocusIndicator</code> to <code>true</code>
  180. * and draws the visual focus indicator on the focused object, if any.
  181. *
  182. * @langversion 3.0
  183. * @playerversion Flash 9
  184. * @playerversion AIR 1.1
  185. * @productversion Flex 3
  186. */
  187. function showFocus():void;
  188. /**
  189. * Sets <code>showFocusIndicator</code> to <code>false</code>
  190. * and removes the visual focus indicator from the focused object, if any.
  191. *
  192. * @langversion 3.0
  193. * @playerversion Flash 9
  194. * @playerversion AIR 1.1
  195. * @productversion Flex 3
  196. */
  197. function hideFocus():void;
  198. /**
  199. * The SystemManager activates and deactivates a FocusManager
  200. * if more than one IFocusManagerContainer is visible at the same time.
  201. * If the mouse is clicked in an IFocusManagerContainer with a deactivated
  202. * FocusManager, the SystemManager will call
  203. * the <code>activate()</code> method on that FocusManager.
  204. * The FocusManager that was activated will have its <code>deactivate()</code> method
  205. * called prior to the activation of another FocusManager.
  206. *
  207. * @langversion 3.0
  208. * @playerversion Flash 9
  209. * @playerversion AIR 1.1
  210. * @productversion Flex 3
  211. */
  212. function activate():void;
  213. /**
  214. * The SystemManager activates and deactivates a FocusManager
  215. * if more than one IFocusManagerContainer is visible at the same time.
  216. * If the mouse is clicked in an IFocusManagerContainer with a deactivated
  217. * FocusManager, the SystemManager will call
  218. * the <code>activate()</code> method on that FocusManager.
  219. * The FocusManager that was activated will have its <code>deactivate()</code> method
  220. * called prior to the activation of another FocusManager.
  221. *
  222. * @langversion 3.0
  223. * @playerversion Flash 9
  224. * @playerversion AIR 1.1
  225. * @productversion Flex 3
  226. */
  227. function deactivate():void;
  228. /**
  229. * Returns the IFocusManagerComponent that contains the given object, if any.
  230. * Because the player can set focus to a subcomponent of a Flex component
  231. * this method determines which IFocusManagerComponent has focus from
  232. * the component perspective.
  233. *
  234. * @param o An object that can have player-level focus.
  235. *
  236. * @return The IFOcusManagerComponent containing <code>o</code> or
  237. * <code>null</code>
  238. *
  239. * @langversion 3.0
  240. * @playerversion Flash 9
  241. * @playerversion AIR 1.1
  242. * @productversion Flex 3
  243. */
  244. function findFocusManagerComponent(o:InteractiveObject):IFocusManagerComponent;
  245. /**
  246. * Returns the IFocusManagerComponent that would receive focus
  247. * if the user pressed the Tab key to navigate to another component.
  248. * It will return the same component as the current focused component
  249. * if there are no other valid components in the application.
  250. *
  251. * @param backward If <code>true</code>, return the object
  252. * as if the Shift-Tab keys were pressed.
  253. *
  254. * @return The component that would receive focus.
  255. *
  256. * @langversion 3.0
  257. * @playerversion Flash 9
  258. * @playerversion AIR 1.1
  259. * @productversion Flex 3
  260. */
  261. function getNextFocusManagerComponent(
  262. backward:Boolean = false):IFocusManagerComponent;
  263. }
  264. }