1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_COMPHELPER_LOK_HXX
11 #define INCLUDED_COMPHELPER_LOK_HXX
13 #include <comphelper/comphelperdllapi.h>
14 #include <rtl/ustring.hxx>
18 // Interface between the LibreOfficeKit implementation called by LibreOfficeKit clients and other
21 namespace comphelper::LibreOfficeKit
23 // Functions to be called only from the LibreOfficeKit implementation in desktop, not from other
24 // places in LibreOffice code.
26 COMPHELPER_DLLPUBLIC
void setActive(bool bActive
= true);
28 enum class statusIndicatorCallbackType
35 COMPHELPER_DLLPUBLIC
void setStatusIndicatorCallback(
36 void (*callback
)(void* data
, statusIndicatorCallbackType type
, int percent
, const char* pText
),
39 // Functions that can be called from arbitrary places in LibreOffice.
41 // Check whether the code is running as invoked through LibreOfficeKit.
42 COMPHELPER_DLLPUBLIC
bool isActive();
44 /// Shift the coordinates before rendering each bitmap.
45 /// Used by Calc to render each tile separately.
46 /// This should be unnecessary (and removed) once Calc
47 /// moves to using 100MM Unit.
48 COMPHELPER_DLLPUBLIC
void setLocalRendering(bool bLocalRendering
= true);
49 COMPHELPER_DLLPUBLIC
bool isLocalRendering();
51 /// Check whether clients want a part number in an invalidation payload.
52 COMPHELPER_DLLPUBLIC
bool isPartInInvalidation();
53 /// Set whether clients want a part number in an invalidation payload.
54 COMPHELPER_DLLPUBLIC
void setPartInInvalidation(bool bPartInInvalidation
);
56 /// Check if we are doing tiled painting.
57 COMPHELPER_DLLPUBLIC
bool isTiledPainting();
58 /// Set if we are doing tiled painting.
59 COMPHELPER_DLLPUBLIC
void setTiledPainting(bool bTiledPainting
);
60 /// Check if we are painting the dialog.
61 COMPHELPER_DLLPUBLIC
bool isDialogPainting();
62 /// Set if we are painting the dialog.
63 COMPHELPER_DLLPUBLIC
void setDialogPainting(bool bDialogPainting
);
64 /// Set the DPI scale for rendering for HiDPI displays.
65 COMPHELPER_DLLPUBLIC
void setDPIScale(double fDPIScale
);
66 /// Get the DPI scale for rendering for HiDPI displays.
67 COMPHELPER_DLLPUBLIC
double getDPIScale();
68 /// Set if we want no annotations rendering
69 COMPHELPER_DLLPUBLIC
void setTiledAnnotations(bool bTiledAnnotations
);
70 /// Check if annotations rendering is turned off
71 COMPHELPER_DLLPUBLIC
bool isTiledAnnotations();
72 /// Set if we want range based header data
73 COMPHELPER_DLLPUBLIC
void setRangeHeaders(bool bTiledAnnotations
);
74 /// Check if range based header data is enabled
75 COMPHELPER_DLLPUBLIC
bool isRangeHeaders();
77 enum Compat
: sal_uInt32
80 scNoGridBackground
= 1,
83 /// Set compatibility flags
84 COMPHELPER_DLLPUBLIC
void setCompatFlag(Compat flag
);
85 /// Get compatibility flags
86 COMPHELPER_DLLPUBLIC
bool isCompatFlagSet(Compat flag
);
87 /// Reset compatibility flags
88 COMPHELPER_DLLPUBLIC
void resetCompatFlag();
90 /// Check whether clients want viewId in visible cursor invalidation payload.
91 COMPHELPER_DLLPUBLIC
bool isViewIdForVisCursorInvalidation();
92 /// Set whether clients want viewId in visible cursor invalidation payload.
93 COMPHELPER_DLLPUBLIC
void setViewIdForVisCursorInvalidation(bool bViewIdForVisCursorInvalidation
);
95 /// Update the current LOK's locale.
96 COMPHELPER_DLLPUBLIC
void setLocale(const LanguageTag
& languageTag
);
97 /// Get the current LOK's locale.
98 COMPHELPER_DLLPUBLIC
const LanguageTag
& getLocale();
100 /// Update the current LOK's language.
101 COMPHELPER_DLLPUBLIC
void setLanguageTag(const LanguageTag
& languageTag
);
102 /// Get the current LOK's language.
103 COMPHELPER_DLLPUBLIC
const LanguageTag
& getLanguageTag();
104 /// If the language name should be used for this LOK instance.
105 COMPHELPER_DLLPUBLIC
bool isAllowlistedLanguage(const OUString
& lang
);
107 /// Update the current LOK's timezone.
108 COMPHELPER_DLLPUBLIC
void setTimezone(bool isSet
, const OUString
& rTimezone
);
110 // Status indicator handling. Even if in theory there could be several status indicators active at
111 // the same time, in practice there is only one at a time, so we don't handle any identification of
112 // status indicator in this API.
113 COMPHELPER_DLLPUBLIC
void statusIndicatorStart(const OUString
& sText
);
114 COMPHELPER_DLLPUBLIC
void statusIndicatorSetValue(int percent
);
115 COMPHELPER_DLLPUBLIC
void statusIndicatorFinish();
117 COMPHELPER_DLLPUBLIC
void setBlockedCommandList(const char* blockedCommandList
);
120 #endif // INCLUDED_COMPHELPER_LOK_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */