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

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

goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.html.util.addElementToWrapper');
goog.require('org.apache.royale.jewel.Container');
goog.require('org.apache.royale.jewel.supportClasses.IActivable');
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.jewel.Container}
 */
org.apache.royale.jewel.ApplicationMainContent = function() {
  org.apache.royale.jewel.ApplicationMainContent.base(this, 'constructor');
  this.typeNames = "jewel main";
};
goog.inherits(org.apache.royale.jewel.ApplicationMainContent, org.apache.royale.jewel.Container);


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


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.jewel.ApplicationMainContent.prototype.org_apache_royale_jewel_ApplicationMainContent__hasTopAppBar;


/**
 *  shows a concrete content and hides the rest
 * 
 *  @asparam id, the id of the container to show
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * @export
 * @param {string} id
 */
org.apache.royale.jewel.ApplicationMainContent.prototype.showContent = function(id) {
  try {
    for (var /** @type {number} */ i = 0; i < this.numElements; i++) {
      var /** @type {org.apache.royale.jewel.supportClasses.IActivable} */ content = org.apache.royale.utils.Language.as(this.getElementAt(i), org.apache.royale.jewel.supportClasses.IActivable);
      if (content.id == id) {
        content.isActive = true;
      } else {
        content.isActive = false;
      }
    }
  } catch (error) {
    throw new Error("One or more content in ApplicationMainContent is not implementing IActivable interface.");
  }
};


/**
 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @protected
 * @override
 */
org.apache.royale.jewel.ApplicationMainContent.prototype.createElement = function() {
  return org.apache.royale.html.util.addElementToWrapper(this, 'main');
};


org.apache.royale.jewel.ApplicationMainContent.prototype.get__hasTopAppBar = function() {
  return this.org_apache_royale_jewel_ApplicationMainContent__hasTopAppBar;
};


org.apache.royale.jewel.ApplicationMainContent.prototype.set__hasTopAppBar = function(value) {
  if (this.org_apache_royale_jewel_ApplicationMainContent__hasTopAppBar != value) {
    this.org_apache_royale_jewel_ApplicationMainContent__hasTopAppBar = value;
    this.toggleClass("has-topappbar", this.org_apache_royale_jewel_ApplicationMainContent__hasTopAppBar);
  }
};


Object.defineProperties(org.apache.royale.jewel.ApplicationMainContent.prototype, /** @lends {org.apache.royale.jewel.ApplicationMainContent.prototype} */ {
/**
  * @export
  * @type {boolean} */
hasTopAppBar: {
get: org.apache.royale.jewel.ApplicationMainContent.prototype.get__hasTopAppBar,
set: org.apache.royale.jewel.ApplicationMainContent.prototype.set__hasTopAppBar}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.ApplicationMainContent.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'hasTopAppBar': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.ApplicationMainContent'}
      };
    },
    methods: function () {
      return {
        'ApplicationMainContent': { type: '', declaredBy: 'org.apache.royale.jewel.ApplicationMainContent'},
        'showContent': { type: 'void', declaredBy: 'org.apache.royale.jewel.ApplicationMainContent', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }}
      };
    }
  };
};