summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--comphelper/source/misc/lok.cxx12
-rw-r--r--desktop/source/lib/init.cxx4
-rw-r--r--include/comphelper/lok.hxx5
3 files changed, 21 insertions, 0 deletions
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index a6abd2a65486..279ec65c600c 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -17,6 +17,8 @@ namespace LibreOfficeKit
static bool g_bActive(false);
+static bool g_bViewCallback(false);
+
void setActive(bool bActive)
{
g_bActive = bActive;
@@ -27,6 +29,16 @@ bool isActive()
return g_bActive;
}
+void setViewCallback(bool bViewCallback)
+{
+ g_bViewCallback = bViewCallback;
+}
+
+bool isViewCallback()
+{
+ return g_bViewCallback;
+}
+
static void (*pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent)(nullptr);
static void *pStatusIndicatorCallbackData(nullptr);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c4301fd7695e..0aadc3b5d130 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1189,6 +1189,10 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
return 1;
comphelper::LibreOfficeKit::setActive();
+
+ static bool bViewCallback = getenv("LOK_VIEW_CALLBACK");
+ comphelper::LibreOfficeKit::setViewCallback(bViewCallback);
+
comphelper::LibreOfficeKit::setStatusIndicatorCallback(lo_status_indicator_callback, pLib);
if (pUserProfilePath)
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index 79fa115e6585..2cc38c60e455 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -36,6 +36,11 @@ COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void *data
// Check whether the code is running as invoked through LibreOfficeKit.
COMPHELPER_DLLPUBLIC bool isActive();
+/// Check whether clients register a callback for each view.
+COMPHELPER_DLLPUBLIC bool isViewCallback();
+/// Set whether clients register a callback for each view.
+COMPHELPER_DLLPUBLIC void setViewCallback(bool bViewCallback);
+
// Status indicator handling. Even if in theory there could be several status indicators active at
// the same time, in practice there is only one at a time, so we don't handle any identification of
// status indicator in this API.