[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - bundled/include

Jan Holesovsky kendy at collabora.com
Thu Nov 16 12:40:00 UTC 2017


 bundled/include/LibreOfficeKit/LibreOfficeKit.h      |   63 +++++++---
 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx    |  117 +++++++++++++++++--
 bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |   24 +++
 3 files changed, 178 insertions(+), 26 deletions(-)

New commits:
commit ab4ed5e5d0331d9bfd450ee005df5dc0e6e4a154
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Nov 16 13:37:56 2017 +0100

    Update bundled includes.
    
    Change-Id: Id91b4956265eb70d1236ac00dc86f7494edcb0f3
    Reviewed-on: https://gerrit.libreoffice.org/44817
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index da6bba91..7aa4ba91 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -12,10 +12,13 @@
 
 #include <stddef.h>
 
-#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 // the unstable API needs C99's bool
-#include <stdbool.h>
-#include <stdint.h>
+// TODO remove the C99 types from the API before making stable
+#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
+# ifndef _WIN32
+#  include <stdbool.h>
+# endif
+# include <stdint.h>
 #endif
 
 #include <LibreOfficeKit/LibreOfficeKitTypes.h>
@@ -69,7 +72,7 @@ struct _LibreOfficeKitClass
     char* (*getFilterTypes) (LibreOfficeKit* pThis);
 
     /// @see lok::Office::setOptionalFeatures().
-    void (*setOptionalFeatures)(LibreOfficeKit* pThis, uint64_t features);
+    void (*setOptionalFeatures)(LibreOfficeKit* pThis, unsigned long long features);
 
     /// @see lok::Office::setDocumentPassword().
     void (*setDocumentPassword) (LibreOfficeKit* pThis,
@@ -79,7 +82,7 @@ struct _LibreOfficeKitClass
     /// @see lok::Office::getVersionInfo().
     char* (*getVersionInfo) (LibreOfficeKit* pThis);
 
-    bool (*runMacro) (LibreOfficeKit *pThis, const char* pURL);
+    int (*runMacro) (LibreOfficeKit *pThis, const char* pURL);
 #endif
 
 };
@@ -252,15 +255,47 @@ struct _LibreOfficeKitDocumentClass
                        int* pArray,
                        size_t nSize);
 
-    /// Starts a batch of operations.
-    /// Events are emmitted only after ending the batch.
-    /// @see lok::Document::endBatch();
-    void (*beginBatch) (LibreOfficeKitDocument* pThis);
-
-    /// Ends a batch of operations.
-    /// @see lok::Document::beginBatch();
-    void (*endBatch) (LibreOfficeKitDocument* pThis);
-
+    /// Paints dialog with given dialog id to the buffer
+    /// @see lok::Document::paintDialog().
+    void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId,
+                         unsigned char* pBuffer,
+                         const int x, const int y,
+                         const int width, const int height);
+
+    /// Get info about dialog with given dialog id
+    /// @see lok::Document::getDialogInfo().
+    void (*getDialogInfo) (LibreOfficeKitDocument* pThis, const char* pDialogId,
+                           char** pDialogTitle, int* pWidth, int* pHeight);
+
+    /// @see lok::Document::paintActiveFloatingWindow().
+    void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight);
+
+    /// @see lok::Document::postDialogKeyEvent().
+    void (*postDialogKeyEvent) (LibreOfficeKitDocument* pThis,
+                                const char* pDialogId,
+                                int nType,
+                                int nCharCode,
+                                int nKeyCode);
+
+    /// @see lok::Document::postDialogMouseEvent().
+    void (*postDialogMouseEvent) (LibreOfficeKitDocument* pThis,
+                                  const char* pDialogId,
+                                  int nType,
+                                  int nX,
+                                  int nY,
+                                  int nCount,
+                                  int nButtons,
+                                  int nModifier);
+
+    /// @see lok::Document::postDialogChildMouseEvent().
+    void (*postDialogChildMouseEvent) (LibreOfficeKitDocument* pThis,
+                                       const char* pDialogId,
+                                       int nType,
+                                       int nX,
+                                       int nY,
+                                       int nCount,
+                                       int nButtons,
+                                       int nModifier);
 
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
index 72fb7c2b..2e4486ee 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -155,6 +155,65 @@ public:
     }
 
     /**
+     * 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 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(const char* pDialogId,
+                     unsigned char* pBuffer,
+                     const int x,
+                     const int y,
+                     const int width,
+                     const int height)
+    {
+        return mpDoc->pClass->paintDialog(mpDoc, pDialogId, pBuffer,
+                                          x, y, width, height);
+    }
+
+    /* Get info about dialog with given dialog id
+     *
+     * @param pDialogId Unique dialog id for which to get info about
+     * @param pDialogTitle Pointer to pointer pointing to string containing the
+     * dialog title. Caller should the pointer to allocated string themselves.
+     * @param pWidth The width of the dialog
+     * @param pHeight The height of the dialog
+     */
+    void getDialogInfo(const char* pDialogId,
+                       char** pDialogTitle,
+                       int& pWidth,
+                       int& pHeight)
+    {
+        return mpDoc->pClass->getDialogInfo(mpDoc, pDialogId, pDialogTitle, &pWidth, &pHeight);
+
+    }
+
+    /**
+     * Renders the active floating window of a dialog
+     *
+     * Client must truncate pBuffer according to the nWidth and nHeight returned after the call.
+     *
+     * @param pDialogId Unique dialog id
+     * @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 paintActiveFloatingWindow(const char* pDialogId,
+                                   unsigned char* pBuffer,
+                                   int& nWidth,
+                                   int& nHeight)
+    {
+        return mpDoc->pClass->paintActiveFloatingWindow(mpDoc, pDialogId, pBuffer,
+                                                        &nWidth, &nHeight);
+    }
+
+    /**
      * Gets the tile mode: the pixel format used for the pBuffer of paintTile().
      *
      * @return an element of the LibreOfficeKitTileMode enum.
@@ -220,6 +279,19 @@ public:
     }
 
     /**
+     * Posts a keyboard event to the dialog
+     *
+     * @param pDialogId Dialog id on which key event should be posted
+     * @param nType Event type, like press or release.
+     * @param nCharCode contains the Unicode character generated by this event or 0
+     * @param nKeyCode contains the integer code representing the key of the event (non-zero for control keys)
+     */
+    void postDialogKeyEvent(const char* pDialogId, int nType, int nCharCode, int nKeyCode)
+    {
+        mpDoc->pClass->postDialogKeyEvent(mpDoc, pDialogId, nType, nCharCode, nKeyCode);
+    }
+
+    /**
      * Posts a mouse event to the document.
      *
      * @param nType Event type, like down, move or up.
@@ -235,6 +307,39 @@ public:
     }
 
     /**
+     * Posts a mouse event to the dialog with given id.
+     *
+     * @param pDialogId 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 a mouse event to the child of a dialog with given id.
+     *
+     * @param aDialogId Dialog id
+     * @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 postDialogChildMouseEvent(const char* pDialogId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
+    {
+        mpDoc->pClass->postDialogChildMouseEvent(mpDoc, pDialogId, nType, nX, nY, nCount, nButtons, nModifier);
+    }
+
+
+    /**
      * Posts an UNO command to the document.
      *
      * Example argument string:
@@ -452,16 +557,6 @@ public:
         return mpDoc->pClass->getViewIds(mpDoc, pArray, nSize);
     }
 
-    inline void beginBatch()
-    {
-        mpDoc->pClass->beginBatch(mpDoc);
-    }
-
-    inline void endBatch()
-    {
-        mpDoc->pClass->endBatch(mpDoc);
-    }
-
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
@@ -560,7 +655,7 @@ public:
      *
      * @see LibreOfficeKitOptionalFeatures
      */
-    void setOptionalFeatures(uint64_t features)
+    void setOptionalFeatures(unsigned long long features)
     {
         return mpThis->pClass->setOptionalFeatures(mpThis, features);
     }
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index c3b71f3f..62b9faf7 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -521,8 +521,30 @@ typedef enum
      *
      * Here all aproperties are same as described in svxruler.
      */
-    LOK_CALLBACK_RULER_UPDATE = 35
+    LOK_CALLBACK_RULER_UPDATE = 35,
+    /**
+     * Dialog invalidation
+     */
+    LOK_CALLBACK_DIALOG = 36,
 
+    /**
+     * Invalidation corresponding to dialog's children.
+     * Eg: Floating window etc.
+     *
+     * Payload example:
+     * {
+     *   "dialogID": "SpellDialog",
+     *   "action": "close"
+     * }
+     *
+     * - dialogID is the UNO command of the dialog
+     * - action can be
+     *   - close, means dialog child window is closed now
+     *   - invalidate, means dialog child window is invalidated
+     *     It also means that dialog child window is created if it's the first
+     *     invalidate
+     */
+    LOK_CALLBACK_DIALOG_CHILD = 37
 }
 LibreOfficeKitCallbackType;
 


More information about the Libreoffice-commits mailing list