summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2021-09-15 23:39:32 +0530
committerMiklos Vajna <vmiklos@collabora.com>2021-10-22 16:54:20 +0200
commitd05c69a892535b910943fe98fbce42f5cc860aa4 (patch)
tree10dfcfc58a5456627821d3903f7c013a8f585e6c /include
parent6c9909dee4b06948ca6932397caa338d77ec7290 (diff)
LOK: unify freemium APIs and uno command restriction APIs
Conflicts: include/LibreOfficeKit/LibreOfficeKit.hxx sfx2/source/control/unoctitm.cxx Change-Id: I3badb038822331ab5cb30df6a66ce9a0640cf340 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124047 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h22
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx17
-rw-r--r--include/comphelper/lok.hxx8
-rw-r--r--include/sfx2/lokhelper.hxx6
4 files changed, 17 insertions, 36 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 6a94583b8bf3..72beeb613246 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -458,23 +458,15 @@ struct _LibreOfficeKitDocumentClass
void (*sendFormFieldEvent) (LibreOfficeKitDocument* pThis,
const char* pArguments);
- /// @see lok::Document::setFreemiumDenyList
- void (*setFreemiumDenyList) (LibreOfficeKitDocument* pThis,
- const char* freemiumDenyList);
+ /// @see lok::Document::setBlockedCommandList
+ void (*setBlockedCommandList) (LibreOfficeKitDocument* pThis,
+ const char* bolckedCommandList);
- /// @see lok::Document::setFreemiumView
- void (*setFreemiumView) (LibreOfficeKitDocument* pThis,
+ /// @see lok::Document::setBlockedCommandView
+ void (*setBlockedCommandView) (LibreOfficeKitDocument* pThis,
int nViewId,
- bool isFreemium);
-
- /// @see lok::Document::setRestrictedCommandList
- void (*setRestrictedCommandList) (LibreOfficeKitDocument* pThis,
- const char* restrictedCommandList);
-
- /// @see lok::Document::setRestrictedView
- void (*setRestrictedView) (LibreOfficeKitDocument* pThis,
- int nViewId,
- bool isRestricted);
+ const char* type,
+ bool isBlocked);
/// @see lok::Document::renderSearchResult
bool (*renderSearchResult) (LibreOfficeKitDocument* pThis,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 9215ffae6048..114438445350 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -787,23 +787,14 @@ public:
mpDoc->pClass->sendFormFieldEvent(mpDoc, pArguments);
}
- void setFreemiumDenyList(const char* freemiumDenyList)
+ void setBlockedCommandList(const char* bolckedCommandList)
{
- mpDoc->pClass->setFreemiumDenyList(mpDoc, freemiumDenyList);
+ mpDoc->pClass->setBlockedCommandList(mpDoc, bolckedCommandList);
}
- void setFreemiumView(int nViewId, bool isFreemium)
+ void setBlockedCommandView(int nViewId, const char* type, bool isBlocked)
{
- mpDoc->pClass->setFreemiumView(mpDoc, nViewId, isFreemium);
- }
- void setRestrictedCommandList(const char* restrictedCommandList)
- {
- mpDoc->pClass->setRestrictedCommandList(mpDoc, restrictedCommandList);
- }
-
- void setRestrictedView(int nViewId, bool isRestricted)
- {
- mpDoc->pClass->setRestrictedView(mpDoc, nViewId, isRestricted);
+ mpDoc->pClass->setBlockedCommandView(mpDoc, nViewId, type, isBlocked);
}
/**
* Render input search result to a bitmap buffer.
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index 847c56012565..1ea5b23f017d 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -13,6 +13,7 @@
#include <comphelper/comphelperdllapi.h>
#include <rtl/ustring.hxx>
#include <vector>
+#include <unordered_set>
class LanguageTag;
@@ -110,12 +111,11 @@ COMPHELPER_DLLPUBLIC void statusIndicatorStart(const OUString& sText);
COMPHELPER_DLLPUBLIC void statusIndicatorSetValue(int percent);
COMPHELPER_DLLPUBLIC void statusIndicatorFinish();
-COMPHELPER_DLLPUBLIC void setFreemiumDenyList(const char* freemiumDenyList);
-COMPHELPER_DLLPUBLIC const std::vector<OUString>& getFreemiumDenyList();
+COMPHELPER_DLLPUBLIC void setBlockedCommandList(const char* bolckedCommandList);
+COMPHELPER_DLLPUBLIC const std::unordered_set<OUString>& getFreemiumDenyList();
COMPHELPER_DLLPUBLIC bool isCommandFreemiumDenied(const OUString& command);
-COMPHELPER_DLLPUBLIC void setRestrictedCommandList(const char* restrictedCommandList);
-COMPHELPER_DLLPUBLIC const std::vector<OUString>& getRestrictedCommandList();
+COMPHELPER_DLLPUBLIC const std::unordered_set<OUString>& getRestrictedCommandList();
COMPHELPER_DLLPUBLIC bool isRestrictedCommand(const OUString& command);
}
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 982296600d48..f37d70f30abf 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -63,10 +63,8 @@ public:
static std::size_t getViewsCount(int nDocId);
/// Get viewIds of views of the current DocId.
static bool getViewIds(int nDocId, int* pArray, size_t nSize);
- /// Set View Freemium
- static void setFreemiumView(int nViewId, bool isFreemium);
- /// Set View Restricted
- static void setRestrictedView(int nViewId, bool isRestricted);
+ /// Set View Blocked for some uno commands
+ static void setBlockedCommandView(int nViewId, const OUString& type, bool isBlocked);
/// Get the document id for a view
static int getDocumentIdOfView(int nViewId);
/// Get the default language that should be used for views