Unreal OpenAI API 1.0.0
AttachedImageWidget.h
1// OpenAI, Copyright LifeEXE. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "EditorUtilityWidget.h"
7#include "AttachedImageWidget.generated.h"
8
9class UButton;
10class UTextBlock;
11
12DECLARE_MULTICAST_DELEGATE_TwoParams(FOnRemoved, const FString&, const TObjectPtr<UAttachedImageWidget>&);
13
14UCLASS()
15class OPENAIEDITOR_API UAttachedImageWidget : public UEditorUtilityWidget
16{
17 GENERATED_BODY()
18
19public:
20 void SetImage(const FString& ImagePath);
21 FOnRemoved& OnRemoved() { return Removed; }
22
23protected:
24 virtual void NativeConstruct() override;
25
26 UPROPERTY(meta = (BindWidget))
27 TObjectPtr<UButton> RemoveImageButton;
28
29 UPROPERTY(meta = (BindWidget))
30 TObjectPtr<UTextBlock> FilePathTextBlock;
31
32private:
33 FOnRemoved Removed;
34 FString ImagePath{};
35
36 UFUNCTION()
37 void RemoveImage();
38};
Definition: AttachedImageWidget.h:16