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

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

goog.require('org.apache.royale.core.IMeasurementBead');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.html.TitleBar');
goog.require('org.apache.royale.html.beads.TitleBarView');



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


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


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


org.apache.royale.html.beads.TitleBarMeasurementBead.prototype.get__measuredWidth = function() {
  var /** @type {number} */ mwidth = 0;
  var /** @type {org.apache.royale.html.TitleBar} */ titleBar = this.org_apache_royale_html_beads_TitleBarMeasurementBead__strand;
  var /** @type {org.apache.royale.html.beads.TitleBarView} */ titleView = this.org_apache_royale_html_beads_TitleBarMeasurementBead__strand.getBeadByType(org.apache.royale.html.beads.TitleBarView);
  var /** @type {org.apache.royale.core.IMeasurementBead} */ labelMeasure = titleView.titleLabel.measurementBead;
  mwidth = labelMeasure.measuredWidth;
  if (titleBar.showCloseButton) {
    var /** @type {org.apache.royale.core.IMeasurementBead} */ buttonMeasure = titleView.closeButton.measurementBead;
    mwidth += buttonMeasure.measuredWidth;
  }
  return mwidth;
};


org.apache.royale.html.beads.TitleBarMeasurementBead.prototype.get__measuredHeight = function() {
  var /** @type {number} */ mheight = 0;
  var /** @type {org.apache.royale.html.TitleBar} */ titleBar = this.org_apache_royale_html_beads_TitleBarMeasurementBead__strand;
  var /** @type {org.apache.royale.html.beads.TitleBarView} */ titleView = this.org_apache_royale_html_beads_TitleBarMeasurementBead__strand.getBeadByType(org.apache.royale.html.beads.TitleBarView);
  var /** @type {org.apache.royale.core.IMeasurementBead} */ labelMeasure = titleView.titleLabel.measurementBead;
  mheight = labelMeasure.measuredHeight;
  if (titleBar.showCloseButton) {
    var /** @type {org.apache.royale.core.IMeasurementBead} */ buttonMeasure = titleView.closeButton.measurementBead;
    mheight = Math.max(mheight, buttonMeasure.measuredHeight);
  }
  return mheight;
};


org.apache.royale.html.beads.TitleBarMeasurementBead.prototype.set__strand = function(value) {
  this.org_apache_royale_html_beads_TitleBarMeasurementBead__strand = value;
};


Object.defineProperties(org.apache.royale.html.beads.TitleBarMeasurementBead.prototype, /** @lends {org.apache.royale.html.beads.TitleBarMeasurementBead.prototype} */ {
/**
  * @export
  * @type {number} */
measuredWidth: {
get: org.apache.royale.html.beads.TitleBarMeasurementBead.prototype.get__measuredWidth},
/**
  * @export
  * @type {number} */
measuredHeight: {
get: org.apache.royale.html.beads.TitleBarMeasurementBead.prototype.get__measuredHeight},
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.TitleBarMeasurementBead.prototype.set__strand}}
);


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



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