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

goog.provide('org.apache.royale.html.beads.WebBrowserView');

goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.IUIBase');
goog.require('org.apache.royale.core.UIBase');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.html.beads.models.WebBrowserModel');
goog.require('org.apache.royale.core.IBeadView');
goog.require('org.apache.royale.utils.Language');



/**
 * Constructor
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @constructor
 * @implements {org.apache.royale.core.IBeadView}
 */
org.apache.royale.html.beads.WebBrowserView = function() {
};


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


/**
 * @private
 * @type {org.apache.royale.core.IStrand}
 */
org.apache.royale.html.beads.WebBrowserView.prototype.org_apache_royale_html_beads_WebBrowserView__strand;


/**
 * @asprivate
 * @private
 * @param {org.apache.royale.events.Event} event
 */
org.apache.royale.html.beads.WebBrowserView.prototype.org_apache_royale_html_beads_WebBrowserView_loadPage = function(event) {
  var /** @type {org.apache.royale.html.beads.models.WebBrowserModel} */ model = org.apache.royale.utils.Language.as(org.apache.royale.utils.Language.as(this.host, org.apache.royale.core.UIBase).model, org.apache.royale.html.beads.models.WebBrowserModel);
  var /** @type {HTMLIFrameElement} */ iframe = org.apache.royale.utils.Language.as(org.apache.royale.utils.Language.as(this.host, org.apache.royale.core.UIBase).element, HTMLIFrameElement);
  iframe.src = model.url;
};


/**
 * @asprivate
 * @private
 * @param {org.apache.royale.events.Event} event
 */
org.apache.royale.html.beads.WebBrowserView.prototype.org_apache_royale_html_beads_WebBrowserView_handlePageShow = function(event) {
  var /** @type {org.apache.royale.html.beads.models.WebBrowserModel} */ model = org.apache.royale.utils.Language.as(org.apache.royale.utils.Language.as(this.host, org.apache.royale.core.UIBase).model, org.apache.royale.html.beads.models.WebBrowserModel);
  var /** @type {HTMLIFrameElement} */ iframe = org.apache.royale.utils.Language.as(org.apache.royale.utils.Language.as(this.host, org.apache.royale.core.UIBase).element, HTMLIFrameElement);
  model.setURL(iframe.src);
  this.host.dispatchEvent(new org.apache.royale.events.Event("locationChanged"));
};


org.apache.royale.html.beads.WebBrowserView.prototype.get__host = function() {
  return org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_WebBrowserView__strand, org.apache.royale.core.IUIBase);
};


org.apache.royale.html.beads.WebBrowserView.prototype.set__strand = function(value) {
  this.org_apache_royale_html_beads_WebBrowserView__strand = value;
  var /** @type {org.apache.royale.events.IEventDispatcher} */ model = org.apache.royale.utils.Language.as(org.apache.royale.utils.Language.as(this.host, org.apache.royale.core.UIBase).model, org.apache.royale.events.IEventDispatcher);
  model.addEventListener("urlChanged", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_WebBrowserView_loadPage, this, 'loadPage'));
  var /** @type {HTMLIFrameElement} */ iframe = org.apache.royale.utils.Language.as(org.apache.royale.utils.Language.as(this.host, org.apache.royale.core.UIBase).element, HTMLIFrameElement);
  iframe.addEventListener("load", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_WebBrowserView_handlePageShow, this, 'handlePageShow'), false);
};


Object.defineProperties(org.apache.royale.html.beads.WebBrowserView.prototype, /** @lends {org.apache.royale.html.beads.WebBrowserView.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IUIBase} */
host: {
get: org.apache.royale.html.beads.WebBrowserView.prototype.get__host},
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.WebBrowserView.prototype.set__strand}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.WebBrowserView.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'host': { type: 'org.apache.royale.core.IUIBase', access: 'readonly', declaredBy: 'org.apache.royale.html.beads.WebBrowserView'},
        'strand': { type: 'org.apache.royale.core.IStrand', access: 'writeonly', declaredBy: 'org.apache.royale.html.beads.WebBrowserView'}
      };
    },
    methods: function () {
      return {
        'WebBrowserView': { type: '', declaredBy: 'org.apache.royale.html.beads.WebBrowserView'}
      };
    }
  };
};