// Copyright (c) 2024 Codemongous LLC. All Rights Reserved.

#pragma once

#include <memory>
#include <string>
#include <vector>

using std::shared_ptr;
using std::vector;
using std::wstring;

namespace Sourcify
{	
	class ISCW_UEdGraphNode;
	class ISCW_FEdGraphPinType;
	class ISCW_UEdGraphSchema;
	class ISCW_UObject;

	enum class SCW_EEdGraphPinDirection : int32_t
	{
		EGPD_Input,
		EGPD_Output,
		EGPD_MAX,
	};

	class ISCW_UEdGraphPin
	{
	public:
		virtual ~ISCW_UEdGraphPin() = default;

		virtual void BreakAllPinLinks(bool bNotifyNodes = false) = 0;

		virtual wstring GetDefaultValue() const = 0;

		virtual shared_ptr<ISCW_UObject> GetDefaultObject() const = 0;
		
		virtual wstring GetDefaultTextValue() const = 0;

		virtual bool GetDefaultValueIsReadOnly() const = 0;

		virtual wstring GetDisplayName() const = 0;

		virtual bool GetIsOrphaned() const = 0;

		virtual vector<shared_ptr<ISCW_UEdGraphPin>> GetLinkedTo() const = 0;

		virtual shared_ptr<ISCW_UEdGraphNode> GetOwningNode() const = 0;
		
		virtual shared_ptr<ISCW_UEdGraphNode> GetOwningNodeUnchecked() const = 0;

		virtual bool IsOwningNodeEqualToUnchecked(shared_ptr<ISCW_UEdGraphNode> Node) const = 0;

		virtual shared_ptr<ISCW_UEdGraphPin> GetParentPin() const = 0;

		virtual vector<shared_ptr<ISCW_UEdGraphPin>> GetSubPins() const = 0;

		virtual SCW_EEdGraphPinDirection GetPinDirection() const = 0;

		virtual wstring GetPinFriendlyName() const = 0;

		virtual wstring GetPinID() const = 0;

		virtual wstring GetPinName() const = 0;

		virtual shared_ptr<ISCW_FEdGraphPinType> GetPinType() const = 0;

		virtual shared_ptr<const ISCW_UEdGraphSchema> GetSchema() const = 0;

		virtual bool ISCW_Equals(const ISCW_UEdGraphPin& Other) const = 0;

		virtual bool ISCW_Equals(shared_ptr<const ISCW_UEdGraphPin> Other) const = 0;

		virtual bool Less(const ISCW_UEdGraphPin& Other) const = 0;

		virtual bool LinkedTo_IsEmpty() const = 0;

		virtual void MakeLinkTo(shared_ptr<ISCW_UEdGraphPin> ToPin) const = 0;

		virtual void MovePersistentDataFromOldPin(shared_ptr<ISCW_UEdGraphPin> SourcePinPtr) = 0;

		virtual void SetDefaultValue(wstring InDefaultValue) const = 0;

		virtual void SetDefaultObject(shared_ptr<ISCW_UObject> InObjectPtr) const = 0;
		
		virtual void SetDefaultTextValue(wstring InDefaultValue) const = 0;

		virtual void SetPinDirection(SCW_EEdGraphPinDirection Direction) const = 0;

		virtual void SetPinName(const wstring& Name) const = 0;

		virtual void SetSavePinIfOrphaned(bool bShouldSave) const = 0;

		virtual shared_ptr<ISCW_UEdGraphPin> ToUEdGraphPinPtr() = 0;
		virtual shared_ptr<const ISCW_UEdGraphPin> ToUEdGraphPinPtr() const = 0;

		virtual bool WasTrashed() const = 0;
	};

	using ISCW_UEdGraphPinConstPtr = shared_ptr<const ISCW_UEdGraphPin>;
	using ISCW_UEdGraphPinPtr = shared_ptr<ISCW_UEdGraphPin>;
} // namespace Sourcify

#include "ISCW_Helpers.h"