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

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

goog.require('org.apache.royale.html.Group');
goog.require('org.apache.royale.jewel.beads.layouts.StyledLayoutBase');
goog.require('org.apache.royale.utils.ClassSelectorList');
goog.require('org.apache.royale.utils.StringUtil');
goog.require('org.apache.royale.utils.IClassSelectorListSupport');



/**
 *  Constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * @constructor
 * @extends {org.apache.royale.html.Group}
 * @implements {org.apache.royale.utils.IClassSelectorListSupport}
 */
org.apache.royale.jewel.Group = function() {
  org.apache.royale.jewel.Group.base(this, 'constructor');
  this.classSelectorList = new org.apache.royale.utils.ClassSelectorList(this);
  this.typeNames = "";
};
goog.inherits(org.apache.royale.jewel.Group, org.apache.royale.html.Group);


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


/**
 * @protected
 * @type {org.apache.royale.utils.ClassSelectorList}
 */
org.apache.royale.jewel.Group.prototype.classSelectorList;


/**
 * @protected
 * @override
 */
org.apache.royale.jewel.Group.prototype.setClassName = function(value) {
  this.classSelectorList.addNames(value);
};


/**
 * Add a class selector to the list.
 * 
 * @asparam name Name of selector to add.
 * 
 * @langversion 3.0
 * @playerversion Flash 10.2
 * @playerversion AIR 2.6
 * @productversion Royale 0.9.4
 * @export
 * @param {string} name
 */
org.apache.royale.jewel.Group.prototype.addClass = function(name) {
  this.classSelectorList.add(name);
};


/**
 * Removes a class selector from the list.
 * 
 * @asparam name Name of selector to remove.
 *
 * @royaleignorecoercion HTMLElement
 * @royaleignorecoercion DOMTokenList
 * 
 * @langversion 3.0
 * @playerversion Flash 10.2
 * @playerversion AIR 2.6
 * @productversion Royale 0.9.4
 * @export
 * @param {string} name
 */
org.apache.royale.jewel.Group.prototype.removeClass = function(name) {
  this.classSelectorList.remove(name);
};


/**
 * Add or remove a class selector to/from the list.
 * 
 * @asparam name Name of selector to add or remove.
 * @asparam value True to add, False to remove.
 * 
 * @langversion 3.0
 * @playerversion Flash 10.2
 * @playerversion AIR 2.6
 * @productversion Royale 0.9.4
 * @export
 * @param {string} name
 * @param {boolean} value
 */
org.apache.royale.jewel.Group.prototype.toggleClass = function(name, value) {
  this.classSelectorList.toggle(name, value);
};


/**
 *  Search for the name in the element class list 
 *
 *  @asparam name Name of selector to find.
 *  @asreturn return true if the name is found or false otherwise.
 * 
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * @export
 * @param {string} name
 * @return {boolean}
 */
org.apache.royale.jewel.Group.prototype.containsClass = function(name) {
  return this.classSelectorList.contains(name);
  
};


/**
 * @protected
 * @type {org.apache.royale.jewel.beads.layouts.StyledLayoutBase}
 */
org.apache.royale.jewel.Group.prototype._layout;


org.apache.royale.jewel.Group.prototype.get__itemsHorizontalAlign = function() {
  return this._layout.itemsHorizontalAlign;
};


org.apache.royale.jewel.Group.prototype.set__itemsHorizontalAlign = function(value) {
  this.typeNames = org.apache.royale.utils.StringUtil.removeWord(this.typeNames, " " + this._layout.itemsHorizontalAlign);
  this._layout.itemsHorizontalAlign = value;
  this.typeNames += " " + this._layout.itemsHorizontalAlign;
  if (this.parent)
    this.setClassName(this.computeFinalClassNames());
};


org.apache.royale.jewel.Group.prototype.get__itemsVerticalAlign = function() {
  return this._layout.itemsVerticalAlign;
};


org.apache.royale.jewel.Group.prototype.set__itemsVerticalAlign = function(value) {
  this.typeNames = org.apache.royale.utils.StringUtil.removeWord(this.typeNames, " " + this._layout.itemsVerticalAlign);
  this._layout.itemsVerticalAlign = value;
  this.typeNames += " " + this._layout.itemsVerticalAlign;
  if (this.parent)
    this.setClassName(this.computeFinalClassNames());
};


org.apache.royale.jewel.Group.prototype.get__itemsExpand = function() {
  return this._layout.itemsExpand;
};


org.apache.royale.jewel.Group.prototype.set__itemsExpand = function(value) {
  this.typeNames = org.apache.royale.utils.StringUtil.removeWord(this.typeNames, " itemsExpand");
  this._layout.itemsExpand = value;
  if (this._layout.itemsExpand) {
    this.typeNames += " itemsExpand";
  }
  if (this.parent)
    this.setClassName(this.computeFinalClassNames());
};


Object.defineProperties(org.apache.royale.jewel.Group.prototype, /** @lends {org.apache.royale.jewel.Group.prototype} */ {
/**
  * @export
  * @type {string} */
itemsHorizontalAlign: {
get: org.apache.royale.jewel.Group.prototype.get__itemsHorizontalAlign,
set: org.apache.royale.jewel.Group.prototype.set__itemsHorizontalAlign},
/**
  * @export
  * @type {string} */
itemsVerticalAlign: {
get: org.apache.royale.jewel.Group.prototype.get__itemsVerticalAlign,
set: org.apache.royale.jewel.Group.prototype.set__itemsVerticalAlign},
/**
  * @export
  * @type {boolean} */
itemsExpand: {
get: org.apache.royale.jewel.Group.prototype.get__itemsExpand,
set: org.apache.royale.jewel.Group.prototype.set__itemsExpand}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.Group.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'itemsHorizontalAlign': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Group'},
        'itemsVerticalAlign': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Group'},
        'itemsExpand': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Group'}
      };
    },
    methods: function () {
      return {
        'Group': { type: '', declaredBy: 'org.apache.royale.jewel.Group'},
        'addClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.Group', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }},
        'removeClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.Group', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }},
        'toggleClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.Group', parameters: function () { return [  { index: 1, type: 'String', optional: false },{ index: 2, type: 'Boolean', optional: false } ]; }},
        'containsClass': { type: 'Boolean', declaredBy: 'org.apache.royale.jewel.Group', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }}
      };
    }
  };
};