diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-07 17:19:58 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2018-02-13 10:07:11 +0100 |
commit | 758eafa1e2dd342ed47552c2b1cf13cc6d88b7ba (patch) | |
tree | 163a8865905c4d5e7e0bf53071278a978ecd5b3b /include | |
parent | 55e7f7f8d76db06505a04ff7b8505455aff50c5e (diff) |
sw lok: IME support + unit test
Change-Id: I557493db23dfa3529606050c86161628dbd722e7
Reviewed-on: https://gerrit.libreoffice.org/49354
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
(cherry picked from commit 7f9f58f3a304733f7089719a5a65eef8c68c2b8d)
Reviewed-on: https://gerrit.libreoffice.org/49623
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 5 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 11 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitEnums.h | 11 | ||||
-rw-r--r-- | include/vcl/ITiledRenderable.hxx | 7 | ||||
-rw-r--r-- | include/vcl/vclevent.hxx | 2 | ||||
-rw-r--r-- | include/vcl/window.hxx | 1 |
6 files changed, 37 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 8ac97371c6c4..bb99e04abe17 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -289,6 +289,11 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::setViewLanguage(). void (*setViewLanguage) (LibreOfficeKitDocument* pThis, int nId, const char* language); + /// @see lok::Document::postExtTextInputEvent + void (*postExtTextInputEvent) (LibreOfficeKitDocument* pThis, + int nType, + const char* pText); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index d7fa22b70ede..c076c0f0b58f 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -536,6 +536,17 @@ public: mpDoc->pClass->setViewLanguage(mpDoc, nId, language); } + /** + * Post the text input from external input window, like IME + * + * @param nType see LibreOfficeKitExtTextInputType + * @param pText Text for LOK_EXT_TEXTINPUT + */ + void postExtTextInputEvent(int nType, const char* pText) + { + mpDoc->pClass->postExtTextInputEvent(mpDoc, nType, pText); + } + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 46be3f25fea8..ccbc3b96b065 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -582,6 +582,17 @@ LibreOfficeKitKeyEventType; typedef enum { + /// cf. SalEvent::ExtTextInput + LOK_EXT_TEXTINPUT, + /// cf. SalEvent::ExtTextInputPos + LOK_EXT_TEXTINPUT_POS, + /// cf. SalEvent::EndExtTextInput + LOK_EXT_TEXTINPUT_END +} +LibreOfficeKitExtTextInputType; + +typedef enum +{ /// A pressed gesture has started. LOK_MOUSEEVENT_MOUSEBUTTONDOWN, /// A pressed gesture has finished. diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index b04b10eb404b..d9d887a3c23b 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -110,6 +110,13 @@ public: virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) = 0; /** + * Posts an external text input event + * + * @see lok::Document::postExtTextInputEvent(). + */ + virtual void postExtTextInputEvent(int /*nType*/, const OUString& /*rText*/) {} + + /** * Posts a mouse event on the document. * * @see lok::Document::postMouseEvent(). diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx index a1c9a9724bdb..c5a972c2ddfd 100644 --- a/include/vcl/vclevent.hxx +++ b/include/vcl/vclevent.hxx @@ -65,6 +65,8 @@ namespace com { namespace sun { namespace star { #define VCLEVENT_WINDOW_DATACHANGED 1022 // pData = DataChangedEvent* #define VCLEVENT_WINDOW_ZOOM 1023 // pData = ZoomEvent* #define VCLEVENT_WINDOW_SCROLL 1024 // pData = ScrollEvent* +#define VCLEVENT_WINDOW_EXTTEXTINPUT 1025 +#define VCLEVENT_WINDOW_ENDEXTTEXTINPUT 1026 // VclWindowEvent #define VCLEVENT_CONTROL_GETFOCUS 1100 diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 7f15b5dac267..243335885087 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -886,6 +886,7 @@ public: void SetInputContext( const InputContext& rInputContext ); const InputContext& GetInputContext() const; + void PostExtTextInputEvent(VclEventId nType, const OUString& rText); void EndExtTextInput(); void SetCursorRect( const Rectangle* pRect = nullptr, long nExtTextInputWidth = 0 ); const Rectangle* GetCursorRect() const; |