#pragma once

#include "CoreMinimal.h"
#include "StoreCollectionsListViewInterface.h"
#include "CoreBaseUserWidget.h"
#include "Templates/SubclassOf.h"
#include "CoreStoreCollectionsListWidget.generated.h"

class UDBDTextBlock;
class UCoreInfoMessageWidget;
class UCoreSearchBarWidget;
class UUniformGridPanel;
class UPanelWidget;
class UDBDScrollBox;
class UCoreStoreCollectionsItemWidget;
class UCorePreConstructableList;
class UCoreButtonWidget;

UCLASS(Blueprintable, EditInlineNew)
class UCoreStoreCollectionsListWidget : public UCoreBaseUserWidget, public IStoreCollectionsListViewInterface
{
	GENERATED_BODY()

protected:
	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDTextBlock* TitleTB;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreInfoMessageWidget* EmptyContentWidget;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreSearchBarWidget* SearchBar;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UUniformGridPanel* FeaturedUniformGrid;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UUniformGridPanel* AllUniformGrid;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UPanelWidget* FeaturedContainer;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDScrollBox* CollectionsListScrollBox;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UCoreStoreCollectionsItemWidget> _collectionItemClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	int32 _featuredItemsColumnCount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	int32 _allItemsColumnCount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	int32 _preConstructedFeaturedItemsCount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	int32 _preConstructedAllItemsCount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _featuredListHiddenThreshold;

private:
	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UCorePreConstructableList* _featuredItemsList;

	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UCorePreConstructableList* _allItemsList;

private:
	UFUNCTION(BlueprintCallable)
	void UpdateTitleFromScroll(float currentOffset);

	UFUNCTION(BlueprintCallable)
	void OnCollectionItemClicked(UCoreButtonWidget* target);

public:
	UCoreStoreCollectionsListWidget();
};

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