11#include <osl/process.h>
41class LanguageAndLocale
216#if defined ANDROID || defined IOS
220 static const std::vector<OUString> aAllowlist = [] {
221 std::vector<OUString> aList;
223 const char* pAllowlist = getenv(
"LOK_ALLOWLIST_LANGUAGES");
226 std::stringstream
stream(pAllowlist);
229 std::cerr <<
"Allowlisted languages: ";
230 while (getline(
stream, s,
' ')) {
234 std::cerr << s <<
" ";
235 aList.emplace_back(OStringToOUString(s, RTL_TEXTENCODING_UTF8));
237 std::cerr << std::endl;
241 std::cerr <<
"No language allowlisted, turning off the language support." << std::endl;
246 if (aAllowlist.empty())
249 for (
const auto& entry : aAllowlist)
251 if (lang.startsWith(entry))
253 if (lang.startsWith(entry.replace(
'_',
'-')))
266 osl_setEnvironment(OUString(
"TZ").
pData, rTimezone.pData);
272 osl_clearEnvironment(OUString(
"TZ").
pData);
LanguageType getLanguageType(bool bResolveSystem=true) const
const OUString & getBcp47(bool bResolveSystem=true) const
Reference< XOutputStream > stream
#define SAL_INFO_IF(condition, area, stream)
#define SAL_INFO(area, stream)
LanguageTag maLocaleLanguageTag
LanguageTag maLanguageTag
std::unique_ptr< sal_Int32[]> pData
void statusIndicatorStart(const OUString &sText)
void statusIndicatorFinish()
void setTiledPainting(bool bTiledPainting)
Set if we are doing tiled painting.
static bool g_bLocalRendering(false)
void setCompatFlag(Compat flag)
Set compatibility flags.
double getDPIScale()
Get the DPI scale for rendering for HiDPI displays.
static Compat g_eCompatFlags(Compat::none)
void setDialogPainting(bool bDialogPainting)
Set if we are painting the dialog.
static bool g_bPartInInvalidation(false)
bool isDialogPainting()
Check if we are painting the dialog.
bool isTiledPainting()
Check if we are doing tiled painting.
void setTimezone(bool isSet, const OUString &rTimezone)
Update the current LOK's timezone.
static bool g_bTiledPainting(false)
bool isTiledAnnotations()
Check if annotations rendering is turned off.
statusIndicatorCallbackType
void statusIndicatorSetValue(int percent)
static bool g_bViewIdForVisCursorInvalidation(false)
static void * pStatusIndicatorCallbackData(nullptr)
static bool g_bTiledAnnotations(true)
bool isAllowlistedLanguage(const OUString &lang)
If the language name should be used for this LOK instance.
bool isCompatFlagSet(Compat flag)
Get compatibility flags.
bool isPartInInvalidation()
Check whether clients want a part number in an invalidation payload.
const LanguageTag & getLocale()
Get the current LOK's locale.
bool isRangeHeaders()
Check if range based header data is enabled.
static bool g_bRangeHeaders(false)
void setRangeHeaders(bool bRangeHeaders)
Set if we want range based header data.
static double g_fDPIScale(1.0)
Scaling of the cairo canvas painting for hi-dpi.
const LanguageTag & getLanguageTag()
Get the current LOK's language.
void setPartInInvalidation(bool bPartInInvalidation)
Set whether clients want a part number in an invalidation payload.
static LanguageAndLocale g_aLanguageAndLocale
void resetCompatFlag()
Reset compatibility flags.
static bool g_bDialogPainting(false)
bool isViewIdForVisCursorInvalidation()
Check whether clients want viewId in visible cursor invalidation payload.
void setLocale(const LanguageTag &rLanguageTag)
Update the current LOK's locale.
void setTiledAnnotations(bool bTiledAnnotations)
Set if we want no annotations rendering.
void setLanguageTag(const LanguageTag &rLanguageTag)
Update the current LOK's language.
void setStatusIndicatorCallback(void(*callback)(void *data, statusIndicatorCallbackType type, int percent, const char *pText), void *data)
void setLocalRendering(bool bLocalRendering)
Shift the coordinates before rendering each bitmap.
void setActive(bool bActive)
void setViewIdForVisCursorInvalidation(bool bViewIdForVisCursorInvalidation)
Set whether clients want viewId in visible cursor invalidation payload.
void setDPIScale(double fDPIScale)
Set the DPI scale for rendering for HiDPI displays.
static bool g_bActive(false)
static void(* pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent, const char *pText)(nullptr)