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

goog.provide('org.apache.royale.html.CheckBox');

goog.require('org.apache.royale.core.UIBase');
goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.html.supportClasses.CheckBoxIcon');
goog.require('org.apache.royale.html.util.addElementToWrapper');



/**
 * @constructor
 * @extends {org.apache.royale.core.UIBase}
 */
org.apache.royale.html.CheckBox = function() {
  org.apache.royale.html.CheckBox.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.CheckBox, org.apache.royale.core.UIBase);


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


/**
 * @private
 * @type {org.apache.royale.core.WrappedHTMLElement}
 */
org.apache.royale.html.CheckBox.prototype.org_apache_royale_html_CheckBox__label;


/**
 * @private
 * @type {org.apache.royale.html.supportClasses.CheckBoxIcon}
 */
org.apache.royale.html.CheckBox.prototype.org_apache_royale_html_CheckBox__icon;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.CheckBox.org_apache_royale_html_CheckBox__checkNumber = 0;


/**
 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @protected
 * @override
 */
org.apache.royale.html.CheckBox.prototype.createElement = function() {
  var /** @type {HTMLInputElement} */ cb;
  org.apache.royale.html.util.addElementToWrapper(this, 'label');
  this.org_apache_royale_html_CheckBox__label = this.element;
  this.org_apache_royale_html_CheckBox__icon = new org.apache.royale.html.supportClasses.CheckBoxIcon();
  this.element.appendChild(this.org_apache_royale_html_CheckBox__icon.element);
  this.element.appendChild(document.createTextNode(''));
  this.org_apache_royale_html_CheckBox__icon.element.royale_wrapper = this;
  this.typeNames = 'CheckBox CheckBoxIcon';
  return this.element;
};


org.apache.royale.html.CheckBox.prototype.get__text = function() {
  return this.org_apache_royale_html_CheckBox__label.childNodes.item(1).nodeValue;
};


org.apache.royale.html.CheckBox.prototype.set__text = function(value) {
  this.org_apache_royale_html_CheckBox__label.childNodes.item(1).nodeValue = value;
};


org.apache.royale.html.CheckBox.prototype.get__selected = function() {
  return this.org_apache_royale_html_CheckBox__icon.element.checked;
};


org.apache.royale.html.CheckBox.prototype.set__selected = function(value) {
  this.org_apache_royale_html_CheckBox__icon.element.checked = value;
};


Object.defineProperties(org.apache.royale.html.CheckBox.prototype, /** @lends {org.apache.royale.html.CheckBox.prototype} */ {
/**
  * @export
  * @type {string} */
text: {
get: org.apache.royale.html.CheckBox.prototype.get__text,
set: org.apache.royale.html.CheckBox.prototype.set__text},
/**
  * @export
  * @type {boolean} */
selected: {
get: org.apache.royale.html.CheckBox.prototype.get__selected,
set: org.apache.royale.html.CheckBox.prototype.set__selected}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.CheckBox.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'text': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.html.CheckBox'},
        'selected': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.CheckBox', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: 'change' } ] } ]; }}
      };
    },
    methods: function () {return {};},
    metadata: function () { return [  ]; }
  };
};