summaryrefslogtreecommitdiff
path: root/include/LibreOfficeKit
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-07-19 23:51:16 +0100
committerMichael Meeks <michael.meeks@collabora.com>2019-08-02 11:41:47 -0400
commit7e174f327a3cf16a09e4b2f8e2ffba2225c21901 (patch)
tree934ba482dafdd9b5fe7a9a68e579d40e990713c4 /include/LibreOfficeKit
parentdc4e514f17d1923c19d2b61f733b196e5acf7dec (diff)
LOK: Support detecting complex selections
Includes unit-test, but is otherwise not complete implementation. Change-Id: I5fdcd543358caab1858f6351238c21312665839c
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h3
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx10
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitEnums.h9
3 files changed, 22 insertions, 0 deletions
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
@@ -352,6 +352,16 @@ public:
}
/**
+ * 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.
*
* NB. returns a complete set of possible selection types if nullptr is passed for pMimeTypes.
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.