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

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

goog.require('org.apache.royale.core.IParentIUIBase');
goog.require('org.apache.royale.core.LayoutBase');
goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.core.IBeadLayout');
goog.require('org.apache.royale.utils.Language');



/**
 *  Constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @constructor
 * @extends {org.apache.royale.core.LayoutBase}
 * @implements {org.apache.royale.core.IBeadLayout}
 */
org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap = function() {
  org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap, org.apache.royale.core.LayoutBase);


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


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingTop = 0;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingRight = 0;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingBottom = 0;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingLeft = 0;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__gap = 0;


/**
 *  Layout children vertically
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 *  @royaleignorecoercion org.apache.royale.core.ILayoutHost
 *  @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @export
 * @override
 */
org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.layout = function() {
  
  var /** @type {Array} */ children;
  var /** @type {number} */ i = 0;
  var /** @type {number} */ n = 0;
  var /** @type {org.apache.royale.core.IParentIUIBase} */ contentView = org.apache.royale.utils.Language.as(this.layoutView, org.apache.royale.core.IParentIUIBase);
  contentView.element.style["vertical-align"] = "top";
  children = contentView.internalChildren();
  n = children.length;
  for (i = 0; i < n; i++) {
    var /** @type {Object} */ child = children[i];
    if (i == 0) {
      child.style.marginTop = this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingTop + 'px';
    } else {
      child.style.marginTop = this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__gap + 'px';
    }
    child.style.marginRight = this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingRight + 'px';
    if (i === (n - 1)) {
      child.style.marginBottom = this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingBottom + 'px';
    } else {
      child.style.marginBottom = '0px';
    }
    child.style.marginLeft = this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingLeft + 'px';
    child.royale_wrapper.setDisplayStyleForLayout('block');
    if (child.style.display === 'none') {
      child.royale_wrapper.setDisplayStyleForLayout('block');
    } else {
      child.style.display = 'inline-block';
      child.style.display = 'block';
    }
    child.royale_wrapper.dispatchEvent('sizeChanged');
  }
  return true;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__paddingTop = function() {
  return this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingTop;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__paddingTop = function(value) {
  this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingTop = value;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__paddingRight = function() {
  return this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingRight;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__paddingRight = function(value) {
  this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingRight = value;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__paddingBottom = function() {
  return this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingBottom;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__paddingBottom = function(value) {
  this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingBottom = value;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__paddingLeft = function() {
  return this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingLeft;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__paddingLeft = function(value) {
  this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__paddingLeft = value;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__gap = function() {
  return this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__gap;
};


org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__gap = function(value) {
  this.org_apache_royale_html_beads_layouts_VerticalLayoutWithPaddingAndGap__gap = value;
};


Object.defineProperties(org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype, /** @lends {org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype} */ {
/**
  * @export
  * @type {number} */
paddingTop: {
get: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__paddingTop,
set: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__paddingTop},
/**
  * @export
  * @type {number} */
paddingRight: {
get: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__paddingRight,
set: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__paddingRight},
/**
  * @export
  * @type {number} */
paddingBottom: {
get: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__paddingBottom,
set: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__paddingBottom},
/**
  * @export
  * @type {number} */
paddingLeft: {
get: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__paddingLeft,
set: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__paddingLeft},
/**
  * @export
  * @type {number} */
gap: {
get: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.get__gap,
set: org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.set__gap}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'paddingTop': { type: 'Number', access: 'readwrite', declaredBy: 'org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap'},
        'paddingRight': { type: 'Number', access: 'readwrite', declaredBy: 'org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap'},
        'paddingBottom': { type: 'Number', access: 'readwrite', declaredBy: 'org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap'},
        'paddingLeft': { type: 'Number', access: 'readwrite', declaredBy: 'org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap'},
        'gap': { type: 'Number', access: 'readwrite', declaredBy: 'org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap'}
      };
    },
    methods: function () {
      return {
        'VerticalLayoutWithPaddingAndGap': { type: '', declaredBy: 'org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap'},
        'layout': { type: 'Boolean', declaredBy: 'org.apache.royale.html.beads.layouts.VerticalLayoutWithPaddingAndGap'}
      };
    }
  };
};