WebView.h 902 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright aXiuShen. All Rights Reserved.
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #include "Modules/ModuleManager.h"
  5. class IWebViewModule : public IModuleInterface
  6. {
  7. public:
  8. /**
  9. * Checks to see if this module is loaded and ready.
  10. * It is only valid to call Get() if IsAvailable() returns true.
  11. * @return
  12. * True if the module is loaded and ready to use
  13. */
  14. static inline bool IsAvailable() {
  15. return FModuleManager::Get().IsModuleLoaded("WebView");
  16. }
  17. /**
  18. * Singleton-like access to this module's interface.
  19. * This is just for convenience!
  20. * Beware of calling this during the shutdown phase, though.
  21. * Your module might have been unloaded already.
  22. * @return Returns singleton instance,
  23. * loading the module on demand if needed
  24. */
  25. static inline IWebViewModule& Get() {
  26. return FModuleManager::LoadModuleChecked<IWebViewModule>( "WebView" );
  27. }
  28. };