Stream Chat Unreal SDK
Loading...
Searching...
No Matches
MessageInputWidget.h
1// Copyright 2022 Stream.IO, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Components/Border.h"
6#include "Components/EditableTextBox.h"
7#include "CoreMinimal.h"
8#include "StreamWidget.h"
9
10#include "MessageInputWidget.generated.h"
11
15UCLASS()
16class STREAMCHATUI_API UMessageInputWidget final : public UStreamWidget
17{
18 GENERATED_BODY()
19
20public:
21 UMessageInputWidget();
22 virtual void SynchronizeProperties() override;
23
24 UFUNCTION(BlueprintCallable, Category = Widget)
25 FText GetText() const;
26
27 UFUNCTION(BlueprintCallable, Category = Widget)
28 void SetText(FText InText);
29
31 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Content)
32 FText HintText;
33
34 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEditableTextBoxChangedEvent, const FText&, Text);
35 DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnEditableTextBoxCommittedEvent, const FText&, Text, ETextCommit::Type, CommitMethod);
37 UPROPERTY(BlueprintAssignable, Category = "TextBox|Event")
38 FOnEditableTextBoxChangedEvent OnTextChanged;
39
41 UPROPERTY(BlueprintAssignable, Category = "TextBox|Event")
42 FOnEditableTextBoxCommittedEvent OnTextCommitted;
43
44protected:
45 UPROPERTY(meta = (BindWidget))
46 UEditableTextBox* TextBox;
47 UPROPERTY(meta = (BindWidget))
48 UBorder* Border;
49
50private:
51 virtual void NativePreConstruct() override;
52 virtual void NativeConstruct() override;
53 virtual void NativeDestruct() override;
54 virtual FReply NativeOnFocusReceived(const FGeometry& InGeometry, const FFocusEvent& InFocusEvent) override;
55
56 UFUNCTION()
57 void OnInputTextChanged(const FText& Text);
58 UFUNCTION()
59 void OnInputTextCommit(const FText& Text, ETextCommit::Type CommitMethod);
60};
@ Text
Text of the message.
@ Type
Type of the message.