#pragma once

#include "CoreMinimal.h"
#include "CoreTabContainerWidget.h"
#include "Input/Events.h"
#include "TabWidgetData.h"
#include "DBDDropDownListWidget.generated.h"

class UCoreButtonWidget;
class UCoreSelectableButtonWidget;

UCLASS(Blueprintable, EditInlineNew)
class UDBDDropDownListWidget : public UCoreTabContainerWidget
{
	GENERATED_BODY()

public:
	DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSelectedOptionDelegate, FTabWidgetData, buttonData);

public:
	UPROPERTY(BlueprintReadWrite, BlueprintAssignable)
	FOnSelectedOptionDelegate OnSelectedOptionDelegate;

private:
	UPROPERTY(BlueprintReadWrite, meta=(AllowPrivateAccess=true, BindWidgetOptional))
	UCoreButtonWidget* _triggerButton;

public:
	UFUNCTION(BlueprintCallable)
	void UpdateDropDown();

	UFUNCTION(BlueprintCallable)
	void UnbindFromTrigger();

protected:
	UFUNCTION()
	void OnUserClicked(const FPointerEvent& mouseEvent);

private:
	UFUNCTION(BlueprintCallable)
	void OnTriggerClicked(UCoreButtonWidget* buttonTarget);

protected:
	UFUNCTION(BlueprintCallable)
	void OnOptionSelected(UCoreSelectableButtonWidget* selectedButton);

private:
	UFUNCTION(BlueprintCallable)
	void HideDropDownList();

public:
	UFUNCTION(BlueprintCallable)
	void BindToTrigger(UCoreButtonWidget* triggerButton);

public:
	UDBDDropDownListWidget();
};

FORCEINLINE uint32 GetTypeHash(const UDBDDropDownListWidget) { return 0; }
