summaryrefslogtreecommitdiffstats
path: root/include/LibreOfficeKit
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2021-09-17 19:13:15 +0530
committerMiklos Vajna <vmiklos@collabora.com>2021-10-22 17:49:20 +0200
commitc4b934128965cbd461f1c61255fe0c5d25cc29d6 (patch)
tree04e4015769ed37bf876e3e7eec12bb863070cd97 /include/LibreOfficeKit
parentLOK: unify freemium APIs and uno command restriction APIs (diff)
downloadcore-c4b934128965cbd461f1c61255fe0c5d25cc29d6.tar.gz
core-c4b934128965cbd461f1c61255fe0c5d25cc29d6.zip
LOK: maintain blocked command list per view
Conflicts: include/LibreOfficeKit/LibreOfficeKitEnums.h include/sfx2/viewsh.hxx libreofficekit/source/gtk/lokdocview.cxx sfx2/source/view/viewsh.cxx Change-Id: I7c621accd84f49447ab3e08a4bb662a9b91b834a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124049 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h7
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx9
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitEnums.h9
3 files changed, 11 insertions, 14 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 72beeb613246..29ffeff44bbb 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -460,14 +460,9 @@ struct _LibreOfficeKitDocumentClass
/// @see lok::Document::setBlockedCommandList
void (*setBlockedCommandList) (LibreOfficeKitDocument* pThis,
+ int nViewId,
const char* bolckedCommandList);
- /// @see lok::Document::setBlockedCommandView
- void (*setBlockedCommandView) (LibreOfficeKitDocument* pThis,
- int nViewId,
- const char* type,
- bool isBlocked);
-
/// @see lok::Document::renderSearchResult
bool (*renderSearchResult) (LibreOfficeKitDocument* pThis,
const char* pSearchResult,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 114438445350..bde89ec4240c 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -787,14 +787,9 @@ public:
mpDoc->pClass->sendFormFieldEvent(mpDoc, pArguments);
}
- void setBlockedCommandList(const char* bolckedCommandList)
+ void setBlockedCommandList(int nViewId, const char* bolckedCommandList)
{
- mpDoc->pClass->setBlockedCommandList(mpDoc, bolckedCommandList);
- }
-
- void setBlockedCommandView(int nViewId, const char* type, bool isBlocked)
- {
- mpDoc->pClass->setBlockedCommandView(mpDoc, nViewId, type, isBlocked);
+ mpDoc->pClass->setBlockedCommandList(mpDoc, nViewId, bolckedCommandList);
}
/**
* Render input search result to a bitmap buffer.
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 497a5eacc804..006713447aed 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -780,6 +780,11 @@ typedef enum
LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR = 52,
/**
+ * When a user tries to use command which is restricted for that user
+ */
+ LOK_COMMAND_BLOCKED = 53,
+
+ /**
* The position of the cell cursor jumped to.
*
* Payload format: "x, y, width, height, column, row", where the first
@@ -789,7 +794,7 @@ typedef enum
*
* Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES.
*/
- LOK_CALLBACK_SC_FOLLOW_JUMP = 53,
+ LOK_CALLBACK_SC_FOLLOW_JUMP = 54,
}
LibreOfficeKitCallbackType;
@@ -924,6 +929,8 @@ static inline const char* lokCallbackTypeToString(int nType)
return "LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY";
case LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR:
return "LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR";
+ case LOK_COMMAND_BLOCKED:
+ return "LOK_COMMAND_BLOCKED";
case LOK_CALLBACK_SC_FOLLOW_JUMP:
return "LOK_CALLBACK_SC_FOLLOW_JUMP";
}