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

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

goog.require('org.apache.royale.core.ILayoutChild');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.html.beads.layouts.BasicLayout');
goog.require('org.apache.royale.core.IBeadLayout');
goog.require('org.apache.royale.utils.Language');



/**
 * @constructor
 * @extends {org.apache.royale.html.beads.layouts.BasicLayout}
 * @implements {org.apache.royale.core.IBeadLayout}
 */
org.apache.royale.html.beads.layouts.RemovableBasicLayout = function() {
  org.apache.royale.html.beads.layouts.RemovableBasicLayout.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.beads.layouts.RemovableBasicLayout, org.apache.royale.html.beads.layouts.BasicLayout);


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


org.apache.royale.html.beads.layouts.RemovableBasicLayout.prototype.set__strand = function(value) {
  var /** @type {org.apache.royale.core.ILayoutChild} */ newHost = value;
  var /** @type {org.apache.royale.core.ILayoutChild} */ oldHost = this.host;
  if (newHost != oldHost) {
    var /** @type {Function} */ sizeChange = org.apache.royale.utils.Language.closure(this.handleSizeChange, this, 'handleSizeChange');
    var /** @type {Function} */ childrenAdded = org.apache.royale.utils.Language.closure(this.handleChildrenAdded, this, 'handleChildrenAdded');
    var /** @type {Function} */ initComplete = org.apache.royale.utils.Language.closure(this.handleInitComplete, this, 'handleInitComplete');
    var /** @type {Function} */ layoutNeeded = org.apache.royale.utils.Language.closure(this.handleLayoutNeeded, this, 'handleLayoutNeeded');
    if (oldHost) {
      oldHost.removeEventListener("widthChanged", sizeChange);
      oldHost.removeEventListener("heightChanged", sizeChange);
      oldHost.removeEventListener("sizeChanged", sizeChange);
      oldHost.removeEventListener("childrenAdded", childrenAdded);
      oldHost.removeEventListener("initComplete", initComplete);
      oldHost.removeEventListener("layoutNeeded", layoutNeeded);
    }
    this.host = newHost;
    if (newHost) {
      newHost.addEventListener("widthChanged", sizeChange);
      newHost.addEventListener("heightChanged", sizeChange);
      newHost.addEventListener("sizeChanged", sizeChange);
      newHost.addEventListener("childrenAdded", childrenAdded);
      newHost.addEventListener("initComplete", initComplete);
      newHost.addEventListener("layoutNeeded", layoutNeeded);
    }
  }
};


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


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.layouts.RemovableBasicLayout.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.layouts.RemovableBasicLayout'}
      };
    },
    methods: function () {return {};}
  };
};