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

#pragma once

#include "IExtensionApp.h"

namespace VectorWorks
{
	namespace PluginSupport
	{
		enum EToolBarDisplay
		{
			kToolBarDisplay_NoDataBar,          // barDisplay mode
			kToolBarDisplay_XYClLaZo=1,
			kToolBarDisplay_XY,
			kToolBarDisplay_SaAaLAXY,
			kToolBarDisplay_DxDyRaAXY,
			kToolBarDisplay_DxDyTlAXY,
			kToolBarDisplay_DxDyRXY,
			kToolBarDisplay_DxDyLAXY,
			kToolBarDisplay_DxDyArPeXY,
			kToolBarDisplay_A=9,
			kToolBarDisplay_DxDyLOXY,
			kToolBarDisplay_DxDySxSyXY,
			kToolBarDisplay_XYZClLaZo,
			kToolBarDisplay_VxVyVzYaPi=13,
			kToolBarDisplay_Vz,
			kToolBarDisplay_Da,
			kToolBarDisplay_AzEl,
			kToolBarDisplay_AzElRo,
			kToolBarDisplay_VxVyVzLrUdIo,
			kToolBarDisplay_U1Aw,
			kToolBarDisplay_ThXYZ,
			kToolBarDisplay_O1O2WrWhZ,
			kToolBarDisplay_WbWtDz,
			kToolBarDisplay_XYU1,
			kToolBarDisplay_RaRrRuXYZ,
			kToolBarDisplay_ClLaZo,
		};

		// ----------------------------------------------------------------------------------------------------
		// {A90DECBC-4893-48ee-A1B2-CE20E371972C}
		static const VWGroupID GROUPID_ToolApp = { 0xa90decbc, 0x4893, 0x48ee, { 0xa1, 0xb2, 0xce, 0x20, 0xe3, 0x71, 0x97, 0x2c } };
		// ----------------------------------------------------------------------------------------------------
		class DYNAMIC_ATTRIBUTE IToolApp : public IExtensionApp
		{
		public:
			virtual TXString VCOM_CALLTYPE			GetTitle() = 0;
			virtual TXString VCOM_CALLTYPE			GetCategory() = 0;
			virtual TXString VCOM_CALLTYPE			GetHelpText() = 0;
			virtual TXString VCOM_CALLTYPE			GetMessage() = 0;
			virtual TXString VCOM_CALLTYPE			GetContextualHelpID() = 0;
			virtual bool VCOM_CALLTYPE				GePickAndUpdate() = 0;
			virtual bool VCOM_CALLTYPE				GetNeedPlan() = 0;
			virtual bool VCOM_CALLTYPE				GetNeed3DProjection() = 0;
			virtual bool VCOM_CALLTYPE				GetUse2DCursor() = 0;
			virtual bool VCOM_CALLTYPE				GetConstrainCursor() = 0;
			virtual bool VCOM_CALLTYPE				GetNeedPerspective() = 0;
			virtual bool VCOM_CALLTYPE				GetShowScreenHints() = 0;
			virtual Sint16 VCOM_CALLTYPE			GetIconID() = 0;
			virtual Sint16 VCOM_CALLTYPE			GetDefaultCursorID() = 0;
			virtual Sint16 VCOM_CALLTYPE			GetWaitMoveDistance() = 0;
			virtual Sint16 VCOM_CALLTYPE			GetConstraintFlags() = 0;
			virtual EToolBarDisplay VCOM_CALLTYPE	GetBarDisplay() = 0;
			virtual	Sint16 VCOM_CALLTYPE			GetMinimumCompatibleVersion() = 0;
			virtual	void VCOM_CALLTYPE				GetVersionInfo(Sint16& outCreated, Sint16& outModified, Sint16& outRetired) = 0;

		};

		// ----------------------------------------------------------------------------------------------------
		// {066B9541-08CC-47aa-91A2-BD997B8BA7D5}
		static const TSinkIID IID_ToolEventSink = { 0x66b9541, 0x8cc, 0x47aa, { 0x91, 0xa2, 0xbd, 0x99, 0x7b, 0x8b, 0xa7, 0xd5 } };
		// ----------------------------------------------------------------------------------------------------
		class DYNAMIC_ATTRIBUTE IToolEventSink : public IExtensionSink
		{
		public:
			virtual	VCOMError	VCOM_CALLTYPE OnInitXProperties(CodeRefID codeRefID) = 0;

			virtual VCOMError	VCOM_CALLTYPE OnToolInitByObject(MCObjectHandle hObject) = 0;

			virtual VCOMError	VCOM_CALLTYPE DoSetUp(bool bRestore) = 0;
			virtual VCOMError	VCOM_CALLTYPE DoSetDown(bool bRestore) = 0;

			virtual Sint32		VCOM_CALLTYPE GetCursor() = 0;
			virtual Sint32		VCOM_CALLTYPE GetStatus() = 0;

			virtual VCOMError	VCOM_CALLTYPE PointAdded() = 0;
			virtual VCOMError	VCOM_CALLTYPE PointRemoved(bool bClearAllPts) = 0;
			virtual VCOMError	VCOM_CALLTYPE Draw() = 0;
			virtual VCOMError	VCOM_CALLTYPE MouseMove() = 0;
			virtual VCOMError	VCOM_CALLTYPE HandleComplete() = 0;
			virtual VCOMError	VCOM_CALLTYPE DoDoubleClick() = 0;

			virtual VCOMError	VCOM_CALLTYPE DoModeEvent(Uint32 modeGroupID, Uint32 newButtonID, Uint32 oldButtonID) = 0;
		};

		// ----------------------------------------------------------------------------------------------------
		// {3D187AED-C3E2-40a5-A2D6-EBD64EB82151}
		static const TSinkIID IID_ToolExEventSink = { 0x3d187aed, 0xc3e2, 0x40a5, { 0xa2, 0xd6, 0xeb, 0xd6, 0x4e, 0xb8, 0x21, 0x51 } };
		// ----------------------------------------------------------------------------------------------------
		class DYNAMIC_ATTRIBUTE IToolExEventSink : public IExtensionSink
		{
		public:
			virtual VCOMError	VCOM_CALLTYPE DrawingDoubleClick() = 0;
			virtual VCOMError	VCOM_CALLTYPE GenericStateChange() = 0;

			virtual VCOMError	VCOM_CALLTYPE OnSelectionChange() = 0;
			virtual VCOMError	VCOM_CALLTYPE OnCustomBar_Setup() = 0;
			virtual VCOMError	VCOM_CALLTYPE OnCustomBar_Setdown() = 0;
			virtual VCOMError	VCOM_CALLTYPE OnCustomBar_UpdateValues() = 0;
			virtual VCOMError	VCOM_CALLTYPE OnCustomBar_LockValue(Uint32 fieldIndex, const TXString& userString) = 0;
			virtual VCOMError	VCOM_CALLTYPE OnCustomBar_UnlockValue(Uint32 fieldIndex) = 0;

			virtual VCOMError	VCOM_CALLTYPE DoDrawScrMod() = 0;
			virtual VCOMError	VCOM_CALLTYPE DoUndrawScrMod() = 0;
		};
	}
}
