2015-05-06 16:31:39 +03:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
2015-03-29 22:59:22 +03:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2015-04-02 13:22:04 +03:00
|
|
|
#ifndef INCLUDED_COMPHELPER_LOK_HXX
|
|
|
|
#define INCLUDED_COMPHELPER_LOK_HXX
|
2015-03-29 22:59:22 +03:00
|
|
|
|
2024-08-14 09:14:02 +02:00
|
|
|
#include <functional>
|
|
|
|
|
2015-04-02 13:22:04 +03:00
|
|
|
#include <comphelper/comphelperdllapi.h>
|
2018-09-20 20:26:40 +02:00
|
|
|
#include <rtl/ustring.hxx>
|
2015-03-29 22:59:22 +03:00
|
|
|
|
2018-09-20 20:26:40 +02:00
|
|
|
class LanguageTag;
|
2017-12-12 18:13:03 +01:00
|
|
|
|
2015-05-06 16:31:39 +03:00
|
|
|
// Interface between the LibreOfficeKit implementation called by LibreOfficeKit clients and other
|
|
|
|
// LibreOffice code.
|
|
|
|
|
2020-07-19 18:45:07 +02:00
|
|
|
namespace comphelper::LibreOfficeKit
|
2015-03-29 22:59:22 +03:00
|
|
|
{
|
2024-02-06 18:05:09 +00:00
|
|
|
/// interface for allowing threads to be transiently shutdown.
|
|
|
|
class COMPHELPER_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") ThreadJoinable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/// shutdown and join threads, @returns true on success
|
|
|
|
virtual bool joinThreads() = 0;
|
2024-05-18 22:08:22 +01:00
|
|
|
/// restart any required threads, usually are demand-restarted
|
|
|
|
virtual void startThreads() {}
|
2024-02-06 18:05:09 +00:00
|
|
|
};
|
|
|
|
|
2015-05-06 16:31:39 +03:00
|
|
|
// Functions to be called only from the LibreOfficeKit implementation in desktop, not from other
|
|
|
|
// places in LibreOffice code.
|
2015-03-29 22:59:22 +03:00
|
|
|
|
2015-06-18 14:12:04 +02:00
|
|
|
COMPHELPER_DLLPUBLIC void setActive(bool bActive = true);
|
2015-03-29 22:59:22 +03:00
|
|
|
|
2024-03-27 17:25:24 +00:00
|
|
|
COMPHELPER_DLLPUBLIC void setForkedChild(bool bIsChild = true);
|
|
|
|
|
2015-05-06 16:00:35 +03:00
|
|
|
enum class statusIndicatorCallbackType
|
|
|
|
{
|
|
|
|
Start,
|
|
|
|
SetValue,
|
|
|
|
Finish
|
|
|
|
};
|
|
|
|
|
|
|
|
COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(
|
2021-07-08 16:21:46 -04:00
|
|
|
void (*callback)(void* data, statusIndicatorCallbackType type, int percent, const char* pText),
|
|
|
|
void* data);
|
2015-05-06 16:00:35 +03:00
|
|
|
|
2015-05-06 16:31:39 +03:00
|
|
|
// Functions that can be called from arbitrary places in LibreOffice.
|
|
|
|
|
|
|
|
// Check whether the code is running as invoked through LibreOfficeKit.
|
|
|
|
COMPHELPER_DLLPUBLIC bool isActive();
|
2015-05-06 16:00:35 +03:00
|
|
|
|
2024-03-27 17:25:24 +00:00
|
|
|
/// Is this a transient forked child process, that shares many
|
|
|
|
/// eg. file-system resources with its parent process?
|
|
|
|
COMPHELPER_DLLPUBLIC bool isForkedChild();
|
|
|
|
|
2016-06-16 07:28:58 -04:00
|
|
|
/// Shift the coordinates before rendering each bitmap.
|
|
|
|
/// Used by Calc to render each tile separately.
|
|
|
|
/// This should be unnecessary (and removed) once Calc
|
|
|
|
/// moves to using 100MM Unit.
|
|
|
|
COMPHELPER_DLLPUBLIC void setLocalRendering(bool bLocalRendering = true);
|
|
|
|
COMPHELPER_DLLPUBLIC bool isLocalRendering();
|
|
|
|
|
2016-09-29 12:49:23 +02:00
|
|
|
/// Check whether clients want a part number in an invalidation payload.
|
|
|
|
COMPHELPER_DLLPUBLIC bool isPartInInvalidation();
|
|
|
|
/// Set whether clients want a part number in an invalidation payload.
|
|
|
|
COMPHELPER_DLLPUBLIC void setPartInInvalidation(bool bPartInInvalidation);
|
2016-06-16 07:28:58 -04:00
|
|
|
|
2016-10-04 10:56:55 +02:00
|
|
|
/// Check if we are doing tiled painting.
|
|
|
|
COMPHELPER_DLLPUBLIC bool isTiledPainting();
|
|
|
|
/// Set if we are doing tiled painting.
|
|
|
|
COMPHELPER_DLLPUBLIC void setTiledPainting(bool bTiledPainting);
|
2017-07-28 18:07:44 +05:30
|
|
|
/// Check if we are painting the dialog.
|
|
|
|
COMPHELPER_DLLPUBLIC bool isDialogPainting();
|
|
|
|
/// Set if we are painting the dialog.
|
|
|
|
COMPHELPER_DLLPUBLIC void setDialogPainting(bool bDialogPainting);
|
2019-10-28 20:43:46 +00:00
|
|
|
/// Set the DPI scale for rendering for HiDPI displays.
|
2018-10-23 17:20:38 +02:00
|
|
|
COMPHELPER_DLLPUBLIC void setDPIScale(double fDPIScale);
|
2019-10-28 20:43:46 +00:00
|
|
|
/// Get the DPI scale for rendering for HiDPI displays.
|
2018-10-23 17:20:38 +02:00
|
|
|
COMPHELPER_DLLPUBLIC double getDPIScale();
|
2017-01-23 21:53:49 +05:30
|
|
|
/// Set if we want no annotations rendering
|
|
|
|
COMPHELPER_DLLPUBLIC void setTiledAnnotations(bool bTiledAnnotations);
|
|
|
|
/// Check if annotations rendering is turned off
|
|
|
|
COMPHELPER_DLLPUBLIC bool isTiledAnnotations();
|
2017-12-08 16:44:09 +01:00
|
|
|
/// Set if we want range based header data
|
|
|
|
COMPHELPER_DLLPUBLIC void setRangeHeaders(bool bTiledAnnotations);
|
|
|
|
/// Check if range based header data is enabled
|
|
|
|
COMPHELPER_DLLPUBLIC bool isRangeHeaders();
|
2016-10-04 10:56:55 +02:00
|
|
|
|
2019-07-12 20:01:57 +10:00
|
|
|
enum Compat : sal_uInt32
|
|
|
|
{
|
|
|
|
none = 0,
|
|
|
|
scNoGridBackground = 1,
|
2020-05-19 13:37:04 +05:30
|
|
|
scPrintTwipsMsgs = 2,
|
2019-07-12 20:01:57 +10:00
|
|
|
};
|
|
|
|
/// Set compatibility flags
|
|
|
|
COMPHELPER_DLLPUBLIC void setCompatFlag(Compat flag);
|
|
|
|
/// Get compatibility flags
|
|
|
|
COMPHELPER_DLLPUBLIC bool isCompatFlagSet(Compat flag);
|
2023-03-13 12:14:14 +01:00
|
|
|
/// Reset compatibility flags
|
|
|
|
COMPHELPER_DLLPUBLIC void resetCompatFlag();
|
2019-07-12 20:01:57 +10:00
|
|
|
|
2018-04-05 22:23:28 +02:00
|
|
|
/// Check whether clients want viewId in visible cursor invalidation payload.
|
|
|
|
COMPHELPER_DLLPUBLIC bool isViewIdForVisCursorInvalidation();
|
|
|
|
/// Set whether clients want viewId in visible cursor invalidation payload.
|
|
|
|
COMPHELPER_DLLPUBLIC void setViewIdForVisCursorInvalidation(bool bViewIdForVisCursorInvalidation);
|
|
|
|
|
2020-02-24 08:07:12 +01:00
|
|
|
/// Update the current LOK's locale.
|
|
|
|
COMPHELPER_DLLPUBLIC void setLocale(const LanguageTag& languageTag);
|
|
|
|
/// Get the current LOK's locale.
|
|
|
|
COMPHELPER_DLLPUBLIC const LanguageTag& getLocale();
|
|
|
|
|
2017-12-12 18:13:03 +01:00
|
|
|
/// Update the current LOK's language.
|
|
|
|
COMPHELPER_DLLPUBLIC void setLanguageTag(const LanguageTag& languageTag);
|
|
|
|
/// Get the current LOK's language.
|
|
|
|
COMPHELPER_DLLPUBLIC const LanguageTag& getLanguageTag();
|
2018-01-26 20:28:46 +01:00
|
|
|
/// If the language name should be used for this LOK instance.
|
2020-07-06 03:39:12 +02:00
|
|
|
COMPHELPER_DLLPUBLIC bool isAllowlistedLanguage(const OUString& lang);
|
2017-12-12 18:13:03 +01:00
|
|
|
|
2022-12-23 13:02:57 -05:00
|
|
|
/// Update the current LOK's timezone.
|
|
|
|
COMPHELPER_DLLPUBLIC void setTimezone(bool isSet, const OUString& rTimezone);
|
|
|
|
|
2015-05-06 16:31:39 +03:00
|
|
|
// 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.
|
2021-07-08 16:21:46 -04:00
|
|
|
COMPHELPER_DLLPUBLIC void statusIndicatorStart(const OUString& sText);
|
2015-05-06 16:31:39 +03:00
|
|
|
COMPHELPER_DLLPUBLIC void statusIndicatorSetValue(int percent);
|
2015-05-06 16:00:35 +03:00
|
|
|
COMPHELPER_DLLPUBLIC void statusIndicatorFinish();
|
2021-06-02 19:06:52 +05:30
|
|
|
|
2021-10-22 23:28:29 +02:00
|
|
|
COMPHELPER_DLLPUBLIC void setBlockedCommandList(const char* blockedCommandList);
|
2024-08-14 09:14:02 +02:00
|
|
|
|
2024-08-15 19:59:16 +01:00
|
|
|
COMPHELPER_DLLPUBLIC void setAnyInputCallback(const std::function<bool(void*)>& pAnyInputCallback,
|
2024-08-14 09:14:02 +02:00
|
|
|
void* pData);
|
|
|
|
COMPHELPER_DLLPUBLIC bool anyInput();
|
2015-03-29 22:59:22 +03:00
|
|
|
}
|
|
|
|
|
2015-04-02 13:22:04 +03:00
|
|
|
#endif // INCLUDED_COMPHELPER_LOK_HXX
|
2015-03-29 22:59:22 +03:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|