diff options
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) |