diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-11-29 17:47:10 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-12-04 17:14:00 +0530 |
commit | 2f2679a56c0ae5dbcab6a0e6aa523587ecdc84fe (patch) | |
tree | 3463803764fd9df80da1c9deaf099969d35c6fa4 /include/LibreOfficeKit | |
parent | cc05f8d9d27a8b28421a91cbfb059898d9619974 (diff) |
lokdialog: Allow closing a dialog from LOK client
... and rename paintDialog -> paintWindow before it's too late. We not
only render dialogs now but also popups.
Change-Id: I6b1253c4d9be0c79199b683df4413658a461f850
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 7 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 20 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitEnums.h | 6 |
3 files changed, 25 insertions, 8 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 68b5f7338032..350dd03dbc5f 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -271,8 +271,8 @@ struct _LibreOfficeKitDocumentClass size_t nSize); /// Paints dialog with given dialog id to the buffer - /// @see lok::Document::paintDialog(). - void (*paintDialog) (LibreOfficeKitDocument* pThis, unsigned nDialogId, + /// @see lok::Document::paintWindow(). + void (*paintWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, unsigned char* pBuffer, const int x, const int y, const int width, const int height); @@ -280,6 +280,9 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::paintActiveFloatingWindow(). void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, unsigned nDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); + /// @see lok::Document::postWindow(). + void (*postWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, int nAction); + /// @see lok::Document::postDialogKeyEvent(). void (*postDialogKeyEvent) (LibreOfficeKitDocument* pThis, unsigned nDialogId, diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 2b3d26bb0778..3c1d27b48d49 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -156,25 +156,23 @@ public: } /** - * Renders a dialog with give dialog id and writes the width and height of the rendered dialog + * Renders a window (dialog, popup, etc.) with give id * - * Client must truncate pBuffer according to the nWidth and nHeight returned after the call. - * - * @param nDialogId Unique dialog id to be painted + * @param nWindowId * @param pBuffer Buffer with enough memory allocated to render any dialog * @param x x-coordinate from where the dialog should start painting * @param y y-coordinate from where the dialog should start painting * @param width The width of the dialog image to be painted * @param height The height of the dialog image to be painted */ - void paintDialog(unsigned nDialogId, + void paintWindow(unsigned nWindowId, unsigned char* pBuffer, const int x, const int y, const int width, const int height) { - return mpDoc->pClass->paintDialog(mpDoc, nDialogId, pBuffer, + return mpDoc->pClass->paintWindow(mpDoc, nWindowId, pBuffer, x, y, width, height); } @@ -198,6 +196,16 @@ public: } /** + * Posts a command to the window (dialog, popup, etc.) with given id + * + * @param nWindowid + */ + void postWindow(unsigned nWindowId, int nAction) + { + return mpDoc->pClass->postWindow(mpDoc, nWindowId, nAction); + } + + /** * Gets the tile mode: the pixel format used for the pBuffer of paintTile(). * * @return an element of the LibreOfficeKitTileMode enum. diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 62b9faf7ecb4..facbd351633d 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -40,6 +40,12 @@ typedef enum } LibreOfficeKitTileMode; +typedef enum +{ + LOK_WINDOW_CLOSE +} +LibreOfficeKitWindowAction; + /** Optional features of LibreOfficeKit, in particular callbacks that block * LibreOfficeKit until the corresponding reply is received, which would * deadlock if the client does not support the feature. |