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

goog.provide('org.apache.royale.jewel.Button');

goog.require('org.apache.royale.core.StyledUIBase');
goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.html.util.addElementToWrapper');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.IUIBase');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.utils.Language');



/**
 *  Constructor.
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * @constructor
 * @extends {org.apache.royale.core.StyledUIBase}
 * @implements {org.apache.royale.core.IStrand}
 * @implements {org.apache.royale.events.IEventDispatcher}
 * @implements {org.apache.royale.core.IUIBase}
 */
org.apache.royale.jewel.Button = function() {
  org.apache.royale.jewel.Button.base(this, 'constructor');
  this.typeNames = "jewel button";
};
goog.inherits(org.apache.royale.jewel.Button, org.apache.royale.core.StyledUIBase);


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


/**
 * @export
 * @const
 * @type {string}
 */
org.apache.royale.jewel.Button.PRIMARY = "primary";


/**
 * @export
 * @const
 * @type {string}
 */
org.apache.royale.jewel.Button.SECONDARY = "secondary";


/**
 * @export
 * @const
 * @type {string}
 */
org.apache.royale.jewel.Button.EMPHASIZED = "emphasized";


/**
 * @private
 * @type {string}
 */
org.apache.royale.jewel.Button.prototype.org_apache_royale_jewel_Button__emphasis;


/**
 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @royaleignorecoercion org.apache.royale.html.util.addElementToWrapper
 * @protected
 * @override
 */
org.apache.royale.jewel.Button.prototype.createElement = function() {
  org.apache.royale.html.util.addElementToWrapper(this, 'button');
  this.element.setAttribute('type', 'button');
  this.positioner = this.element;
  return this.element;
};


org.apache.royale.jewel.Button.prototype.get__text = function() {
  return org.apache.royale.utils.Language.as(this.element, HTMLButtonElement).innerHTML;
};


org.apache.royale.jewel.Button.prototype.set__text = function(value) {
  org.apache.royale.utils.Language.as(this.element, HTMLButtonElement).innerHTML = value;
  this.dispatchEvent('textChange');
};


org.apache.royale.jewel.Button.prototype.get__html = function() {
  return org.apache.royale.utils.Language.as(this.element, HTMLButtonElement).innerHTML;
};


org.apache.royale.jewel.Button.prototype.set__html = function(value) {
  org.apache.royale.utils.Language.as(this.element, HTMLButtonElement).innerHTML = value;
  this.dispatchEvent('textChange');
};


org.apache.royale.jewel.Button.prototype.get__emphasis = function() {
  return this.org_apache_royale_jewel_Button__emphasis;
};


org.apache.royale.jewel.Button.prototype.set__emphasis = function(value) {
  if (this.org_apache_royale_jewel_Button__emphasis != value) {
    if (this.org_apache_royale_jewel_Button__emphasis) {
      this.removeClass(this.org_apache_royale_jewel_Button__emphasis);
    }
    this.org_apache_royale_jewel_Button__emphasis = value;
    this.addClass(this.org_apache_royale_jewel_Button__emphasis);
  }
};


Object.defineProperties(org.apache.royale.jewel.Button.prototype, /** @lends {org.apache.royale.jewel.Button.prototype} */ {
/**
  * @export
  * @type {string} */
text: {
get: org.apache.royale.jewel.Button.prototype.get__text,
set: org.apache.royale.jewel.Button.prototype.set__text},
/**
  * @export
  * @type {string} */
html: {
get: org.apache.royale.jewel.Button.prototype.get__html,
set: org.apache.royale.jewel.Button.prototype.set__html},
/**
  * @export
  * @type {string} */
emphasis: {
get: org.apache.royale.jewel.Button.prototype.get__emphasis,
set: org.apache.royale.jewel.Button.prototype.set__emphasis}}
);


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
org.apache.royale.jewel.Button.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'Button', qName: 'org.apache.royale.jewel.Button', kind: 'class' }], interfaces: [org.apache.royale.core.IStrand, org.apache.royale.events.IEventDispatcher, org.apache.royale.core.IUIBase] };



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.Button.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'text': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Button'},
        'html': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Button'},
        'emphasis': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Button'}
      };
    },
    methods: function () {
      return {
        'Button': { type: '', declaredBy: 'org.apache.royale.jewel.Button'}
      };
    }
  };
};