From 7e174f327a3cf16a09e4b2f8e2ffba2225c21901 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Fri, 19 Jul 2019 23:51:16 +0100 Subject: LOK: Support detecting complex selections Includes unit-test, but is otherwise not complete implementation. Change-Id: I5fdcd543358caab1858f6351238c21312665839c --- include/LibreOfficeKit/LibreOfficeKit.h | 3 +++ include/LibreOfficeKit/LibreOfficeKit.hxx | 10 ++++++++++ include/LibreOfficeKit/LibreOfficeKitEnums.h | 9 +++++++++ 3 files changed, 22 insertions(+) (limited to 'include/LibreOfficeKit') diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 14b7bb995b10..abdc9863c1f0 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -405,6 +405,9 @@ struct _LibreOfficeKitDocumentClass const size_t *pInSizes, const char **pInStreams); + /// @see lok::Document::getSelectionType + int (*getSelectionType) (LibreOfficeKitDocument* pThis); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index cb1ca1e4c2d3..ca0287a6b584 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -351,6 +351,16 @@ public: return mpDoc->pClass->getTextSelection(mpDoc, pMimeType, pUsedMimeType); } + /** + * Gets the type of the selected content. + * + * @return an element of the LibreOfficeKitSelectionType enum. + */ + int getSelectionType(LibreOfficeKitDocument* pThis) + { + return mpDoc->pClass->getSelectionType(mpDoc); + } + /** * Gets the selected content for the current view as a series of binary streams. * diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 4277adbe6dbc..0680c7e6c44f 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -47,6 +47,15 @@ typedef enum } LibreOfficeKitWindowAction; +typedef enum +{ + LOK_SELTYPE_NONE, + LOK_SELTYPE_TEXT, + LOK_SELTYPE_LARGE_TEXT, + LOK_SELTYPE_COMPLEX +} +LibreOfficeKitSelectionType; + /** 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. -- cgit