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

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

goog.require('org.apache.royale.core.UIBase');
goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.geom.Point');
goog.require('org.apache.royale.utils.PointUtils');



/**
 *  Constructor.
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @constructor
 * @extends {org.apache.royale.core.UIBase}
 */
org.apache.royale.html.SubAppLoader = function() {
  org.apache.royale.html.SubAppLoader.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.SubAppLoader, org.apache.royale.core.UIBase);


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


/**
 * @private
 * @type {org.apache.royale.core.WrappedHTMLElement}
 */
org.apache.royale.html.SubAppLoader.prototype.org_apache_royale_html_SubAppLoader_htmlLoader;


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @private
 */
org.apache.royale.html.SubAppLoader.prototype.org_apache_royale_html_SubAppLoader_createLoader = function() {
  
  var /** @type {org.apache.royale.geom.Point} */ origin = new org.apache.royale.geom.Point(0, 0);
  var /** @type {org.apache.royale.geom.Point} */ xlated = org.apache.royale.utils.PointUtils.localToGlobal(origin, this.parent);
  if (this.org_apache_royale_html_SubAppLoader_htmlLoader == null) {
    this.org_apache_royale_html_SubAppLoader_htmlLoader = document.createElement('iframe');
    this.org_apache_royale_html_SubAppLoader_htmlLoader["width"] = String(this.width);
    this.org_apache_royale_html_SubAppLoader_htmlLoader["height"] = String(this.height);
    this.org_apache_royale_html_SubAppLoader_htmlLoader.style.position = "absolute";
    this.org_apache_royale_html_SubAppLoader_htmlLoader.style.left = String(xlated.x) + "px";
    this.org_apache_royale_html_SubAppLoader_htmlLoader.style.top = String(xlated.y) + "px";
    this.org_apache_royale_html_SubAppLoader_htmlLoader.style.backgroundColor = String("white");
    this.org_apache_royale_html_SubAppLoader_htmlLoader.style.border = "none";
    document.body.appendChild(this.org_apache_royale_html_SubAppLoader_htmlLoader);
  }
};


/**
 * Specifies the URL to load, depending on the runtime platform. Pass null for
 * whichever URL is not being used.
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @export
 * @param {string} swfURL
 * @param {string} htmlURL
 */
org.apache.royale.html.SubAppLoader.prototype.loadApplication = function(swfURL, htmlURL) {
  this.org_apache_royale_html_SubAppLoader_createLoader();
  
  this.org_apache_royale_html_SubAppLoader_htmlLoader.setAttribute("src", htmlURL);
};


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.SubAppLoader.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {return {};},
    methods: function () {
      return {
        'SubAppLoader': { type: '', declaredBy: 'org.apache.royale.html.SubAppLoader'},
        'loadApplication': { type: 'void', declaredBy: 'org.apache.royale.html.SubAppLoader', parameters: function () { return [  { index: 1, type: 'String', optional: false },{ index: 2, type: 'String', optional: false } ]; }}
      };
    }
  };
};