summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-21 11:29:49 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-20 17:02:12 +0200
commitc64ac7b2e9898cc56266ea8b32321bdd8558da34 (patch)
tree60b4be9385437b130b0949fa604bca47bfe64de8 /include
parentf31e970376b77d905bc30cbf65d54ceddccb8994 (diff)
sw lok: add LOK_CALLBACK_TEXT_VIEW_SELECTION
So a view can be aware where selections of other views are. Change-Id: I5026b1ff2b99a4eedfd0bde32a05ceb8e2f424bc Reviewed-on: https://gerrit.libreoffice.org/26542 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 9f66db9c474f71f43d7a3667230241fd4fa4183f)
Diffstat (limited to 'include')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitEnums.h16
-rw-r--r--include/sfx2/lokhelper.hxx4
2 files changed, 19 insertions, 1 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 4229e73e6728..4dfb8be670a1 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -316,7 +316,6 @@ typedef enum
* The size and/or the position of the view cursor changed. A view cursor
* is a cursor of an other view, the current view can't change it.
*
- * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
* The payload format:
*
* {
@@ -329,6 +328,21 @@ typedef enum
*/
LOK_CALLBACK_INVALIDATE_VIEW_CURSOR,
+ /**
+ * The the text selection in one of the other views has changed.
+ *
+ * The payload format:
+ *
+ * {
+ * "viewId": "..."
+ * "selection": "..."
+ * }
+ *
+ * - viewId is a value returned earlier by lok::Document::createView()
+ * - selection uses the format of LOK_CALLBACK_TEXT_SELECTION.
+ */
+ LOK_CALLBACK_TEXT_VIEW_SELECTION,
+
}
LibreOfficeKitCallbackType;
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index ec68ed6e313a..4cfe0817539f 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -13,6 +13,7 @@
#include <sfx2/dllapi.h>
#include <cstddef>
#include <cstdint>
+#include <rtl/string.hxx>
class SfxViewShell;
@@ -29,6 +30,9 @@ public:
static std::uintptr_t getView(SfxViewShell* pViewShell = nullptr);
/// Get the number of views of the current object shell.
static std::size_t getViews();
+
+ /// Invoke the LOK callback of all views except pThisView, with a payload of rKey-rPayload.
+ static void notifyOtherViews(SfxViewShell* pThisView, int nType, const OString& rKey, const OString& rPayload);
};
#endif