Stream Chat Unreal SDK
Loading...
Searching...
No Matches
ContextMenuAction.h
1// Copyright 2022 Stream.IO, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Channel/Message.h"
6#include "Components/Widget.h"
7#include "CoreMinimal.h"
8#include "Engine/Texture2D.h"
9#include "Message/MessageSide.h"
10#include "UObject/NoExportTypes.h"
11
12#include "ContextMenuAction.generated.h"
13
14class UChatChannel;
16
17UENUM()
18enum class EContextMenuButtonStyle : uint8
19{
20 Standard,
21 Negative,
22};
23
27UCLASS(Abstract, Blueprintable, EditInlineNew)
28class STREAMCHATUI_API UContextMenuAction : public UObject
29{
30 GENERATED_BODY()
31
32public:
33 UPROPERTY(EditAnywhere, Category = Visuals)
34 FText Label;
35 UPROPERTY(EditAnywhere, Category = Visuals)
36 UTexture2D* IconTexture;
37 UPROPERTY(EditAnywhere, Category = Visuals)
38 EContextMenuButtonStyle Style;
39
40 void SetContext(UStreamChatClientComponent*, UChatChannel*);
41 void Perform(const FMessage&, UWidget* OwningWidget);
42 bool ShouldDisplay(EMessageSide, const FMessage&) const;
43
44protected:
45 virtual void OnPerform(const FMessage&, UWidget* OwningWidget);
46 virtual bool OnShouldDisplay(EMessageSide, const FMessage&) const;
47
48 UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "On Perform"))
49 void OnPerformBlueprint(const FMessage& Message, UWidget* OwningWidget);
50 UFUNCTION(BlueprintNativeEvent, meta = (DisplayName = "Should Display"))
51 bool OnShouldDisplayBlueprint(EMessageSide Side, const FMessage& Message) const;
52
53 UPROPERTY(BlueprintReadOnly, Transient, Category = Stream)
55 UPROPERTY(BlueprintReadOnly, Transient, Category = Stream)
56 UChatChannel* Channel;
57};
The client-side representation of a Stream Chat channel.
Definition: ChatChannel.h:74
A component which allows for connecting to the Stream Chat API. Should be added to a client-side acto...
Definition: StreamChatClientComponent.h:42
Represents a Stream Chat message.
Definition: Message.h:66