WebInterfaceBrowserModule.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Engine/Source/Runtime/WebBrowser/Public/WebBrowserModule.h
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #include "Modules/ModuleInterface.h"
  5. #include "Modules/ModuleManager.h"
  6. class IWebInterfaceBrowserSingleton;
  7. /**
  8. * WebBrowser initialization settings, can be used to override default init behaviors.
  9. */
  10. struct WEBBROWSERUI_API FWebInterfaceBrowserInitSettings
  11. {
  12. public:
  13. /**
  14. * Default constructor. Initializes all members with default behavior values.
  15. */
  16. FWebInterfaceBrowserInitSettings();
  17. // The string which is appended to the browser's user-agent value.
  18. FString ProductVersion;
  19. };
  20. /**
  21. * WebBrowserModule interface
  22. */
  23. class IWebInterfaceBrowserModule : public IModuleInterface
  24. {
  25. public:
  26. /**
  27. * Get or load the Web Browser Module
  28. *
  29. * @return The loaded module
  30. */
  31. static inline IWebInterfaceBrowserModule& Get()
  32. {
  33. return FModuleManager::LoadModuleChecked< IWebInterfaceBrowserModule >("WebBrowserUI");
  34. }
  35. /**
  36. * Check whether the module has already been loaded
  37. *
  38. * @return True if the module is loaded
  39. */
  40. static inline bool IsAvailable()
  41. {
  42. return FModuleManager::Get().IsModuleLoaded("WebBrowserUI");
  43. }
  44. /**
  45. * Customize initialization settings. You must call this before the first GetSingleton call, in order to override init settings.
  46. *
  47. * @param WebBrowserInitSettings The custom settings.
  48. * @return true if the settings were used to initialize the singleton. False if the call was ignored due to singleton already existing.
  49. */
  50. virtual bool CustomInitialize(const FWebInterfaceBrowserInitSettings& WebBrowserInitSettings) = 0;
  51. /**
  52. * Get the Web Browser Singleton
  53. *
  54. * @return The Web Browser Singleton
  55. */
  56. virtual IWebInterfaceBrowserSingleton* GetSingleton() = 0;
  57. /**
  58. * Check whether the web module loaded its requirements successfully
  59. *
  60. * @return True if the module load worked
  61. */
  62. virtual bool IsWebModuleAvailable() const = 0;
  63. };