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

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

goog.require('org.apache.royale.core.IParentIUIBase');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.IUIBase');
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.HorizontalLayoutWithPaddingAndGap = function() {
  org.apache.royale.html.beads.layouts.HorizontalLayoutWithPaddingAndGap.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.beads.layouts.HorizontalLayoutWithPaddingAndGap, org.apache.royale.core.LayoutBase);


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


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


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


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


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


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


/**
 * @copy org.apache.royale.core.IBeadLayout#layout
 * @royaleignorecoercion org.apache.royale.core.ILayoutHost
 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @royaleignorecoercion org.apache.royale.core.IBorderPaddingMarginValuesImpl
 * @export
 * @override
 */
org.apache.royale.html.beads.layouts.HorizontalLayoutWithPaddingAndGap.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["white-space"] = "nowrap";
  children = contentView.internalChildren();
  n = children.length;
  for (i = 0; i < n; i++) {
    var /** @type {Object} */ child = children[i];
    if (child == null)
      continue;
    child.style.marginTop = this.org_apache_royale_html_beads_layouts_HorizontalLayoutWithPaddingAndGap__paddingTop + 'px';
    if (i === (n - 1)) {
      child.style.marginRight = this.org_apache_royale_html_beads_layouts_HorizontalLayoutWithPaddingAndGap__paddingRight + 'px';
    } else {
      child.style.marginRight = '0px';
    }
    child.style.marginBottom = this.org_apache_royale_html_beads_layouts_HorizontalLayoutWithPaddingAndGap__paddingBottom + 'px';
    if (i == 0) {
      child.style.marginLeft = this.org_apache_royale_html_beads_layouts_HorizontalLayoutWithPaddingAndGap__paddingLeft + 'px';
    } else {
      child.style.marginLeft = this.org_apache_royale_html_beads_layouts_HorizontalLayoutWithPaddingAndGap__gap + 'px';
    }
    child.royale_wrapper.setDisplayStyleForLayout('inline-block');
    if (child.style.display !== 'none') {
      child.style.display = 'inline-block';
    }
  }
  return true;
};


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


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


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


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


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


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


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


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


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


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


org.apache.royale.html.beads.layouts.HorizontalLayoutWithPaddingAndGap.prototype.set__strand = function(value) {
  org.apache.royale.html.beads.layouts.HorizontalLayoutWithPaddingAndGap.superClass_.set__strand.apply(this, [ value] );
  var /** @type {org.apache.royale.core.IUIBase} */ base = value;
  if (base.element.style.display !== "none") {
    base.element.style.display = "block";
  }
};


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


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



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