UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AndroidWebBrowserWidget.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6
7#if USE_ANDROID_JNI
8
13#include "Android/AndroidJava.h"
14#include "RHI.h"
15#include "RHIResources.h"
16#include "UObject/Class.h"
19#include "Engine/Texture2D.h"
21#include "WebBrowserTexture.h"
22
23#include <jni.h>
24
27
29{
31 : _InitialURL("about:blank")
33 { }
34
35 SLATE_ARGUMENT(FString, InitialURL);
39
41
42public:
44
45 void Construct(const FArguments& Args);
46
47 virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
48 virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
49 virtual FVector2D ComputeDesiredSize(float) const override;
50
51 void ExecuteJavascript(const FString& Script);
52 void LoadURL(const FString& NewURL);
53 void LoadString(const FString& Content, const FString& BaseUrl);
54
55 void StopLoad();
56 void Reload();
57 void Close();
58 void ShowFloatingCloseButton(bool bShow, bool bDraggable);
59 void GoBack();
60 void GoForward();
61 bool CanGoBack();
62 bool CanGoForward();
64
66 virtual FReply OnMouseButtonUp(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
68
72
76
77 // WebViewClient callbacks
78
80
83 {
85 return HandleJsDialog(Dialog);
86 }
87
89 {
91 return HandleJsDialog(Dialog);
92 }
93
95 void HandlePageLoad(jstring JUrl, bool bIsLoading, int InHistorySize, int InHistoryPosition);
97
98 // Helper to get the native widget pointer from a Java callback.
99 // Jobj can either be a WebViewControl, a WebViewControl.ViewClient or WebViewControl.ChromeClient instance
101
102 //set the native control's visibility
104protected:
107
109 int HistorySize;
110 int HistoryPosition;
111
113private:
115
118
121
123 bool bMouseCapture;
124
127
130
133
136
139
142};
143
144#endif // USE_ANDROID_JNI
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
#define SLATE_BEGIN_ARGS(InWidgetType)
Definition DeclarativeSyntaxSupport.h:63
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
JsonWriter Close()
EWebBrowserDialogType
Definition IWebBrowserDialog.h:12
void Construct(const FArguments &InArgs)
virtual FReply OnMouseButtonDown(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
Definition PaintArgs.h:23
Definition Reply.h:24
Definition SlateRect.h:26
Definition DrawElements.h:220
Definition WebBrowserTextureSample.h:406
Definition WidgetStyle.h:15
Definition SViewport.h:31
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SharedPointer.h:1295
Definition MaterialExpressionTextureSample.h:31
Definition MaterialInstanceDynamic.h:15
Definition WebBrowserTexture.h:26
Definition WebBrowserTexture.Build.cs:7
@ false
Definition radaudio_common.h:23
Definition Events.h:606
Definition Geometry.h:40
Definition Events.h:431
Definition Events.h:695