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

#pragma once

#include "IExtensionApp.h"

namespace VectorWorks
{
	namespace PluginSupport
	{
		// ----------------------------------------------------------------------------------------------------
		// {74253F0F-AC9A-4411-9BC1-D388D4AD97D0}
		static const VWGroupID GROUPID_MenuApp = { 0x74253f0f, 0xac9a, 0x4411, { 0x9b, 0xc1, 0xd3, 0x88, 0xd4, 0xad, 0x97, 0xd0 } };

		// ----------------------------------------------------------------------------------------------------
		// Abstract class base for menu extension application
		class DYNAMIC_ATTRIBUTE IMenuApp : 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		GetContextualHelpID() = 0;
			virtual	void VCOM_CALLTYPE			GetNeedsFlags(Uint16& outNeeds, Uint16& outNeedsNot)						{ outNeeds = outNeedsNot = 0; }
			virtual	void VCOM_CALLTYPE			GetVersionInfo(Sint16& outCreated, Sint16& outModified, Sint16& outRetired) = 0;
		};

		// ----------------------------------------------------------------------------------------------------
		// {2BAD0312-F3C4-469c-9FF5-5A966FFEDD3B}
		static const TSinkIID IID_MenuChunkProvider = { 0x2bad0312, 0xf3c4, 0x469c, { 0x9f, 0xf5, 0x5a, 0x96, 0x6f, 0xfe, 0xdd, 0x3b } };
		// ----------------------------------------------------------------------------------------------------
		class DYNAMIC_ATTRIBUTE IMenuChunkProvider : public IExtensionSink
		{
		public:
			virtual size_t VCOM_CALLTYPE		GetItemsCount() = 0;
			virtual TXString VCOM_CALLTYPE		GetItemTitle(size_t index) = 0;
  		};

		// ----------------------------------------------------------------------------------------------------
		// {2BAD0312-F3C4-469c-9FF5-5A966FFEDD3B}
		static const TSinkIID IID_MenuEventSink = { 0x2bad0312, 0xf3c4, 0x469c, { 0x9f, 0xf5, 0x5a, 0x96, 0x6f, 0xfe, 0xdd, 0x3b } };
		// ----------------------------------------------------------------------------------------------------
		class DYNAMIC_ATTRIBUTE IMenuEventSink : public IExtensionSink
		{
		public:
			virtual VCOMError VCOM_CALLTYPE		DoInterface(MenuChunkInfo* pMenuChunkInfo) = 0;
			virtual bool VCOM_CALLTYPE			GetItemEnabled(bool bCurrentCondition)		{ return true; }
			virtual bool VCOM_CALLTYPE			CheckHilite(MenuChunkInfo* pMenuChunkInfo)	{ return false; }
		};
	}
}
