123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- #pragma once
- #include "CoreMinimal.h"
- #include "Rendering/SlateRenderer.h"
- #include "IWebInterfaceBrowserResourceLoader.h"
- class FCEFWebInterfaceBrowserWindow;
- class IWebInterfaceBrowserCookieManager;
- class IWebInterfaceBrowserWindow;
- class IWebInterfaceBrowserSchemeHandlerFactory;
- class UMaterialInterface;
- struct FWebInterfaceBrowserWindowInfo;
- class IWebInterfaceBrowserWindowFactory
- {
- public:
- virtual TSharedPtr<IWebInterfaceBrowserWindow> Create(
- TSharedPtr<FCEFWebInterfaceBrowserWindow>& BrowserWindowParent,
- TSharedPtr<FWebInterfaceBrowserWindowInfo>& BrowserWindowInfo) = 0;
- virtual TSharedPtr<IWebInterfaceBrowserWindow> Create(
- void* OSWindowHandle,
- FString InitialURL,
- bool bUseTransparency,
- bool bThumbMouseButtonNavigation,
- bool InterceptLoadRequests = false,
- TOptional<FString> ContentsToLoad = TOptional<FString>(),
- bool ShowErrorMessage = true,
- FColor BackgroundColor = FColor(255, 255, 255, 255)) = 0;
- };
- struct WEBBROWSERUI_API FInterfaceBrowserContextSettings
- {
- FInterfaceBrowserContextSettings(const FString& InId)
- : Id(InId)
- , AcceptLanguageList()
- , CookieStorageLocation()
- , bPersistSessionCookies(false)
- , bIgnoreCertificateErrors(false)
- , bEnableNetSecurityExpiration(true)
- { }
- FString Id;
- FString AcceptLanguageList;
- FString CookieStorageLocation;
- bool bPersistSessionCookies;
- bool bIgnoreCertificateErrors;
- bool bEnableNetSecurityExpiration;
- FOnBeforeInterfaceContextResourceLoadDelegate OnBeforeContextResourceLoad;
- };
- struct WEBBROWSERUI_API FCreateInterfaceBrowserWindowSettings
- {
- FCreateInterfaceBrowserWindowSettings()
- : OSWindowHandle(nullptr)
- , InitialURL()
- , bAcceleratedPaint(false)
- , bUseTransparency(false)
- , bInterceptLoadRequests(false)
- , bUseNativeCursors(false)
- , bThumbMouseButtonNavigation(false)
- , ContentsToLoad()
- , bShowErrorMessage(true)
- , BackgroundColor(FColor(255, 255, 255, 255))
- , BrowserFrameRate(60)
- , Context()
- , AltRetryDomains()
- { }
- void* OSWindowHandle;
- FString InitialURL;
- bool bAcceleratedPaint;
- bool bUseTransparency;
- bool bInterceptLoadRequests;
- bool bUseNativeCursors;
- bool bThumbMouseButtonNavigation;
- TOptional<FString> ContentsToLoad;
- bool bShowErrorMessage;
- FColor BackgroundColor;
- int BrowserFrameRate;
- TOptional<FInterfaceBrowserContextSettings> Context;
- TArray<FString> AltRetryDomains;
- };
- class WEBBROWSERUI_API IWebInterfaceBrowserSingleton
- {
- public:
-
- virtual ~IWebInterfaceBrowserSingleton() {};
-
- virtual TSharedRef<IWebInterfaceBrowserWindowFactory> GetWebBrowserWindowFactory() const = 0;
-
- virtual TSharedPtr<IWebInterfaceBrowserWindow> CreateBrowserWindow(
- TSharedPtr<FCEFWebInterfaceBrowserWindow>& BrowserWindowParent,
- TSharedPtr<FWebInterfaceBrowserWindowInfo>& BrowserWindowInfo
- ) = 0;
-
- virtual TSharedPtr<IWebInterfaceBrowserWindow> CreateBrowserWindow(const FCreateInterfaceBrowserWindowSettings& Settings) = 0;
- #if BUILD_EMBEDDED_APP
- virtual TSharedPtr<IWebInterfaceBrowserWindow> CreateNativeBrowserProxy() = 0;
- #endif
- virtual TSharedPtr<class IWebInterfaceBrowserCookieManager> GetCookieManager() const = 0;
- virtual TSharedPtr<class IWebInterfaceBrowserCookieManager> GetCookieManager(TOptional<FString> ContextId) const = 0;
- virtual bool RegisterContext(const FInterfaceBrowserContextSettings& Settings) = 0;
- virtual bool UnregisterContext(const FString& ContextId) = 0;
-
- virtual FString ApplicationCacheDir() const = 0;
-
- virtual bool RegisterSchemeHandlerFactory(FString Scheme, FString Domain, IWebInterfaceBrowserSchemeHandlerFactory* WebBrowserSchemeHandlerFactory) = 0;
-
- virtual bool UnregisterSchemeHandlerFactory(IWebInterfaceBrowserSchemeHandlerFactory* WebBrowserSchemeHandlerFactory) = 0;
-
- virtual void SetDevToolsShortcutEnabled(bool Value) = 0;
-
- virtual bool IsDevToolsShortcutEnabled() = 0;
-
- virtual void SetJSBindingToLoweringEnabled(bool bEnabled) = 0;
-
- virtual void ClearOldCacheFolders(const FString &CachePathRoot, const FString &CachePrefix) = 0;
-
- virtual void SetDefaultMaterial(UMaterialInterface* InDefaultMaterial) = 0;
-
- virtual void SetDefaultTranslucentMaterial(UMaterialInterface* InDefaultMaterial) = 0;
-
- virtual UMaterialInterface* GetDefaultMaterial() = 0;
-
- virtual UMaterialInterface* GetDefaultTranslucentMaterial() = 0;
- };
|