From 2d6f16ec5d9eacdac82633de38402c2b5999817c Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Fri, 18 Aug 2017 15:26:26 +0530 Subject: lokdialog: Add dialog APIs to lok::Document class Change-Id: I1947dc84c91e2e01072fbff3e97aa94d514ecb5a --- include/LibreOfficeKit/LibreOfficeKit.h | 10 +++++---- include/LibreOfficeKit/LibreOfficeKit.hxx | 35 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 043c42041af4..36d1ed7e7783 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -252,19 +252,21 @@ struct _LibreOfficeKitDocumentClass int* pArray, size_t nSize); - /// WIP + /// Paints dialog with given dialog id to the buffer + /// @see lok::Document::paintDialog(). void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); + /// @see lok::Document::paintActiveFloatingWindow(). void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); - /// WIP + /// @see lok::Document::postDialogKeyEvent(). void (*postDialogKeyEvent) (LibreOfficeKitDocument* pThis, const char* pDialogId, int nType, int nCharCode, int nKeyCode); - /// WIP + /// @see lok::Document::postDialogMouseEvent(). void (*postDialogMouseEvent) (LibreOfficeKitDocument* pThis, const char* pDialogId, int nType, @@ -274,7 +276,7 @@ struct _LibreOfficeKitDocumentClass int nButtons, int nModifier); - /// WIP + /// @see lok::Document::postDialogChildMouseEvent(). void (*postDialogChildMouseEvent) (LibreOfficeKitDocument* pThis, const char* pDialogId, int nType, diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index b5daebbb107a..bdda66709beb 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -154,6 +154,25 @@ public: nTilePosX, nTilePosY, nTileWidth, nTileHeight); } + /** + * Renders a dialog with give dialog id and writes the width and height of the rendered dialog + * + * Client must truncate pBuffer according to the nWidth and nHeight returned after the call. + * + * @param pDialogId Unique dialog id to be painted + * @param pBuffer Buffer with enough memory allocated to render any dialog + * @param nWidth output parameter returning the width of the rendered dialog. + * @param nHeight output parameter returning the height of the rendered dialog + */ + void paintDialog(const char* pDialogId, + unsigned char* pBuffer, + int& nWidth, + int& nHeight) + { + return mpDoc->pClass->paintDialog(mpDoc, pDialogId, pBuffer, + &nWidth, &nHeight); + } + /** * Gets the tile mode: the pixel format used for the pBuffer of paintTile(). * @@ -234,6 +253,22 @@ public: mpDoc->pClass->postMouseEvent(mpDoc, nType, nX, nY, nCount, nButtons, nModifier); } + /** + * Posts a mouse event to the dialog with given id. + * + * @param aDialogId Dialog id where mouse event is to be posted + * @param nType Event type, like down, move or up. + * @param nX horizontal position in document coordinates + * @param nY vertical position in document coordinates + * @param nCount number of clicks: 1 for single click, 2 for double click + * @param nButtons: which mouse buttons: 1 for left, 2 for middle, 4 right + * @param nModifier: which keyboard modifier: (see include/vcl/vclenum.hxx for possible values) + */ + void postDialogMouseEvent(const char* pDialogId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier) + { + mpDoc->pClass->postDialogMouseEvent(mpDoc, pDialogId, nType, nX, nY, nCount, nButtons, nModifier); + } + /** * Posts an UNO command to the document. * -- cgit v1.2.3