/**
 * Generated by Apache Royale Compiler from org\apache\royale\html\beads\DispatchKeyboardEventBead.as
 * org.apache.royale.html.beads.DispatchKeyboardEventBead
 *
 * @fileoverview
 *
 * @suppress {checkTypes|accessControls}
 */

goog.provide('org.apache.royale.html.beads.DispatchKeyboardEventBead');

goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.events.KeyboardEvent');
goog.require('org.apache.royale.events.utils.KeyboardEventConverter');
goog.require('org.apache.royale.core.IBead');
goog.require('org.apache.royale.utils.Language');



/**
 *  constructor.
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @constructor
 * @implements {org.apache.royale.core.IBead}
 */
org.apache.royale.html.beads.DispatchKeyboardEventBead = function() {
};


/**
 * Prevent renaming of class. Needed for reflection.
 */
goog.exportSymbol('org.apache.royale.html.beads.DispatchKeyboardEventBead', org.apache.royale.html.beads.DispatchKeyboardEventBead);


/**
 * @private
 * @type {org.apache.royale.core.IStrand}
 */
org.apache.royale.html.beads.DispatchKeyboardEventBead.prototype.org_apache_royale_html_beads_DispatchKeyboardEventBead__strand;


/**
 * @asprivate
 * @protected
 * @param {org.apache.royale.events.KeyboardEvent} event
 */
org.apache.royale.html.beads.DispatchKeyboardEventBead.prototype.keyEventHandler = function(event) {
  event.stopImmediatePropagation();
  var /** @type {org.apache.royale.events.KeyboardEvent} */ newEvent = org.apache.royale.events.utils.KeyboardEventConverter.convert(event);
  org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_DispatchKeyboardEventBead__strand, org.apache.royale.events.IEventDispatcher).dispatchEvent(newEvent);
  if (newEvent.defaultPrevented) {
    event.preventDefault();
  }
};


org.apache.royale.html.beads.DispatchKeyboardEventBead.prototype.set__strand = function(value) {
  this.org_apache_royale_html_beads_DispatchKeyboardEventBead__strand = value;
  
  org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_DispatchKeyboardEventBead__strand, Object).element.addEventListener('keydown', org.apache.royale.utils.Language.closure(this.keyEventHandler, this, 'keyEventHandler'));
  org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_DispatchKeyboardEventBead__strand, Object).element.addEventListener('keyup', org.apache.royale.utils.Language.closure(this.keyEventHandler, this, 'keyEventHandler'));
};


Object.defineProperties(org.apache.royale.html.beads.DispatchKeyboardEventBead.prototype, /** @lends {org.apache.royale.html.beads.DispatchKeyboardEventBead.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.DispatchKeyboardEventBead.prototype.set__strand}}
);


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
org.apache.royale.html.beads.DispatchKeyboardEventBead.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'DispatchKeyboardEventBead', qName: 'org.apache.royale.html.beads.DispatchKeyboardEventBead', kind: 'class' }], interfaces: [org.apache.royale.core.IBead] };



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.DispatchKeyboardEventBead.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'strand': { type: 'org.apache.royale.core.IStrand', access: 'writeonly', declaredBy: 'org.apache.royale.html.beads.DispatchKeyboardEventBead'}
      };
    },
    methods: function () {
      return {
        'DispatchKeyboardEventBead': { type: '', declaredBy: 'org.apache.royale.html.beads.DispatchKeyboardEventBead'}
      };
    }
  };
};