aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win/native/InputMethod.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-10-30 00:07:57 +0800
committercrupest <crupest@outlook.com>2020-10-30 00:07:57 +0800
commit6aa2201797a9ed64ce0178215ae941d0c5f09579 (patch)
tree9a74ee8d9f616afbe693ef7825a71474850831b5 /include/cru/win/native/InputMethod.hpp
parentb4cb4fb7552d35c267bdb66913e4c822f16346ab (diff)
downloadcru-6aa2201797a9ed64ce0178215ae941d0c5f09579.tar.gz
cru-6aa2201797a9ed64ce0178215ae941d0c5f09579.tar.bz2
cru-6aa2201797a9ed64ce0178215ae941d0c5f09579.zip
...
Diffstat (limited to 'include/cru/win/native/InputMethod.hpp')
-rw-r--r--include/cru/win/native/InputMethod.hpp87
1 files changed, 0 insertions, 87 deletions
diff --git a/include/cru/win/native/InputMethod.hpp b/include/cru/win/native/InputMethod.hpp
deleted file mode 100644
index f3dc15c0..00000000
--- a/include/cru/win/native/InputMethod.hpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// Some useful information can be found from chromium code:
-// https://chromium.googlesource.com/chromium/chromium/+/refs/heads/master/ui/base/win/ime_input.h
-// https://chromium.googlesource.com/chromium/chromium/+/refs/heads/master/ui/base/win/ime_input.cc
-
-#pragma once
-#include "Resource.hpp"
-
-#include "WindowNativeMessageEventArgs.hpp"
-#include "cru/platform/native/InputMethod.hpp"
-
-#include <imm.h>
-
-namespace cru::platform::native::win {
-class AutoHIMC : public Object {
- CRU_DEFINE_CLASS_LOG_TAG(u"cru::platform::native::win::AutoHIMC")
-
- public:
- explicit AutoHIMC(HWND hwnd);
-
- CRU_DELETE_COPY(AutoHIMC)
-
- AutoHIMC(AutoHIMC&& other);
- AutoHIMC& operator=(AutoHIMC&& other);
-
- ~AutoHIMC() override;
-
- HWND GetHwnd() const { return hwnd_; }
-
- HIMC Get() const { return handle_; }
-
- private:
- HWND hwnd_;
- HIMC handle_;
-};
-
-class WinInputMethodContext : public WinNativeResource,
- public virtual IInputMethodContext {
- CRU_DEFINE_CLASS_LOG_TAG(u"cru::platform::native::win::WinInputMethodContext")
-
- public:
- WinInputMethodContext(gsl::not_null<WinNativeWindow*> window);
-
- CRU_DELETE_COPY(WinInputMethodContext)
- CRU_DELETE_MOVE(WinInputMethodContext)
-
- ~WinInputMethodContext() override;
-
- bool ShouldManuallyDrawCompositionText() override { return true; }
-
- void EnableIME() override;
-
- void DisableIME() override;
-
- void CompleteComposition() override;
-
- void CancelComposition() override;
-
- CompositionText GetCompositionText() override;
-
- void SetCandidateWindowPosition(const Point& point) override;
-
- IEvent<std::nullptr_t>* CompositionStartEvent() override;
-
- IEvent<std::nullptr_t>* CompositionEndEvent() override;
-
- IEvent<std::nullptr_t>* CompositionEvent() override;
-
- IEvent<std::u16string_view>* TextEvent() override;
-
- private:
- void OnWindowNativeMessage(WindowNativeMessageEventArgs& args);
-
- std::u16string GetResultString();
-
- AutoHIMC GetHIMC();
-
- private:
- WinNativeWindow* native_window_;
-
- EventRevokerListGuard event_guard_;
-
- Event<std::nullptr_t> composition_start_event_;
- Event<std::nullptr_t> composition_end_event_;
- Event<std::nullptr_t> composition_event_;
- Event<std::u16string_view> text_event_;
-};
-} // namespace cru::platform::native::win