SDK for / Overview

XsollaWebBrowser.h

1// Copyright 2024 Xsolla Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Components/Widget.h"
6
7#include "XsollaWebBrowser.generated.h"
8
9UCLASS()
10class XSOLLAWEBBROWSER_API UXsollaWebBrowser : public UWidget
11{
12GENERATED_UCLASS_BODY()
13
14public:
15DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnUrlChanged, const FText&, Text);
16DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnBeforePopup, FString, URL, FString, Frame);
17DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnPageLoaded);
18
24UFUNCTION(BlueprintCallable, Category = "Xsolla|Web Browser")
25void LoadURL(FString NewURL);
26
32UFUNCTION(BlueprintCallable, Category = "Xsolla|Web Browser")
33void LoadHtml(FString Contents, FString DummyURL);
34
40UFUNCTION(BlueprintCallable, Category = "Xsolla|Web Browser")
41void ExecuteJavascript(FString ScriptText);
42
48UFUNCTION(BlueprintCallable, Category = "Xsolla|Web Browser")
49FString GetUrl() const;
50
55UFUNCTION(BlueprintCallable, Category = "Xsolla|Web Browser")
56void ClearCache() const;
57
62UFUNCTION(BlueprintCallable, Category = "Xsolla|Web Browser")
63void GoBack() const;
64
69UFUNCTION(BlueprintCallable, Category = "Xsolla|Web Browser")
70void GoForward() const;
71
73UPROPERTY(BlueprintAssignable, Category = "Xsolla|Web Browser")
74FOnUrlChanged OnUrlChanged;
75
77UPROPERTY(BlueprintAssignable, Category = "Xsolla|Web Browser")
78FOnBeforePopup OnBeforePopup;
79
81UPROPERTY(BlueprintAssignable, Category = "Xsolla|Web Browser")
82FOnPageLoaded OnPageLoaded;
83
84public:
85virtual void ReleaseSlateResources(bool bReleaseChildren) override;
86
87#if WITH_EDITOR
88virtual const FText GetPaletteCategory() override;
89#endif
90
91protected:
93UPROPERTY(EditAnywhere, Category = Appearance)
94FString InitialURL;
95
97UPROPERTY(EditAnywhere, Category = Appearance)
98bool bSupportsTransparency;
99
100protected:
101TSharedPtr<class SWebBrowser> WebBrowserWidget;
102
103protected:
104// UWidget interface
105virtual TSharedRef<SWidget> RebuildWidget() override;
106// End of UWidget interface
107
108void HandleOnUrlChanged(const FText& Text);
109bool HandleOnBeforePopup(FString URL, FString Frame);
110void HandleOnPageLoaded();
111};
Definition: XsollaWebBrowser.h:11