﻿package com.adobe.captivate.widgets
{
	import flash.events.IEventDispatcher;
	
	/**
		* This class describes the properties of the Adobe Captivate movie that is closest to the hierarchy of the widget.
		
		* @see CPMovieHandle#getMovieProps
	*/
	public class CPMovieProperties
	{
		/**
     	* @private
     	*/
		public function CPMovieProperties(contentWidthVal:Number=0,contentHeightVal:Number=0,variablesHandleVal:Object=null,movieHandleVal:Object=null,
		eventDispatcher:IEventDispatcher=null,contentLeftVal:Number=0,contentTopVal:Number=0,movieWidthVal:Number = 0,movieHeightVal:Number = 0)
		{
			this._contentWidth = contentWidthVal;
			this._contentHeight = contentHeightVal;
			this._variablesHandle = variablesHandleVal;
			this._movieHandle = movieHandleVal;
			this._eventDispatcher = eventDispatcher;
			this._contentLeft = contentLeftVal;
			this._contentTop = contentTopVal;
			this._movieWidth = movieWidthVal;
			this._movieHeight = movieHeightVal;
		}
		
		/**
     	* @private
     	*/
		private var _contentLeft:Number;

		/**
     		* This function returns the left postion  of the movie's content..
			* This may be non zero if TOC is present in seperate mode or the playbar is on the left
			* @return Width of the content movie			
		*/
		public function get contentLeft():Number
		{
			return _contentLeft;
		}
		
		/**
     	* @private
     	*/
		private var _contentTop:Number;
		/**
     		* This function returns the top postion  of the movie's content..
			* This may be non zero if the playbar is on the top
			* @return Width of the content movie			
		*/
		public function get contentTop():Number
		{
			return _contentTop;
		}

		/**
     	* @private
     	*/
		private var _contentWidth:Number;

		/**
     		* This function returns the width of the movie's content..
			
			* @return Width of the content movie			
		*/
		public function get contentWidth():Number
		{
			return _contentWidth;
		}

		/**
     	* @private
     	*/
		private var _contentHeight:Number;

		/**
     		* This function returns the height of the movie's content..
			
			* @return Width of the content height			
		*/
		public function get contentHeight():Number
		{
			return _contentHeight;
		}
		
		/**
     	* @private
     	*/
		private var _movieWidth:Number;

		/**
     		* This function returns the total width of the movie
			* Including TOC Width and playbar width if on the left or right and borders if anys
			* @return Total Width of the  movie
		*/
		public function get movieWidth():Number
		{
			return _movieWidth;
		}

		/**
     	* @private
     	*/
		private var _movieHeight:Number;

		/**
     		* This function returns the height of the movie's content..
			* Includes playbar width if on the top or bottom and borders if any
			* @return Width of the content height			
		*/
		public function get movieHeight():Number
		{
			return _movieHeight;
		}

		/**
     		* @private
     		*/
		private var _variablesHandle:Object;

		/**
			* The function returns a variables handel. Adobe captivate system and user defined variables are accessed using the variables handle
			<listing version="3.0">
			 variablesHandle.myVar = 10;
			 </listing>
			* @return Object that allows variables to be accessed
		*/
		
		public function get variablesHandle():Object
		{
			return _variablesHandle;
		}

		/**
     	* @private
     	*/
		private var _movieHandle:Object;

		/**
			* Handle to the main movie object in captivate runtime.
			* This function is DEPRECATED
			*
			* @return A movieHandle Object
		*/
		public function get movieHandle():Object
		{
			return _movieHandle;
		}
		/**
     		* @private
     	*/
		private var _eventDispatcher:IEventDispatcher;
		
		/** 
		* This function returns an event dispatcher that can be used to listen to captivate swf events.
		*
		* @return returns an IEventDispatcher object
		*
		* @see flash.events.IEventDispatcher
		* @see com.adobe.captivate.events
		*/
		public function get eventDispatcher():IEventDispatcher
		{
			return _eventDispatcher;
		}
	}
}
