//
// Copyright © Vectorworks, Inc. 2008.
// All Rights Reserved.
// 

#pragma once

#include "IExtensionApp.h"

namespace VectorWorks
{
	namespace PluginSupport
	{
		// ----------------------------------------------------------------------------------------------------
		enum EParametricSubType
		{
			kParametricSubType_Point		= 0,	// for Point Plug-in Objects that insert like symbols 
			kParametricSubType_Linear		= 10,	// for Linear Plug-in Objects 
			kParametricSubType_Rectangular	= 20,	// for Rectangular Plug-in Objects 
			kParametricSubType_2DPath		= 30,	// for 2D Path Plug-in Objects 
			kParametricSubType_3DPath		= 40,	// for 3D Path Plug-in Objects
			kParametricSubType_Custom		= 50,	// for Custom control points based object
		};

		// ----------------------------------------------------------------------------------------------------
		// {E522A21B-4351-4e67-8858-3689F443A92F}
		static const VWGroupID GROUPID_ParametricApp = { 0xe522a21b, 0x4351, 0x4e67, { 0x88, 0x58, 0x36, 0x89, 0xf4, 0x43, 0xa9, 0x2f } };

		// ----------------------------------------------------------------------------------------------------
		class DYNAMIC_ATTRIBUTE IParametricApp : public IExtensionApp
		{
		public:
			virtual TXString VCOM_CALLTYPE		GetLocalizedName() = 0;
			virtual void VCOM_CALLTYPE			GetObjectInfo(Sint32& outVersion, EParametricSubType& outType) = 0;
			virtual void VCOM_CALLTYPE			GetResetModeOnMove(bool& outOnMove, bool& outOnRotate)											{ outOnMove = outOnRotate = false; }
			virtual void VCOM_CALLTYPE			GetWallInsertMode(bool& outOnEdge, bool& outNoBreak, bool& outHalfBreak, bool& outHideCaps)		{ outOnEdge = outNoBreak = outHalfBreak = outHideCaps = false; }
		};

		// ----------------------------------------------------------------------------------------------------
		// {F12F673D-4BCD-419c-923F-1BD6EE4E5D46}
		static const TSinkIID IID_ParametricParamsProvider = { 0xf12f673d, 0x4bcd, 0x419c, { 0x92, 0x3f, 0x1b, 0xd6, 0xee, 0x4e, 0x5d, 0x46 } };
		// ----------------------------------------------------------------------------------------------------
		class DYNAMIC_ATTRIBUTE IParametricParamsProvider : public IExtensionSink
		{
		public:
			virtual size_t VCOM_CALLTYPE		GetParamsCount() = 0;
			virtual void VCOM_CALLTYPE			GetParamAt(size_t paramIndex, TXString& outUniversalName, EFieldStyle& outType) = 0;
			virtual void VCOM_CALLTYPE			GetParamDefValueImperial(size_t paramIndex, TXString& outValue) = 0;
			virtual void VCOM_CALLTYPE			GetParamDefValueMetric(size_t paramIndex, TXString& outValue) = 0;
			virtual void VCOM_CALLTYPE			GetParamDefValueChoices(size_t paramIndex, TXStringArray& outArrUniversalNames, TXStringArray& outArrDisplayNames) = 0;
		};

		// ----------------------------------------------------------------------------------------------------
		// {D71D6552-F535-4051-B735-DCC108ED5EBD}
		static const TSinkIID IID_ParametricParamsResProvider = { 0xd71d6552, 0xf535, 0x4051, { 0xb7, 0x35, 0xdc, 0xc1, 0x8, 0xed, 0x5e, 0xbd } };
		// ----------------------------------------------------------------------------------------------------
		class DYNAMIC_ATTRIBUTE IParametricParamsResProvider : public IExtensionSink
		{
		public:
			// ... request parameters from resources ...
		};

		// ----------------------------------------------------------------------------------------------------
		// {2BAD0312-F3C4-469c-9FF5-5A966FFEDD3B}
		static const TSinkIID IID_ParametricEventSink = { 0x2bad0312, 0xf3c4, 0x469c, { 0x9f, 0xf5, 0x5a, 0x96, 0x6f, 0xfe, 0xdd, 0x3b } };
		// ----------------------------------------------------------------------------------------------------
		class DYNAMIC_ATTRIBUTE IParametricEventSink : public IExtensionSink
		{
		public:
			virtual VCOMError VCOM_CALLTYPE		InitProperties(const CodeRefID& codeRefID)		{ return kVCOMError_NotImplemented; }
			virtual VCOMError VCOM_CALLTYPE		ShowPreferences(MCObjectHandle hObject)			{ return kVCOMError_NotImplemented; }
			virtual TXString VCOM_CALLTYPE		GetToolName(MCObjectHandle hObject)				{ return ""; }
			virtual VCOMError VCOM_CALLTYPE		Recalculate(MCObjectHandle hObject) = 0;
		};
	}
}
