/FD3/FlashDevelop/Bin/Debug/Library/AS3/frameworks/FlashIDE/fl/video/SeekBarAccImpl.as

https://bitbucket.org/kkszysiu/flashdevelop · ActionScript · 164 lines · 56 code · 3 blank · 105 comment · 0 complexity · 62867003e7ba6d5bc258b8c429723904 MD5 · raw file

  1. package fl.video
  2. {
  3. import flash.accessibility.Accessibility;
  4. import flash.accessibility.AccessibilityImplementation;
  5. import flash.accessibility.AccessibilityProperties;
  6. import flash.display.DisplayObject;
  7. import flash.events.Event;
  8. import flash.events.FocusEvent;
  9. import flash.display.Sprite;
  10. import fl.video.FLVPlayback;
  11. import fl.video.VideoEvent;
  12. import flash.events.TimerEvent;
  13. import flash.utils.Dictionary;
  14. import flash.utils.setTimeout;
  15. import flash.utils.Timer;
  16. /**
  17. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  18. */
  19. public class SeekBarAccImpl extends AccessibilityImplementation
  20. {
  21. /**
  22. * @private * Default state for all the components.
  23. */
  24. private static const STATE_SYSTEM_NORMAL : uint = 0x00000000;
  25. /**
  26. * @private
  27. */
  28. private static const STATE_SYSTEM_FOCUSABLE : uint = 0x00100000;
  29. /**
  30. * @private
  31. */
  32. private static const STATE_SYSTEM_FOCUSED : uint = 0x00000004;
  33. /**
  34. * @private
  35. */
  36. private static const STATE_SYSTEM_SELECTABLE : uint = 0x00200000;
  37. /**
  38. * @private
  39. */
  40. private static const STATE_SYSTEM_SELECTED : uint = 0x00000002;
  41. /**
  42. * @private
  43. */
  44. private static const STATE_SYSTEM_UNAVAILABLE : uint = 0x00000001;
  45. /**
  46. * @private
  47. */
  48. private static const EVENT_OBJECT_FOCUS : uint = 0x8005;
  49. /**
  50. * @private
  51. */
  52. private static const EVENT_OBJECT_VALUECHANGE : uint = 0x800E;
  53. /**
  54. * @private
  55. */
  56. private static const EVENT_OBJECT_SELECTION : uint = 0x8006;
  57. /**
  58. * @private
  59. */
  60. private static const EVENT_OBJECT_LOCATIONCHANGE : uint = 0x800B;
  61. /**
  62. * @private
  63. */
  64. private static const ROLE_SLIDER : uint = 0x33;
  65. /**
  66. * @private
  67. */
  68. private static const ROLE_SYSTEM_INDICATOR : uint = 0x27;
  69. /**
  70. * @private
  71. */
  72. private static const ROLE_SYSTEM_PUSHBUTTON : uint = 0x2b;
  73. /**
  74. * @private (protected) * A reference to the MovieClip instance that this AccImpl instance * is making accessible. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  75. */
  76. protected var master : Sprite;
  77. /**
  78. * @private (protected) * Accessibility Role of the MovieClip being made accessible. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  79. */
  80. protected var role : uint;
  81. private var _vc : FLVPlayback;
  82. private var _cachedPercentage : Number;
  83. private var _timer : Timer;
  84. /**
  85. * @private (protected) * All subclasses must override this property by returning an array * of strings that contains the events for which to listen. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  86. */
  87. protected function get eventsToHandle () : Array;
  88. /**
  89. * @private * All subclasses must implement this function. * * @param sprite The Sprite instance that this AccImpl instance * is making accessible. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  90. */
  91. public static function createAccessibilityImplementation (sprite:Sprite) : void;
  92. /**
  93. * Enables accessibility for a component. * This method is required for the compiler to activate * the accessibility classes for a component. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  94. */
  95. public static function enableAccessibility () : void;
  96. /**
  97. * @private * * Creates a new Accessibility Implementation instance for the specified MovieClip. * * @param sprite The Sprite instance that this AccImpl instance * makes accessible. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  98. */
  99. public function SeekBarAccImpl (sprite:Sprite);
  100. /**
  101. * @private * Returns the system role for the MovieClip. * * @param childID The child id. * * @return Role associated with the MovieClip. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  102. */
  103. public function get_accRole (childID:uint) : uint;
  104. /**
  105. * @private * IAccessible method for returning the value of the slider * (which would be the value of the item selected). * The slider should return the value of the current thumb as the value. * * @param childID uint * * @return Value String * @review
  106. */
  107. public function get_accValue (childID:uint) : String;
  108. /**
  109. * @private * Returns the name of the component. * * @param childID uint. * * @return Name of the component. * * @tiptext Returns the name of the component * @helpid 3000
  110. */
  111. public function get_accName (childID:uint) : String;
  112. /**
  113. * @private * method for returning the name of the slider * should return the value * * @param childID uint * * @return Name String * @review
  114. */
  115. protected function getName (childID:uint) : String;
  116. /**
  117. * @private * Method to return an array of childIDs. * * @return Array child ids * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  118. */
  119. public function getChildIDArray () : Array;
  120. /**
  121. * @private * IAccessible method for returning the bounding box of the component or its child element. * * @param childID:uint * * @return Location:Object
  122. */
  123. public function accLocation (childID:uint) : *;
  124. /**
  125. * @private * IAccessible method for returning the state of the Button. * States are predefined for all the components in MSAA. * Values are assigned to each state. * * @param childID uint * * @return State uint
  126. */
  127. public function get_accState (childID:uint) : uint;
  128. /**
  129. * Utility method determines state of the accessible component.
  130. */
  131. protected function getState (childID:uint) : uint;
  132. /**
  133. * @private * IAccessible method for returning the Default Action. * * @param childID The child id. * * @return DefaultAction. * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  134. */
  135. public function get_accDefaultAction (childID:uint) : String;
  136. /**
  137. * @private * IAccessible method for executing the Default Action. * * @param childID uint
  138. */
  139. public function accDoDefaultAction (childID:uint) : void;
  140. /**
  141. * @private * * @langversion 3.0 * @playerversion Flash 9.0.28.0
  142. */
  143. private function getStatusName () : String;
  144. /**
  145. * @private * Override the generic event handler. * All AccImpl must implement this to listen * for events from its master component.
  146. */
  147. protected function eventHandler (event:Event) : void;
  148. /**
  149. * @private * This is (kind of) a hack to get around the fact that SeekBarSlider is not * an IFocusManagerComponent. It forces focus from accessibility its thumb * gets focus.
  150. */
  151. private function focusInHandler (event:Event) : void;
  152. /**
  153. * @private * Returns a timecode string for a given time in seconds.
  154. */
  155. private function secondsToTime (sec:Number) : String;
  156. /**
  157. * @private * Dispatches an accessibility event to notify MSAA of a value change.
  158. */
  159. private function sendAccessibilityEvent (event:TimerEvent) : void;
  160. }
  161. }