diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-20 10:17:03 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-26 10:27:37 +0100 |
commit | 0869d8ef419918ead63363a73a1838f3fe616b2a (patch) | |
tree | fefc80bdbc76608427dac5c2e2594727cf48483e /include | |
parent | 07997cba7745997d7e2ed908a8764ba1f0777f1e (diff) |
Add initial lok::Office::postMouseEvent()
There is no unit conversion yet, most probably we want to work with doc
model coordinates at an API level, while VCL works with pixel
coordinates.
Change-Id: I98848851fbec5253e76c997844f6339402dfac46
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 12 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index c5909ef2938f..397d435f9c76 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -73,6 +73,17 @@ typedef enum } LibreOfficeKitKeyEventType; +typedef enum +{ + /// A pressed gesture has started. + LOK_MOUSEEVENT_MOUSEBUTTONDOWN, + /// A pressed gesture has finished. + LOK_MOUSEEVENT_MOUSEBUTTONUP, + /// A change has happened during a press gesture. + LOK_MOUSEEVENT_MOUSEMOVE +} +LibreOfficeKitMouseEventType; + typedef void (*LibreOfficeKitCallback)(int nType, const char* pPayload, void* pData); #endif // LOK_USE_UNSTABLE_API @@ -89,6 +100,7 @@ struct _LibreOfficeKitClass LibreOfficeKitDocument* (*documentLoad) (LibreOfficeKit* pThis, const char* pURL); char* (*getError) (LibreOfficeKit* pThis); void (*postKeyEvent) (LibreOfficeKit* pThis, int nType, int nCode); + void (*postMouseEvent)(LibreOfficeKit* pThis, int nType, int nX, int nY); }; #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize) diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index fdc025ba14c5..bd3ce554b632 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -146,6 +146,18 @@ public: { mpThis->pClass->postKeyEvent(mpThis, nType, nCode); } + + /** + * Posts a mouse event to the focused frame. + * + * @param nType Event type, like down, move or up. + * @param nX horizontal position + * @param nY vertical position + */ + inline void postMouseEvent(int nType, int nX, int nY) + { + mpThis->pClass->postMouseEvent(mpThis, nType, nX, nY); + } }; inline Office* lok_cpp_init(const char* pInstallPath) |