diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-04-21 17:37:57 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2021-04-28 09:30:17 +0200 |
commit | 41ff704cc49b7097b717882616011962ecd7198f (patch) | |
tree | 65c94d0f52acebe9c637e0de1a636dd2f0b79cfc /include/LibreOfficeKit | |
parent | 9bfe083adf1fd9d470b600d0a801d144db24474f (diff) |
Add API to LibreOfficeKit to set arbitrary run-time options in core
Add setOption(const char*, const char*)
At the moment this enables starting and stopping the ProfileZone event
recording and overriding the SAL_LOG environment variable.
Change-Id: Ic3a934bb4246c755a91eee8a8343fafc15815116
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114439
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114559
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114656
Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 3 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 33 |
2 files changed, 36 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 2279260d0e90..82738d65ff93 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -115,6 +115,9 @@ struct _LibreOfficeKitClass void (*sendDialogEvent) (LibreOfficeKit* pThis, unsigned long long int nLOKWindowId, const char* pArguments); + + /// @see lok::Office::setOption + void (*setOption) (LibreOfficeKit* pThis, const char* pOption, const char* pValue); }; #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize) diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 962270452e20..06fe5abc19e2 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -990,6 +990,39 @@ public: { mpThis->pClass->sendDialogEvent(mpThis, nWindowId, pArguments); } + + /** + * Generic function to toggle and tweak various things in the core LO + * + * The currently available option names and their allowed values are: + * + * "profilezonerecording": "start" or "stop" + * Start or stop recording profile zone trace data in the process. + * + * "sallogoverride": "<string>" + * Override the SAL_LOG environment variable + * + * For the syntax of the string see the documentation for "Basic + * logging functionality" in LibreOffice internal API + * documentation (include/sal/log.hxx). If the logging selector + * has been set by this function to a non-empty value, that is used + * instead of the environment variable SAL_LOG. + * + * The parameter is not copied so you should pass a value that + * points to memory that will stay valid until you call setOption + * with this option name the next time. + * + * If you pass nullptr or an empty string as value, the + * environment variable SAL_LOG is again used as by default. You + * can switch back and forth as you like. + * + * @param pOption the option name + * @param pValue its value + */ + void setOption(const char* pOption, const char* pValue) + { + mpThis->pClass->setOption(mpThis, pOption, pValue); + } }; /// Factory method to create a lok::Office instance. |