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

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

goog.require('org.apache.royale.core.ContainerBase');
goog.require('org.apache.royale.core.ValuesManager');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.utils.ClassSelectorList');
goog.require('org.apache.royale.utils.MXMLDataInterpreter');
goog.require('org.apache.royale.core.IMXMLDocument');
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.core.ContainerBase}
 * @implements {org.apache.royale.core.IMXMLDocument}
 * @implements {org.apache.royale.utils.IClassSelectorListSupport}
 */
org.apache.royale.jewel.Container = function() {
  
  this.org_apache_royale_jewel_Container__mxmlDocument = this;
  org.apache.royale.jewel.Container.base(this, 'constructor');
  this.classSelectorList = new org.apache.royale.utils.ClassSelectorList(this);
  this.typeNames = "";
};
goog.inherits(org.apache.royale.jewel.Container, org.apache.royale.core.ContainerBase);


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


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


/**
 * @protected
 * @override
 */
org.apache.royale.jewel.Container.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.Container.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.Container.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.Container.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.Container.prototype.containsClass = function(name) {
  return this.classSelectorList.contains(name);
  
};


/**
 * @private
 * @type {Array}
 */
org.apache.royale.jewel.Container.prototype.org_apache_royale_jewel_Container__mxmlDescriptor;


/**
 * @private
 * @type {Object}
 */
org.apache.royale.jewel.Container.prototype.org_apache_royale_jewel_Container__mxmlDocument;


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.jewel.Container.prototype.org_apache_royale_jewel_Container__initialized;


/**
 * @asprivate
 * @export
 * @override
 */
org.apache.royale.jewel.Container.prototype.addedToParent = function() {
  if (!this.org_apache_royale_jewel_Container__initialized) {
    org.apache.royale.core.ValuesManager["valuesImpl"].init(this);
  }
  org.apache.royale.jewel.Container.superClass_.addedToParent.apply(this);
  if (!this.org_apache_royale_jewel_Container__initialized) {
    org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances(this.org_apache_royale_jewel_Container__mxmlDocument, this, this.MXMLDescriptor);
    this.dispatchEvent(new org.apache.royale.events.Event("initBindings"));
    this.dispatchEvent(new org.apache.royale.events.Event("initComplete"));
    this.org_apache_royale_jewel_Container__initialized = true;
  }
};


/**
 *  @asprivate
 * @export
 * @param {Object} document
 * @param {Array} value
 */
org.apache.royale.jewel.Container.prototype.setMXMLDescriptor = function(document, value) {
  this.org_apache_royale_jewel_Container__mxmlDocument = document;
  this.org_apache_royale_jewel_Container__mxmlDescriptor = value;
};


/**
 *  @copy org.apache.royale.core.Application#generateMXMLAttributes()
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * @export
 * @param {Array} data
 */
org.apache.royale.jewel.Container.prototype.generateMXMLAttributes = function(data) {
  org.apache.royale.utils.MXMLDataInterpreter.generateMXMLProperties(this, data);
};


/**
 * @export
 * @type {Array}
 */
org.apache.royale.jewel.Container.prototype.mxmlContent;


org.apache.royale.jewel.Container.prototype.get__MXMLDescriptor = function() {
  return this.org_apache_royale_jewel_Container__mxmlDescriptor;
};


Object.defineProperties(org.apache.royale.jewel.Container.prototype, /** @lends {org.apache.royale.jewel.Container.prototype} */ {
/**
  * @export
  * @type {Array} */
MXMLDescriptor: {
get: org.apache.royale.jewel.Container.prototype.get__MXMLDescriptor}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.Container.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {
      return {
        'mxmlContent': { type: 'Array'}
      };
    },
    accessors: function () {
      return {
        'MXMLDescriptor': { type: 'Array', access: 'readonly', declaredBy: 'org.apache.royale.jewel.Container'}
      };
    },
    methods: function () {
      return {
        'Container': { type: '', declaredBy: 'org.apache.royale.jewel.Container'},
        'addClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.Container', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }},
        'removeClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.Container', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }},
        'toggleClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.Container', parameters: function () { return [  { index: 1, type: 'String', optional: false },{ index: 2, type: 'Boolean', optional: false } ]; }},
        'containsClass': { type: 'Boolean', declaredBy: 'org.apache.royale.jewel.Container', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }},
        'addedToParent': { type: 'void', declaredBy: 'org.apache.royale.jewel.Container'},
        'setMXMLDescriptor': { type: 'void', declaredBy: 'org.apache.royale.jewel.Container', parameters: function () { return [  { index: 1, type: 'Object', optional: false },{ index: 2, type: 'Array', optional: false } ]; }},
        'generateMXMLAttributes': { type: 'void', declaredBy: 'org.apache.royale.jewel.Container', parameters: function () { return [  { index: 1, type: 'Array', optional: false } ]; }}
      };
    },
    metadata: function () { return [  ]; }
  };
};