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 
21 namespace comphelper
22 {
23 
24 namespace LibreOfficeKit
25 {
26 
27 // Functions to be called only from the LibreOfficeKit implementation in desktop, not from other
28 // places in LibreOffice code.
29 
30 COMPHELPER_DLLPUBLIC void setActive(bool bActive = true);
31 
32 // Call either setMobilePhone() or setTablet() for a view, and at most once. (If neither is called,
33 // the view is assumed to be on a desktop browser.) In the future, this will possibly be changed
34 // into using an enum for the kind of the view, that can be DESKTOP, MOBILEPHONE, or TABLET.
35 
36 // Tell that LOK view is on a mobile phone (regardless what its pixel resolution is, whether its form factor is "phablet" or not)
37 COMPHELPER_DLLPUBLIC void setMobilePhone(int nViewId);
38 
39 // Tell that LOK view is on a tablet
40 COMPHELPER_DLLPUBLIC void setTablet(int nViewId);
41 
43 
44 COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data);
45 
46 
47 // Functions that can be called from arbitrary places in LibreOffice.
48 
49 // Check whether the code is running as invoked through LibreOfficeKit.
51 
56 COMPHELPER_DLLPUBLIC void setLocalRendering(bool bLocalRendering = true);
58 
62 COMPHELPER_DLLPUBLIC void setPartInInvalidation(bool bPartInInvalidation);
63 
67 COMPHELPER_DLLPUBLIC void setTiledPainting(bool bTiledPainting);
71 COMPHELPER_DLLPUBLIC void setDialogPainting(bool bDialogPainting);
73 COMPHELPER_DLLPUBLIC void setDPIScale(double fDPIScale);
77 COMPHELPER_DLLPUBLIC void setTiledAnnotations(bool bTiledAnnotations);
81 COMPHELPER_DLLPUBLIC void setRangeHeaders(bool bTiledAnnotations);
84 
85 enum Compat : sal_uInt32
86 {
87  none = 0,
89 };
94 
95 
99 COMPHELPER_DLLPUBLIC void setViewIdForVisCursorInvalidation(bool bViewIdForVisCursorInvalidation);
100 
102 COMPHELPER_DLLPUBLIC void setLocale(const LanguageTag& languageTag);
105 
107 COMPHELPER_DLLPUBLIC void setLanguageTag(const LanguageTag& languageTag);
111 COMPHELPER_DLLPUBLIC bool isWhitelistedLanguage(const OUString& lang);
112 
113 // Status indicator handling. Even if in theory there could be several status indicators active at
114 // the same time, in practice there is only one at a time, so we don't handle any identification of
115 // status indicator in this API.
119 
120 }
121 }
122 
123 #endif // INCLUDED_COMPHELPER_LOK_HXX
124 
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool isWhitelistedLanguage(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:282
void setTiledPainting(bool bTiledPainting)
Set if we are doing tiled painting.
Definition: lok.cxx:111
COMPHELPER_DLLPUBLIC void setTablet(int nViewId)
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
void setStatusIndicatorCallback(void(*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data)
Definition: lok.cxx:264
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:276
void setCompatFlag(Compat flag)
Set compatibility flags.
Definition: lok.cxx:181
COMPHELPER_DLLPUBLIC void setMobilePhone(int nViewId)
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 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