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

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

goog.require('org.apache.royale.core.IChild');
goog.require('org.apache.royale.core.IPanelModel');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.html.Group');
goog.require('org.apache.royale.html.beads.PanelView');
goog.require('org.apache.royale.core.IContainerBaseStrandChildrenHost');



/**
 *  constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @constructor
 * @extends {org.apache.royale.html.Group}
 * @implements {org.apache.royale.core.IContainerBaseStrandChildrenHost}
 */
org.apache.royale.html.Panel = function() {
  org.apache.royale.html.Panel.base(this, 'constructor');
  this.typeNames = "Panel";
};
goog.inherits(org.apache.royale.html.Panel, org.apache.royale.html.Group);


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


/**
 * @export
 * @param {org.apache.royale.core.IChild} c
 * @param {boolean=} dispatchEvent
 */
org.apache.royale.html.Panel.prototype.$addElement = function(c, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  org.apache.royale.html.Panel.superClass_.addElement.apply(this, [ c, dispatchEvent] );
};


/**
 * @asprivate
 * @suppress {undefinedNames}
 * Support strandChildren.
 * @export
 * @param {org.apache.royale.core.IChild} c
 * @param {number} index
 * @param {boolean=} dispatchEvent
 */
org.apache.royale.html.Panel.prototype.$addElementAt = function(c, index, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  org.apache.royale.html.Panel.superClass_.addElementAt.apply(this, [ c, index, dispatchEvent] );
};


/**
 * @export
 * @param {number} index
 * @return {org.apache.royale.core.IChild}
 */
org.apache.royale.html.Panel.prototype.$getElementAt = function(index) {
  return org.apache.royale.html.Panel.superClass_.getElementAt.apply(this, [ index] );
};


/**
 * @asprivate
 * @suppress {undefinedNames}
 * Support strandChildren.
 * @export
 * @param {org.apache.royale.core.IChild} c
 * @param {boolean=} dispatchEvent
 */
org.apache.royale.html.Panel.prototype.$removeElement = function(c, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  org.apache.royale.html.Panel.superClass_.removeElement.apply(this, [ c, dispatchEvent] );
};


/**
 * @asprivate
 * @suppress {undefinedNames}
 * Support strandChildren.
 * @export
 * @param {org.apache.royale.core.IChild} c
 * @return {number}
 */
org.apache.royale.html.Panel.prototype.$getElementIndex = function(c) {
  return org.apache.royale.html.Panel.superClass_.getElementIndex.apply(this, [ c] );
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.PanelView
 * @export
 * @override
 */
org.apache.royale.html.Panel.prototype.addElement = function(c, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  var /** @type {Object} */ panelView = this.view;
  panelView.contentArea.addElement(c, dispatchEvent);
  panelView.contentArea.dispatchEvent(new org.apache.royale.events.Event("layoutNeeded"));
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.PanelView
 * @export
 * @override
 */
org.apache.royale.html.Panel.prototype.addElementAt = function(c, index, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  var /** @type {Object} */ panelView = this.view;
  panelView.contentArea.addElementAt(c, index, dispatchEvent);
  panelView.contentArea.dispatchEvent(new org.apache.royale.events.Event("layoutNeeded"));
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.PanelView
 * @export
 * @override
 */
org.apache.royale.html.Panel.prototype.getElementIndex = function(c) {
  var /** @type {Object} */ panelView = this.view;
  return panelView.contentArea.getElementIndex(c);
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.PanelView
 * @export
 * @override
 */
org.apache.royale.html.Panel.prototype.removeElement = function(c, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  var /** @type {Object} */ panelView = this.view;
  panelView.contentArea.removeElement(c, dispatchEvent);
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.PanelView
 * @export
 * @override
 */
org.apache.royale.html.Panel.prototype.getElementAt = function(index) {
  var /** @type {Object} */ panelView = this.view;
  return panelView.contentArea.getElementAt(index);
};


org.apache.royale.html.Panel.prototype.get__$numElements = function() {
  return org.apache.royale.html.Panel.superClass_.get__numElements.apply(this);
};


org.apache.royale.html.Panel.prototype.get__title = function() {
  return this.model.title;
};


org.apache.royale.html.Panel.prototype.set__title = function(value) {
  this.model.title = value;
};


org.apache.royale.html.Panel.prototype.get__htmlTitle = function() {
  return this.model.htmlTitle;
};


org.apache.royale.html.Panel.prototype.set__htmlTitle = function(value) {
  this.model.htmlTitle = value;
};


org.apache.royale.html.Panel.prototype.get__showCloseButton = function() {
  return this.model.showCloseButton;
};


org.apache.royale.html.Panel.prototype.set__showCloseButton = function(value) {
  this.model.showCloseButton = value;
};


org.apache.royale.html.Panel.prototype.get__numElements = function() {
  var /** @type {Object} */ panelView = this.view;
  return panelView.contentArea.numElements;
};


Object.defineProperties(org.apache.royale.html.Panel.prototype, /** @lends {org.apache.royale.html.Panel.prototype} */ {
/**
  * @export
  * @type {number} */
$numElements: {
get: org.apache.royale.html.Panel.prototype.get__$numElements},
/**
  * @export
  * @type {string} */
title: {
get: org.apache.royale.html.Panel.prototype.get__title,
set: org.apache.royale.html.Panel.prototype.set__title},
/**
  * @export
  * @type {string} */
htmlTitle: {
get: org.apache.royale.html.Panel.prototype.get__htmlTitle,
set: org.apache.royale.html.Panel.prototype.set__htmlTitle},
/**
  * @export
  * @type {boolean} */
showCloseButton: {
get: org.apache.royale.html.Panel.prototype.get__showCloseButton,
set: org.apache.royale.html.Panel.prototype.set__showCloseButton},
/**
  * @export
  * @type {number} */
numElements: {
get: org.apache.royale.html.Panel.prototype.get__numElements}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.Panel.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        '$numElements': { type: 'int', access: 'readonly', declaredBy: 'org.apache.royale.html.Panel'},
        'title': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.html.Panel'},
        'htmlTitle': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.html.Panel'},
        'showCloseButton': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.Panel'},
        'numElements': { type: 'int', access: 'readonly', declaredBy: 'org.apache.royale.html.Panel'}
      };
    },
    methods: function () {
      return {
        'Panel': { type: '', declaredBy: 'org.apache.royale.html.Panel'},
        '$addElement': { type: 'void', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'Boolean', optional: true } ]; }},
        '$addElementAt': { type: 'void', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'int', optional: false },{ index: 3, type: 'Boolean', optional: true } ]; }},
        '$getElementAt': { type: 'org.apache.royale.core.IChild', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'int', optional: false } ]; }},
        '$removeElement': { type: 'void', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'Boolean', optional: true } ]; }},
        '$getElementIndex': { type: 'int', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false } ]; }},
        'addElement': { type: 'void', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'Boolean', optional: true } ]; }},
        'addElementAt': { type: 'void', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'int', optional: false },{ index: 3, type: 'Boolean', optional: true } ]; }},
        'getElementIndex': { type: 'int', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false } ]; }},
        'removeElement': { type: 'void', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'Boolean', optional: true } ]; }},
        'getElementAt': { type: 'org.apache.royale.core.IChild', declaredBy: 'org.apache.royale.html.Panel', parameters: function () { return [  { index: 1, type: 'int', optional: false } ]; }}
      };
    },
    metadata: function () { return [  ]; }
  };
};