aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/native/input_method.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-04-05 00:04:05 +0800
committercrupest <crupest@outlook.com>2020-04-05 00:04:05 +0800
commit37bb421e963662e8203acbe3a03bdbd5d1f5858e (patch)
tree400af7a9d378be209158eda8ca8adeced60b0cc8 /include/cru/platform/native/input_method.hpp
parentee61633d81cc9e34c3bd8b5fbfb6a5a25a1f3ea5 (diff)
downloadcru-37bb421e963662e8203acbe3a03bdbd5d1f5858e.tar.gz
cru-37bb421e963662e8203acbe3a03bdbd5d1f5858e.tar.bz2
cru-37bb421e963662e8203acbe3a03bdbd5d1f5858e.zip
...
Diffstat (limited to 'include/cru/platform/native/input_method.hpp')
-rw-r--r--include/cru/platform/native/input_method.hpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/cru/platform/native/input_method.hpp b/include/cru/platform/native/input_method.hpp
index ecc47fd8..6ca85852 100644
--- a/include/cru/platform/native/input_method.hpp
+++ b/include/cru/platform/native/input_method.hpp
@@ -9,17 +9,22 @@ namespace cru::platform::native {
// It is a reference, so there is a ref count, remember to destroy it to release
// the ref after use.
struct IInputMethodContextRef : INativeResource {
+ // Return true if you should draw composition text manually. Return false if
+ // system will take care of that for you.
+ virtual bool ShouldManuallyDrawCompositionText() = 0;
// Reset composition string. Use this method to prepare typing.
virtual void Reset() = 0;
// Get the composition string.
- virtual std::string GetCompositionString() = 0;
+ virtual std::string GetCompositionText() = 0;
// Set the candidate window lefttop. Use this method to prepare typing.
virtual void SetCandidateWindowPosition(const Point& point);
- // Triggered every time composition text changes, evet args is the new
+ // Triggered when user starts composition.
+ virtual IEvent<std::nullptr_t>* CompositionStartEvent() = 0;
+ // Triggered when user stops composition.
+ virtual IEvent<std::nullptr_t>* CompositionEndEvent() = 0;
+ // Triggered every time composition text changes, event args is the new
// composition text.
virtual IEvent<std::string>* CompositionTextChangeEvent() = 0;
- // User comfirmed compostition. Use this method to get the final input text.
- virtual IEvent<std::string>* CharEvent() = 0;
};
struct IInputMethodManager : INativeResource {