#pragma once

#include "CoreMinimal.h"
#include "CinematicViewInterface.h"
#include "CoreBaseUserWidget.h"
#include "UObject/NoExportTypes.h"
#include "CoreBinkVideoPlayerWidget.generated.h"

class UCanvasPanel;
class UDBDImage;
class USizeBox;
class UScaleBox;
class UImage;
class UCoreInputSwitcherWidget;
class UBinkMediaPlayer;
class UUITweenInstance;

UCLASS(Blueprintable, EditInlineNew)
class DBDUIVIEWSCORE_API UCoreBinkVideoPlayerWidget : public UCoreBaseUserWidget, public ICinematicViewInterface
{
	GENERATED_BODY()

public:
	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCanvasPanel* VideoBinkCanvas;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UDBDImage* VideoBinkBG;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	USizeBox* VideoBinkSizeBox;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UScaleBox* VideoBinkScaleBox;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UImage* VideoBinkImage;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UCoreInputSwitcherWidget* SkipInputSwitcher;

private:
	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UBinkMediaPlayer* _binkMediaPlayer;

public:
	UFUNCTION(BlueprintCallable)
	void SetSize_Implementation(FVector2D size);

	UFUNCTION(BlueprintCallable)
	void OnSubtitlesChanged(const TArray<FString>& subtitlesText);

private:
	UFUNCTION(BlueprintCallable)
	void OnSkipInputSwitcherTriggered();

public:
	UFUNCTION(BlueprintCallable)
	void OnMediaOpened(const FString& openedUrl);

	UFUNCTION(BlueprintCallable)
	void OnMediaClosed();

	UFUNCTION(BlueprintCallable)
	void OnGameUnfocus(bool bIsUnfocused);

private:
	UFUNCTION(BlueprintCallable)
	void OnFadeOutAnimationComplete(UUITweenInstance* tween);

	UFUNCTION(BlueprintCallable)
	void OnFadeInAnimationComplete(UUITweenInstance* tween);

public:
	UFUNCTION(BlueprintCallable)
	void OnEndReached();

	UFUNCTION(BlueprintCallable)
	void FadeOutAnimation_Implementation(const float fadeOutDuration, const float delay);

	UFUNCTION(BlueprintCallable)
	void FadeInAnimation_Implementation(const float fadeInDuration, const float delay);

public:
	UCoreBinkVideoPlayerWidget();
};

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