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

goog.provide('org.apache.royale.html.supportClasses.ScrollingViewport');

goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.UIBase');
goog.require('org.apache.royale.geom.Size');
goog.require('org.apache.royale.html.supportClasses.Viewport');
goog.require('org.apache.royale.core.IBead');
goog.require('org.apache.royale.core.IScrollingViewport');



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


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


/**
 * @copy org.apache.royale.core.IViewport
 * @export
 * @override
 */
org.apache.royale.html.supportClasses.ScrollingViewport.prototype.layoutViewportBeforeContentLayout = function(width, height) {
};


/**
 * @copy org.apache.royale.core.IViewport
 * @export
 * @override
 */
org.apache.royale.html.supportClasses.ScrollingViewport.prototype.layoutViewportAfterContentLayout = function(contentSize) {
};


org.apache.royale.html.supportClasses.ScrollingViewport.prototype.get__verticalScrollPosition = function() {
  return this.contentView.positioner.scrollTop;
};


org.apache.royale.html.supportClasses.ScrollingViewport.prototype.set__verticalScrollPosition = function(value) {
  this.contentView.positioner.scrollTop = value;
};


org.apache.royale.html.supportClasses.ScrollingViewport.prototype.get__horizontalScrollPosition = function() {
  return this.contentView.positioner.scrollLeft;
};


org.apache.royale.html.supportClasses.ScrollingViewport.prototype.set__horizontalScrollPosition = function(value) {
  this.contentView.positioner.scrollLeft = value;
};


org.apache.royale.html.supportClasses.ScrollingViewport.prototype.set__strand = function(value) {
  org.apache.royale.html.supportClasses.ScrollingViewport.superClass_.set__strand.apply(this, [ value] );
  var /** @type {org.apache.royale.core.UIBase} */ component;
  if (this.contentView == null) {
    component = value;
  } else {
    component = this.contentView;
  }
  component.element.style.overflow = "auto";
};


Object.defineProperties(org.apache.royale.html.supportClasses.ScrollingViewport.prototype, /** @lends {org.apache.royale.html.supportClasses.ScrollingViewport.prototype} */ {
/**
  * @export
  * @type {number} */
verticalScrollPosition: {
get: org.apache.royale.html.supportClasses.ScrollingViewport.prototype.get__verticalScrollPosition,
set: org.apache.royale.html.supportClasses.ScrollingViewport.prototype.set__verticalScrollPosition},
/**
  * @export
  * @type {number} */
horizontalScrollPosition: {
get: org.apache.royale.html.supportClasses.ScrollingViewport.prototype.get__horizontalScrollPosition,
set: org.apache.royale.html.supportClasses.ScrollingViewport.prototype.set__horizontalScrollPosition},
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.supportClasses.ScrollingViewport.prototype.set__strand}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.supportClasses.ScrollingViewport.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'verticalScrollPosition': { type: 'Number', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.ScrollingViewport'},
        'horizontalScrollPosition': { type: 'Number', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.ScrollingViewport'},
        'strand': { type: 'org.apache.royale.core.IStrand', access: 'writeonly', declaredBy: 'org.apache.royale.html.supportClasses.ScrollingViewport'}
      };
    },
    methods: function () {
      return {
        'ScrollingViewport': { type: '', declaredBy: 'org.apache.royale.html.supportClasses.ScrollingViewport'},
        'layoutViewportBeforeContentLayout': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.ScrollingViewport', parameters: function () { return [  { index: 1, type: 'Number', optional: false },{ index: 2, type: 'Number', optional: false } ]; }},
        'layoutViewportAfterContentLayout': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.ScrollingViewport', parameters: function () { return [  { index: 1, type: 'org.apache.royale.geom.Size', optional: false } ]; }}
      };
    }
  };
};