123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- #pragma once
- #include "CoreMinimal.h"
- #if WITH_CEF3 && !PLATFORM_LINUX
- #include "Widgets/SWidget.h"
- #if PLATFORM_WINDOWS
- #include "Windows/AllowWindowsPlatformTypes.h"
- #include "Windows/AllowWindowsPlatformAtomics.h"
- #endif
- #pragma push_macro("OVERRIDE")
- #undef OVERRIDE
- THIRD_PARTY_INCLUDES_START
- #if PLATFORM_APPLE
- PRAGMA_DISABLE_DEPRECATION_WARNINGS
- #endif
- #include "include/cef_client.h"
- #include "include/cef_values.h"
- #if PLATFORM_APPLE
- PRAGMA_ENABLE_DEPRECATION_WARNINGS
- #endif
- THIRD_PARTY_INCLUDES_END
- #pragma pop_macro("OVERRIDE")
- #if PLATFORM_WINDOWS
- #include "Windows/HideWindowsPlatformAtomics.h"
- #include "Windows/HideWindowsPlatformTypes.h"
- #endif
- #include "Layout/Geometry.h"
- class ITextInputMethodSystem;
- class FCEFInterfaceTextInputMethodContext;
- class ITextInputMethodChangeNotifier;
- class SWidget;
- class FCEFInterfaceImeHandler
- : public TSharedFromThis<FCEFInterfaceImeHandler>
- {
- public:
- FCEFInterfaceImeHandler(CefRefPtr<CefBrowser> Browser);
- void UnbindCefBrowser();
- void CacheBrowserSlateInfo(const TSharedRef<SWidget>& Widget);
- void SetFocus(bool bHasFocus);
- void UpdateCachedGeometry(const FGeometry& AllottedGeometry);
-
- void CEFCompositionRangeChanged(const CefRange& SelectionRange, const CefRenderHandler::RectList& CharacterBounds);
-
-
- bool OnProcessMessageReceived(CefRefPtr<CefBrowser> Browser, CefProcessId SourceProcess, CefRefPtr<CefProcessMessage> Message);
-
- void SendProcessMessage(CefRefPtr<CefProcessMessage> Message);
-
- void BindInputMethodSystem(ITextInputMethodSystem* InTextInputMethodSystem);
- void UnbindInputMethodSystem();
- private:
- bool IsValid()
- {
- return InternalCefBrowser.get() != nullptr;
- }
- void InitContext();
- void DeactivateContext();
- void DestroyContext();
-
- bool HandleFocusChangedMessage(CefRefPtr<CefListValue> MessageArguments);
-
- CefRefPtr<CefBrowser> InternalCefBrowser;
- TWeakPtr<SWidget> InternalBrowserSlateWidget;
- ITextInputMethodSystem* TextInputMethodSystem;
-
- TSharedPtr<FCEFInterfaceTextInputMethodContext> TextInputMethodContext;
-
- TSharedPtr<ITextInputMethodChangeNotifier> TextInputMethodChangeNotifier;
-
- friend class FCEFInterfaceTextInputMethodContext;
- };
- #endif
|