//
//	Copyright © 2005 Nemetschek North America 
//	All Rights Reserved.
//
// Created by Vladislav Stanev

#pragma once


namespace VWFC
{
	using namespace Tools;
	
	namespace PluginSupport
	{
		// ---------------------------------------------------------------------------------
		class VWPluginLibraryArgTable;
		class VWPluginLibraryArgument
		{
			friend class VWPluginLibraryArgTable;
		public:
			virtual			~VWPluginLibraryArgument();

			short			GetArgInteger() const;
			short&			GetArgIntegerVar();
			void			SetArgInteger(short value);

			long			GetArgLong() const;
			long&			GetArgLongVar();
			void			SetArgLong(long value);

			double_gs		GetArgReal() const;
			double_gs&		GetArgRealVar();
			void			SetArgReal(double_gs value);

			double_gs		GetArgAngle() const;
			void			SetArgAngle(double_gs value);

			double_gs		GetArgDistance() const;
			void			SetArgDistance(double_gs value);

			_WorldPt		GetArgPoint() const;
			_WorldPt&		GetArgPointVar();
			void			SetArgPoint(const _WorldPt& value);

			_WorldPt3		GetArg3DPoint() const;
			_WorldPt3&		GetArg3DPointVar();
			void			SetArg3DPoint(const _WorldPt3& value);

			_WorldPt3		GetArgVector() const;
			_WorldPt3&		GetArgVectorVar();
			void			SetArgVector(const _WorldPt3& value);

			Boolean			GetArgBoolean() const;
			Boolean&		GetArgBooleanVar();
			void			SetArgBoolean(Boolean value);

			TXString		GetArgString() const;
			GSStr255&		GetArgStringVar();
			void			SetArgString(const TXString& value) const;

			unsigned char	GetArgChar() const;
			unsigned char&	GetArgCharVar();

			void*			GetArgVoidPtr() const;
			void			SetArgVoidPtr(void* ptr);

			MCObjectHandle	GetArgHandle() const;
			MCObjectHandle&	GetArgHandleVar() const;
			void			SetArgHandle(MCObjectHandle handle);

		protected:
							VWPluginLibraryArgument();

			PluginLibraryArg*		fpArgument;
		};

		
		// ---------------------------------------------------------------------------------
		class VWPluginLibraryArgTable
		{
		public:
										VWPluginLibraryArgTable();
										VWPluginLibraryArgTable(PluginLibraryArgTable* pArgTable);
			virtual						~VWPluginLibraryArgTable();

			VWPluginLibraryArgument&	GetArgument(size_t index);
			VWPluginLibraryArgument&	GetResult();

										operator PluginLibraryArgTable*();
		private:
			PluginLibraryArgTable		fNewArgTable;
			PluginLibraryArgTable*		fpArgTable;
			VWPluginLibraryArgument		farrArguments[ kMaxPluginLibraryArgs ];
			VWPluginLibraryArgument		fResultArgument;
		};
	}
}