/** @file navobject.h
 *  An implementation of INav from an Object
 *	@author Chris Burns (cburns@ea.com)
 *
 *	UX
 *	(c) 2012 Electronic Arts Inc. 
 */

#ifndef EANAV_NAVOBJECT_H_
#define	EANAV_NAVOBJECT_H_

#include "EANav/inav.h"

namespace EA
{
	namespace Nav
	{
		/*! @class	NavObject navobject.h	"EANav/navobject.h"
		*	@brief	An implementation of INav using a Types::Object filled with Types::Functions
		*/
		class NavObject : public INav
		{
		public:

			/*!
			*	NavObject constructor
			*/
			NavObject();

			/*!
			*	NavObject destructor
			*/
			~NavObject();

			/*!
			*	Set the object to use for this interface
			*	@param	object	The object
			*/
			void SetObject(EA::Types::ObjectIn object);

			/*!
			*	Retrieve this interface as an object
			*	@return	Object*	A collection of functions representing this object
			*/
			virtual EA::Types::ObjectReturn ToObject();

			virtual void Start(EA::Types::FunctionIn callback);

			virtual void Event(EA::Types::FunctionIn callback, const char* name, EA::Types::BaseTypeIn data);

			virtual void AddActionHandler(const char* name, bool async, EA::Types::ArrayIn read, EA::Types::FunctionIn handler);
			virtual void AddActionHandler(const char* name, bool async, const char** read, EA::Types::FunctionIn handler);

			virtual void RemoveActionHandler(const char* name);

			virtual void SetLoadFailureHandler(EA::Types::FunctionIn handler);
		
			virtual void SaveConfiguration(EA::Types::FunctionIn callback);
			virtual void LoadConfiguration(EA::Types::FunctionIn callback, EA::Types::BaseTypeIn configuration);

            virtual void AddListener(const char* name, EA::Types::ArrayIn filter, EA::Types::FunctionIn listener);
			virtual void AddListener(const char* name, const char** filter, EA::Types::FunctionIn listener);

			virtual void RemoveListener(const char* name);
            
#if !defined(EA_FINAL)

			virtual void GetStates(EA::Types::FunctionIn callback);

			virtual void GetTransitionEvents(EA::Types::FunctionIn callback);

			virtual void Auto(EA::Types::FunctionIn callback, 
							  EA::Types::FunctionIn defaultHandler, 
							  const char* hintFile, 
							  const char* excludeFile, 
							  EA::Types::ArrayIn targets, 
							  int maxNodes);

			virtual void AddAutoHandler(const char* name, EA::Types::FunctionIn helper);
			virtual void RemoveAutoHandler(const char* name);
            
            virtual void GetConfiguration(EA::Types::FunctionIn callback);
            
            virtual void Reload(EA::Types::FunctionIn callback, const char* name);
#endif // !EA_FINAL

		protected:

			EA::Types::ObjectRef	mObject;
		};
	}
}

#endif /* EANAV_NAVOBJECT_H_ */
