From b846fb660a91130aceee52fed11170a95b2f3934 Mon Sep 17 00:00:00 2001 From: Dennis Francis Date: Thu, 12 May 2022 13:13:35 +0530 Subject: lok-calc: new callback for print ranges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this callback the lok clients can read and draw the print ranges on each sheet of the Calc document. Conflicts: include/LibreOfficeKit/LibreOfficeKitEnums.h libreofficekit/source/gtk/lokdocview.cxx Change-Id: Ie19351d4420e0f3d4191f6a354ce99ab830aede2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134375 Tested-by: Jenkins CollaboraOffice Reviewed-by: Pranam Lashkari (cherry picked from commit 172bc7a8f4eeab907adac077407186fbbd046a77) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134527 Reviewed-by: Gökay ŞATIR (cherry picked from commit 29b7b25d454e0a6cd07c00e13fdb83cc8a381583) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134614 Tested-by: Jenkins Reviewed-by: Dennis Francis --- include/LibreOfficeKit/LibreOfficeKitEnums.h | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'include/LibreOfficeKit') diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 0fda66777a09..05544b5473a5 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -811,6 +811,35 @@ typedef enum * } */ LOK_CALLBACK_CONTENT_CONTROL = 55, + + /** + * This is Calc specific. The payload contains print ranges of all + * sheets in the document. + * + * Payload example: + * { + * "printranges" : [ + * { + * "sheet": 0, + * "ranges": [ + * [0, 0, 4, 5], + * [5, 100, 8, 150] + * ] + * }, + * { + * "sheet": 3, + * "ranges": [ + * [1, 0, 6, 10], + * [3, 200, 6, 230] + * ] + * } + * ] + * } + * + * The format of the inner "ranges" array for each sheet is + * [, , , ] + */ + LOK_CALLBACK_PRINT_RANGES = 56, } LibreOfficeKitCallbackType; @@ -951,6 +980,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_SC_FOLLOW_JUMP"; case LOK_CALLBACK_CONTENT_CONTROL: return "LOK_CALLBACK_CONTENT_CONTROL"; + case LOK_CALLBACK_PRINT_RANGES: + return "LOK_CALLBACK_PRINT_RANGES"; } assert(!"Unknown LibreOfficeKitCallbackType type."); -- cgit