LibreOffice Module comphelper (master)  1
lok.hxx
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  */
9 
10 #ifndef INCLUDED_COMPHELPER_LOK_HXX
11 #define INCLUDED_COMPHELPER_LOK_HXX
12 
14 #include <rtl/ustring.hxx>
15 
16 class LanguageTag;
17 
18 // Interface between the LibreOfficeKit implementation called by LibreOfficeKit clients and other
19 // LibreOffice code.
20 
22 {
23 // Functions to be called only from the LibreOfficeKit implementation in desktop, not from other
24 // places in LibreOffice code.
25 
26 COMPHELPER_DLLPUBLIC void setActive(bool bActive = true);
27 
29 {
30  Start,
31  SetValue,
32  Finish
33 };
34 
36  void (*callback)(void* data, statusIndicatorCallbackType type, int percent, const char* pText),
37  void* data);
38 
39 // Functions that can be called from arbitrary places in LibreOffice.
40 
41 // Check whether the code is running as invoked through LibreOfficeKit.
43 
48 COMPHELPER_DLLPUBLIC void setLocalRendering(bool bLocalRendering = true);
50 
54 COMPHELPER_DLLPUBLIC void setPartInInvalidation(bool bPartInInvalidation);
55 
59 COMPHELPER_DLLPUBLIC void setTiledPainting(bool bTiledPainting);
63 COMPHELPER_DLLPUBLIC void setDialogPainting(bool bDialogPainting);
65 COMPHELPER_DLLPUBLIC void setDPIScale(double fDPIScale);
69 COMPHELPER_DLLPUBLIC void setTiledAnnotations(bool bTiledAnnotations);
73 COMPHELPER_DLLPUBLIC void setRangeHeaders(bool bTiledAnnotations);
76 
77 enum Compat : sal_uInt32
78 {
79  none = 0,
82 };
87 
91 COMPHELPER_DLLPUBLIC void setViewIdForVisCursorInvalidation(bool bViewIdForVisCursorInvalidation);
92 
94 COMPHELPER_DLLPUBLIC void setLocale(const LanguageTag& languageTag);
97 
99 COMPHELPER_DLLPUBLIC void setLanguageTag(const LanguageTag& languageTag);
103 COMPHELPER_DLLPUBLIC bool isAllowlistedLanguage(const OUString& lang);
104 
105 // Status indicator handling. Even if in theory there could be several status indicators active at
106 // the same time, in practice there is only one at a time, so we don't handle any identification of
107 // status indicator in this API.
108 COMPHELPER_DLLPUBLIC void statusIndicatorStart(const OUString& sText);
111 
112 COMPHELPER_DLLPUBLIC void setBlockedCommandList(const char* blockedCommandList);
113 }
114 
115 #endif // INCLUDED_COMPHELPER_LOK_HXX
116 
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool isAllowlistedLanguage(const OUString &lang)
If the language name should be used for this LOK instance.
Definition: lok.cxx:209
bool isTiledAnnotations()
Check if annotations rendering is turned off.
Definition: lok.cxx:146
void setViewIdForVisCursorInvalidation(bool bViewIdForVisCursorInvalidation)
Set whether clients want viewId in visible cursor invalidation payload.
Definition: lok.cxx:156
void statusIndicatorFinish()
Definition: lok.cxx:280
void setStatusIndicatorCallback(void(*callback)(void *data, statusIndicatorCallbackType type, int percent, const char *pText), void *data)
Definition: lok.cxx:262
COMPHELPER_DLLPUBLIC void setBlockedCommandList(const char *blockedCommandList)
void setTiledPainting(bool bTiledPainting)
Set if we are doing tiled painting.
Definition: lok.cxx:111
void setDPIScale(double fDPIScale)
Set the DPI scale for rendering for HiDPI displays.
Definition: lok.cxx:131
void setLanguageTag(const LanguageTag &rLanguageTag)
Update the current LOK's language.
Definition: lok.cxx:197
bool isRangeHeaders()
Check if range based header data is enabled.
Definition: lok.cxx:166
bool isCompatFlagSet(Compat flag)
Get compatibility flags.
Definition: lok.cxx:183
bool isTiledPainting()
Check if we are doing tiled painting.
Definition: lok.cxx:116
bool isDialogPainting()
Check if we are painting the dialog.
Definition: lok.cxx:126
bool isPartInInvalidation()
Check whether clients want a part number in an invalidation payload.
Definition: lok.cxx:106
void setRangeHeaders(bool bRangeHeaders)
Set if we want range based header data.
Definition: lok.cxx:151
void setLocalRendering(bool bLocalRendering)
Shift the coordinates before rendering each bitmap.
Definition: lok.cxx:171
const LanguageTag & getLanguageTag()
Get the current LOK's language.
Definition: lok.cxx:202
void setDialogPainting(bool bDialogPainting)
Set if we are painting the dialog.
Definition: lok.cxx:121
void statusIndicatorSetValue(int percent)
Definition: lok.cxx:274
void setCompatFlag(Compat flag)
Set compatibility flags.
Definition: lok.cxx:181
const LanguageTag & getLocale()
Get the current LOK's locale.
Definition: lok.cxx:190
bool isViewIdForVisCursorInvalidation()
Check whether clients want viewId in visible cursor invalidation payload.
Definition: lok.cxx:161
void statusIndicatorStart(const OUString &sText)
Definition: lok.cxx:268
void setTiledAnnotations(bool bTiledAnnotations)
Set if we want no annotations rendering.
Definition: lok.cxx:141
#define COMPHELPER_DLLPUBLIC
void setActive(bool bActive)
Definition: lok.cxx:91
void setPartInInvalidation(bool bPartInInvalidation)
Set whether clients want a part number in an invalidation payload.
Definition: lok.cxx:101
double getDPIScale()
Get the DPI scale for rendering for HiDPI displays.
Definition: lok.cxx:136
void setLocale(const LanguageTag &rLanguageTag)
Update the current LOK's locale.
Definition: lok.cxx:185