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

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

goog.require('org.apache.royale.core.IRenderedObject');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.events.IEventDispatcher');
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 9.3
 * @constructor
 * @implements {org.apache.royale.core.IBead}
 */
org.apache.royale.html.beads.StyleInheritanceBead = function() {
};


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


/**
 * @private
 * @type {string}
 */
org.apache.royale.html.beads.StyleInheritanceBead.prototype.org_apache_royale_html_beads_StyleInheritanceBead__styleName;


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


/**
 * @protected
 * @param {Event} e
 */
org.apache.royale.html.beads.StyleInheritanceBead.prototype.initCompleteHandler = function(e) {
  this.org_apache_royale_html_beads_StyleInheritanceBead_forceInheritanceOnDescendants();
};


/**
 *  @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @private
 */
org.apache.royale.html.beads.StyleInheritanceBead.prototype.org_apache_royale_html_beads_StyleInheritanceBead_forceInheritanceOnDescendants = function() {
  var /** @type {NodeList} */ elements = this.hostElement.querySelectorAll("*");
  for (var /** @type {number} */ i = 0; i < elements.length; i++) {
    var /** @type {Object} */ htmlElement = elements[i];
    if (htmlElement) {
      htmlElement.style[this.styleName] = "inherit";
    }
  }
};


org.apache.royale.html.beads.StyleInheritanceBead.prototype.set__strand = function(value) {
  this.org_apache_royale_html_beads_StyleInheritanceBead__strand = value;
  org.apache.royale.utils.Language.as(value, org.apache.royale.events.IEventDispatcher).addEventListener('initComplete', org.apache.royale.utils.Language.closure(this.initCompleteHandler, this, 'initCompleteHandler'));
};


org.apache.royale.html.beads.StyleInheritanceBead.prototype.get__hostElement = function() {
  return org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_StyleInheritanceBead__strand, org.apache.royale.core.IRenderedObject).element;
};


org.apache.royale.html.beads.StyleInheritanceBead.prototype.get__styleName = function() {
  return this.org_apache_royale_html_beads_StyleInheritanceBead__styleName;
};


org.apache.royale.html.beads.StyleInheritanceBead.prototype.set__styleName = function(value) {
  this.org_apache_royale_html_beads_StyleInheritanceBead__styleName = value;
};


Object.defineProperties(org.apache.royale.html.beads.StyleInheritanceBead.prototype, /** @lends {org.apache.royale.html.beads.StyleInheritanceBead.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.StyleInheritanceBead.prototype.set__strand},
/**
  * @export
  * @type {org.apache.royale.core.WrappedHTMLElement} */
hostElement: {
get: org.apache.royale.html.beads.StyleInheritanceBead.prototype.get__hostElement},
/**
  * @export
  * @type {string} */
styleName: {
get: org.apache.royale.html.beads.StyleInheritanceBead.prototype.get__styleName,
set: org.apache.royale.html.beads.StyleInheritanceBead.prototype.set__styleName}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.StyleInheritanceBead.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.StyleInheritanceBead'},
        'styleName': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.html.beads.StyleInheritanceBead'}
      };
    },
    methods: function () {
      return {
        'StyleInheritanceBead': { type: '', declaredBy: 'org.apache.royale.html.beads.StyleInheritanceBead'}
      };
    }
  };
};