38 #include "CoherentUIViewListener.h"
39 #include "CoherentMediaRequestHandler.h"
40 #include "CoherentUIJSEvent.h"
41 #include "CoherentUIJSPayload.h"
43 #include "CoherentBaseComponent.generated.h"
46 struct FCoherentComponentTickFunction : public FTickFunction
48 GENERATED_USTRUCT_BODY()
52 virtual
void ExecuteTick(
float DeltaTime, enum ELevelTick TickType, ENamedThreads::Type CurrentThread, const FGraphEventRef& MyCompletionGraphEvent) override;
53 virtual FString DiagnosticMessage();
56 DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FUIReadyForBindingsSignature, int32, frameId, const FString&, Path,
bool, isMainFrame);
57 DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FUIBindingsReleasedSignature, int32, frameId, const FString&, validatedPath,
bool, isMainFrame);
58 DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams(FUIFinishLoadSignature, int32, frameId, const FString&, validatedPath,
bool, isMainFrame, int32, statusCode);
59 DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams(FUIFailLoad, int32, frameId, const FString&, validatedPath,
bool, isMainFrame, const FString&, error);
60 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FUIOnNavigate, const FString&, url);
61 DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FUIScriptMessage, const FString&, message, const FString&, sourceId, int32, line);
62 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FUICursorChanged, int32, cursorId);
63 DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams(FUIJavaScriptMesssage, const FString&, message, const FString&, defaultPrompt, const FString&, frameURL, int32, type);
64 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FUIOnError, const FString&, error);
65 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FUIOnJavaScriptEvent,
UCoherentUIJSPayload*, payload);
66 DECLARE_DYNAMIC_MULTICAST_DELEGATE(FUIScriptingReady);
67 DECLARE_DYNAMIC_MULTICAST_DELEGATE(FUIOnViewCreated);
78 GENERATED_UCLASS_BODY()
81 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"View")
84 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "View", meta = (ClampMin = "0", UIMin = "0", UIMax = "4096"))
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "View", meta = (ClampMin = "0", UIMin = "0", UIMax = "4096"))
91 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "View")
95 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "View")
96 bool SupportClickThrough;
99 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "View", meta = (ClampMin = "1", UIMin = "1", UIMax = "120"))
103 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "View")
104 bool ForceSoftwareRendering;
107 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "View")
108 bool UseSharedMemory;
111 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "View")
115 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "View")
119 UPROPERTY(BlueprintAssignable)
120 FUIReadyForBindingsSignature ReadyForBindings;
123 UPROPERTY(BlueprintAssignable)
124 FUIBindingsReleasedSignature BindingsReleased;
127 UPROPERTY(BlueprintAssignable)
128 FUIFinishLoadSignature FinishLoad;
131 UPROPERTY(BlueprintAssignable)
132 FUIFailLoad FailLoad;
135 UPROPERTY(BlueprintAssignable)
136 FUIOnNavigate OnNavigate;
139 UPROPERTY(BlueprintAssignable)
140 FUIScriptMessage ScriptMessage;
143 UPROPERTY(BlueprintAssignable)
144 FUICursorChanged CursorChanged;
147 UPROPERTY(BlueprintAssignable)
148 FUIJavaScriptMesssage JavaScriptMessage;
151 UPROPERTY(BlueprintAssignable)
152 FUIOnError ErrorOccured;
155 UPROPERTY(BlueprintAssignable)
156 FUIOnJavaScriptEvent JavaScriptEvent;
159 UPROPERTY(BlueprintAssignable)
160 FUIScriptingReady UIScriptingReady;
163 UPROPERTY(BlueprintAssignable)
164 FUIOnViewCreated UIOnViewCreated;
167 UFUNCTION(BlueprintCallable, Category = "View")
171 UFUNCTION(BlueprintCallable, Category = "View")
172 void Resize(int32 resizeWidth, int32 resizeHeight);
175 UFUNCTION(BlueprintCallable, Category = "View")
176 void IssueMouseOnUIQuery(
float normX,
float normY);
179 UFUNCTION(BlueprintCallable, Category = "View")
180 bool HasMouseQueryFinished();
183 UFUNCTION(BlueprintCallable, Category = "View")
184 void FetchMouseOnUIQuery();
187 UFUNCTION(BlueprintCallable, Category = "View")
188 bool IsMouseOnView();
191 UFUNCTION(BlueprintCallable, Category = "View")
192 void SetClickThroughAlphaThreshold(
float threshold);
195 UFUNCTION(BlueprintCallable, Category = "View")
196 float GetClickThroughAlphaThreshold() const;
199 UFUNCTION(BlueprintCallable, Category = "View")
200 void SetTargetFramerate(int32 target);
203 UFUNCTION(BlueprintCallable, Category = "View")
204 int32 GetTargetFramerate() const;
207 UFUNCTION(BlueprintCallable, Category = "View")
208 bool IsViewOnDemand() const;
211 UFUNCTION(BlueprintCallable, Category = "View")
212 bool IsTransparent() const;
215 UFUNCTION(BlueprintCallable, Category = "View")
219 UFUNCTION(BlueprintCallable, Category = "View")
220 void Load(const FString& path);
223 UFUNCTION(BlueprintCallable, Category = "View")
224 void Reload(
bool ignoreCache);
227 UFUNCTION(BlueprintCallable, Category = "View")
228 FString GetCurentViewPath() const;
231 UFUNCTION(BlueprintCallable, Category = "View")
232 FString GetLastRequestedPath() const;
235 UFUNCTION(BlueprintCallable, Category = "View")
236 FString GetLastLoadedPath() const;
239 UFUNCTION(BlueprintCallable, Category = "View")
240 FString GetLastFailedPath() const;
243 UFUNCTION(BlueprintCallable, Category = "View")
244 UTexture2D* GetTexture() const;
247 UFUNCTION(BlueprintCallable, Category = "ViewScripting")
251 UFUNCTION(BlueprintCallable, Category = "ViewScripting")
255 UFUNCTION(BlueprintCallable, Category = "ViewScripting")
256 bool IsReadyForBindings() const;
259 UFUNCTION(BlueprintCallable, Category = "ViewScripting")
260 bool IsReadyForScripting() const;
263 virtual
void InitializeComponent();
264 virtual
void TickCustom(FCoherentComponentTickFunction* function);
266 FCoherentComponentTickFunction PostPhysicsComponentTick;
268 void RegisterTickFunctions(
bool bRegister);
270 virtual
void OnRegister() override;
271 virtual
void OnUnregister() override;
272 virtual
void OnComponentDestroyed() override;
274 virtual
void BeginDestroy() override;
275 virtual
bool IsReadyForFinishDestroy() override;
278 virtual
void OnViewCreated(Coherent::UI::View* View) override;
279 void OnScriptingReady();
280 virtual
void OnReadyForBindings(
int frameId,
282 bool isMainFrame) override;
283 virtual
void OnFinishLoad(
int frameId,
284 const
wchar_t* validatedPath,
287 Coherent::UI::HTTPHeader* headers,
288 unsigned headersCount) override;
289 virtual
void OnFailLoad(
int frameId,
290 const
wchar_t* validatedPath,
292 const
char* error) override;
293 virtual
void OnBindingsReleased(
int frameId,
295 bool isMainFrame) override;
296 virtual
void OnNavigateTo(const
wchar_t* path) override;
297 virtual
void OnScriptMessage(MessageLevel level, const
wchar_t* message, const
wchar_t* sourceId,
int line) override;
298 virtual
void OnCursorChanged(Coherent::UI::CursorTypes cursor) override;
299 virtual
void OnJavaScriptMessage(const
wchar_t* message, const
wchar_t* defaultPrompt, const
wchar_t* frameUrl,
int messageType) override;
300 virtual
void OnError(const Coherent::UI::ViewError& error) override;
301 virtual
void OnCallback(const
char* eventName, const Coherent::UI::EventArguments& arguments) override;
302 virtual
void OnRequestMediaStream(Coherent::UI::MediaStreamRequest* request) override;
304 virtual
void Release() override;
308 static WeakCoherentComponentsArray::TIterator GetUCoherentBaseComponentIterator(UWorld* world);
309 void ViewRequested();
311 bool bIsReadyForBindings;
312 bool bIsReadyForScripting;
314 bool bIsReadyForFinishDestroy;
Definition: CoherentUIJSPayload.h:47
Definition: CoherentUIJSEvent.h:45
Definition: CoherentBaseComponent.h:76