summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-03-16 13:50:00 +0200
committerTor Lillqvist <tml@collabora.com>2020-05-17 23:09:40 +0200
commit659b5abc5987c5e4e63b014521e0cad5086356a8 (patch)
treee750356f2007f6d1bee96917a8ba3a3951debfbc /include
parent05128f486e36b024fc405a3d5ad967df99c58964 (diff)
Rename isMobile to isMobilePhone and introduce a separate isTablet
The intended semantics of isMobile() has been to say whether the device is a mobile phone ot not. Not whether it is a mobile device in general. So make that explicit. Adjust call sites as necessary. Also, in a couple of places where it is likely that what is relevant is whether it is a mobile device in general, not just whether it is a mobile phone, check both isMobile() and isTablet(). For stable interoperability with current Online, keep accepting also the .uno:LOKSetMobile "command" (and .uno:LOKUnSetMobile, except that Online never sends that), but Online will be changed to use .uno:LOKSetMobilePhone. Also drop the default value for the bool parameter to setMobilePhone(). Default bool parameters can be quite confusing, and it was especially silly in this case as there is one (1) call site. Change-Id: I2a71c37323ee151cbc671bd8e714e1dee10f8b1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90560 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94390 Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/comphelper/lok.hxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index b4658913f0d1..4c43f55e7721 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -29,8 +29,11 @@ namespace LibreOfficeKit
COMPHELPER_DLLPUBLIC void setActive(bool bActive = true);
-// Set LOK view to mobile
-COMPHELPER_DLLPUBLIC void setMobile(int nViewId, bool bIsMobile = true);
+// Tell that LOK view is on a mobile phone (regardless what its pixel resolution is, whether its form factor is "phablet" or not)
+COMPHELPER_DLLPUBLIC void setMobilePhone(int nViewId, bool bIsMobilePhone);
+
+// Tell that LOK view is on a tablet
+COMPHELPER_DLLPUBLIC void setTablet(int nViewId, bool bIsTablet);
enum class statusIndicatorCallbackType { Start, SetValue, Finish };
@@ -42,8 +45,11 @@ COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void *data
// Check whether the code is running as invoked through LibreOfficeKit.
COMPHELPER_DLLPUBLIC bool isActive();
-// Check whether we are serving to a mobile view/device
-COMPHELPER_DLLPUBLIC bool isMobile(int nViewId);
+// Check whether we are serving to a mobile phone
+COMPHELPER_DLLPUBLIC bool isMobilePhone(int nViewId);
+
+// Check whether we are serving to a tablet
+COMPHELPER_DLLPUBLIC bool isTablet(int nViewId);
/// Shift the coordinates before rendering each bitmap.
/// Used by Calc to render each tile separately.