5#include "AttachmentPicker.h"
6#include "Blueprint/UserWidget.h"
7#include "Channel/ChatChannel.h"
8#include "Common/IconButton.h"
9#include "Components/Border.h"
10#include "Components/Button.h"
11#include "Components/Image.h"
12#include "Components/TextBlock.h"
13#include "CoreMinimal.h"
14#include "MessageInputWidget.h"
15#include "Types/SlateEnums.h"
17#include "MessageComposerWidget.generated.h"
23class STREAMCHATUI_API UMessageComposerWidget final : public UUserWidget
28 virtual
void NativeOnInitialized() override;
29 virtual
void NativeConstruct() override;
30 virtual
void NativeDestruct() override;
33 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSendMessage, const FString&, MessageText);
34 UPROPERTY(BlueprintAssignable)
35 FOnSendMessage OnSendMessage;
37 UFUNCTION(BlueprintCallable, Category = "Stream Chat")
38 void EditMessage(const
FMessage& Message);
41 void OnThreadChanged(
bool bThreadOpen, const
FMessage& ParentMessage);
44 UPROPERTY(meta = (BindWidget))
45 UMessageInputWidget* MessageInput;
47 UPROPERTY(meta = (BindWidget))
50 UPROPERTY(meta = (BindWidget))
51 UButton* CancelEditingButton;
53 UPROPERTY(meta = (BindWidget))
54 UPanelWidget* CancelEditingHeaderPanel;
56 UPROPERTY(meta = (BindWidget))
57 UTextBlock* EditMessageTextBlock;
59 UPROPERTY(meta = (BindWidget))
60 UBorder* BackgroundBorder;
62 UPROPERTY(meta = (BindWidget))
63 UImage* TopBorderImage;
65 UPROPERTY(EditAnywhere, Category = "Icon")
66 UTexture2D* IconTextureSend;
68 UPROPERTY(EditAnywhere, Category = "Icon")
69 UTexture2D* IconTextureConfirm;
71 UPROPERTY(EditAnywhere, Category = "Icon")
72 FMargin IconPaddingSend;
74 UPROPERTY(EditAnywhere, Category = "Icon")
75 FMargin IconPaddingConfirm;
83 UPROPERTY(EditAnywhere, Category = "Icon")
84 UTexture2D* IconTextureAttach;
86 UPROPERTY(EditAnywhere, Category = "Attachment")
87 FVector2D AttachButtonSize = FVector2D{32.f, 32.f};
90 UPROPERTY(EditAnywhere, Category =
"Thread")
91 FText ThreadHeaderText = NSLOCTEXT("StreamChat", "ReplyingInThread", "Replying in thread");
94 UPROPERTY(EditAnywhere, Category = "Attachment", meta = (ClampMin = "0.1", ClampMax = "1.0"))
95 float AttachGlyphScale = 0.5f;
98 UPROPERTY(EditAnywhere, Category = "Attachment", meta = (ClampMin = "0.01", ClampMax = "0.5"))
99 float AttachGlyphThickness = 0.06f;
103 void OnInputTextChanged(const FText&
Text);
105 void OnInputTextCommit(const FText&
Text, ETextCommit::
Type CommitMethod);
107 void OnCancelEditingButtonClicked();
109 void OnSendButtonClicked();
111 void OnAttachButtonClicked();
114 void StopEditMessage();
119 void CreateAttachmentWidgets();
120 UWidget* BuildAttachIcon();
121 UWidget* BuildAttachGlyph();
123 void SetStatus(const FString& Status);
124 void UpdateAttachmentAppearance();
126 void UpdateSendButtonAppearance(
bool bEnabled);
128 void RefreshSendButtonEnabled();
130 enum class ESendButtonIconAppearance
135 void UpdateEditMessageAppearance(ESendButtonIconAppearance Appearance);
139 void UpdateHeaderBanner();
141 TOptional<FMessage> EditedMessage;
144 TOptional<FMessage> ThreadParentMessage;
147 FText DefaultHeaderText;
151 TArray<FAttachment> PendingAttachments;
155 UButton* AttachButton;
158 UWidget* AttachButtonIcon;
161 TArray<UImage*> AttachGlyphBars;
163 UTextBlock* AttachStatusTextBlock;
166 bool bUploading =
false;
@ Text
Text of the message.
@ Type
Type of the message.
Represents a Stream Chat message.
Definition Message.h:70
A file the app picked, ready to be uploaded and attached to a message.
Definition AttachmentPicker.h:12