Commit graph

76 commits

Author SHA1 Message Date
Jan Holesovsky
ea659b3d99 Use the app name more generally, not only on iOS.
Preparation for using it on Android too.

Change-Id: Iee7778b2625a02a98daff5df87c39f4ab1d18144
Reviewed-on: https://gerrit.libreoffice.org/70651
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2019-04-12 13:44:40 +02:00
Tor Lillqvist
e2f48faf14 tdf#123742: Fix lifecycle issues for the "Office" object
Because of the use of std::shared_ptr in lokit_main(), the (singleton)
lok::Office (or LibLibreOffice_Impl) object gets destroyed when
lokit_main() exits. We shouldn't keep our own copy of a raw pointer to
it around. Just call lok_init_2() to get the pointer where we need it.
We don't need to call lok_init_2() already in -[AppDelegate
application:didFinishLaunchingWithOptions:].
2019-03-28 17:28:26 +02:00
Tor Lillqvist
3264f39d48 Add all fonts from instdir/share/fonts
Change-Id: I02765079e34cd9cbc96aea9cf2b72f432473ad0a
2019-03-25 19:17:21 +02:00
Tor Lillqvist
cbbb2496ca Truncate the JS expression for logging
Change-Id: Ia287f5e26a80bdf0547128b8b2c9c9aff2ef89cd
2019-03-22 16:37:32 +02:00
Tor Lillqvist
ea43fb337a Add source files from sfx2/source/appl for convenience 2019-03-22 16:22:05 +02:00
Tor Lillqvist
25c8ed7897 For iOS, generate the data: URLs for the PNG tiles already in the Online code
(What we cache is also the textual data: URLs even if we store them
using .png file names.)

This avoids the current back-and-forth-encoding: First we
base64-encode the complete binary "tile:" message (one text line
followed by a newline and the binary PNG) to pass to WebKit, then in
the JavaScript snippet passed to WebKit we decode the base64 and turn
it into an ArrayBuffer, and then we unpack the ArrayBuffer and encode
the PNG part to use as a data: URL.
2019-03-22 16:21:51 +02:00
Tor Lillqvist
eaa4a7838a Add references to source files from svl/source/items for debugging goodness 2019-03-20 15:21:14 +02:00
Tor Lillqvist
8dce313642 tdf#122543: Ignore duplicate calls to loadFromContents on same Document 2019-03-20 15:20:52 +02:00
Tor Lillqvist
949ca42221 The iOS app now works again
(Except that the tunnelled dialogs don't show up, but they don't show
up in a browser connected to a normal Online 'make run' either at the
moment.)

Change-Id: Ic054b415d5d78572338e20da711a4285584ba330
2019-03-15 09:48:51 +02:00
Tor Lillqvist
f60618f0ba Add important note
Change-Id: I9f4a6c8f01c72ec40a38f44a7ac23d22a46d2d83
2019-03-08 13:24:54 +02:00
Tor Lillqvist
8d52cf2c9f Fix iOS build in Xcode: Add header search path for boost
(But note that the iOS app is now completely broken at run-time,
nothing sane shows up.)

Change-Id: I685580bbc0113a075d2cebc54c7af8a3bbca6bd6
2019-03-06 11:03:01 +02:00
Tor Lillqvist
3b2612c20d Add sal/rtl/bootstrap.cxx for breakpointing convenience
Change-Id: I915b714aec4212cff563832772111b804af2bbd3
2019-03-01 16:26:42 +02:00
Tor Lillqvist
5c5a9f5221 Add zcodec.cxx from tools
Change-Id: I6666f08b0bddab02277595190a7127d6f0c3f6f0
2019-02-28 11:22:03 +02:00
Tor Lillqvist
18ca7ee008 Remove superfluous empty line at end of file
Change-Id: Ibdb25392622a12cedc1923c2d88ffe6b6e4f798c
2019-02-26 17:52:58 +02:00
Tor Lillqvist
62ffd2c835 tdf#122584: Implement printing in the iOS app
I don't have an AirPrint printer so I couldn't verify that it actually
prints, but the system print dialog is displayed and shows a preview
correctly, so I am fairly sure it works.

Change-Id: I5e8a704386cd5053b8689dc63f26e545df323193
2019-02-26 17:45:39 +02:00
Tor Lillqvist
76058ac270 Fix crash in iOS app: Just use a raw pointer as the lok_document hack
The lok_document pointer will only be used when it is valid anyway.
Fixes a crash when you open a second document after closing the first.

Change-Id: I362db282e4eccf419b56bf790ea58181594ab0fe
2019-02-26 14:07:59 +02:00
Tor Lillqvist
73ad6c300a Bin some boilerplate comments
Change-Id: Ida0a8279f081d5b9c5d963d7d721e4c7c01f3a9e
2019-02-25 09:14:14 +02:00
Tor Lillqvist
ce53efd880 Keep the iOS app bundle version in a file in the build folder, not in git
When you want to build a new version for distribution, bump the
build number in the BUNDLE-VERSION file.

Change-Id: I1e7e55528aef6d3526ce14d070ae96abc5931f38
2019-02-25 09:14:14 +02:00
Tor Lillqvist
4dc340972c tdf#122582: Add slideshow functionality
Requires a couple of corresponding commits in core to its filter
subdirectory.

Change-Id: I3e6353752dd93e021fb6058fff5096f1d648d17e
2019-02-22 21:01:54 +02:00
Tor Lillqvist
6567f50abf Bin leftover declaration of now non-existent function
Change-Id: I62af01bd68657fbce60e4df9df5d3b4a4701d5e0
2019-02-22 21:01:54 +02:00
Jan Holesovsky
4f5e262344 Revert "android: Various fixes to make the sending from the core to JS..."
Lets leave this optimization for later, this is incomplete, and does not
fix the problem which it was originally supposed to address.

This reverts commit bce922e8fd.

Change-Id: I5d2ee19058261c7612d36014181f509604c8acde
2019-02-20 00:38:16 +01:00
Jan Holesovsky
bce922e8fd android: Various fixes to make the sending from the core to JS working.
Change-Id: Idc22ccbae1effac9e2db5293703a768e033fd7e9
2019-02-19 10:56:58 +01:00
Michael Meeks
b46f027101 iOS: add some alternative brew / pip instructions for local building.
Change-Id: Icefeb848537cefc618170d730d3c0b32e3898de6
2019-02-18 16:44:51 +01:00
Tor Lillqvist
3a43b1a02b Bump CFBundleVersion
Yeah, a bit silly to have to do git commit for these bumps. I should
change things so that CFBundleVersion is taken from some local file in
the build tree, not from a file in git.

Change-Id: I99d68490aa7f084e8cfb34896c3398486bc6f8a2
2019-02-18 12:27:11 +02:00
Tor Lillqvist
8f71365f0f Remove unnecessary leftovers after Michael's removal of the on-disk tile cache
Change-Id: I435679b48f90d2580bb9c5c86a26c9a1d43c5b59
Reviewed-on: https://gerrit.libreoffice.org/67885
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-02-15 21:36:16 +01:00
Tor Lillqvist
d81fe29ad0 We don't need discovery.xml in the iOS app any longer either
Change-Id: Id592b58f091607cf2e8c5e951a95aa3a563e8def
2019-02-13 20:00:04 +02:00
Tor Lillqvist
938553b5f9 Put MOBILEAPP in the pre-canned config.h for iOS, too
Change-Id: Ic6a5f6cdf7b3102c8e926040311093a5a727ac3b
2019-02-12 14:39:16 +02:00
Tor Lillqvist
f5a93b98cc Bump CFBundleVersion
Change-Id: Iec25e7bbcec101209822c413eb8728b93ce9bfd4
2019-02-04 14:56:27 +02:00
Tor Lillqvist
a8de971a59 Fix a couple of typos
Change-Id: Icfaca47c14ad1c76ed45d2ccb362f5f7405c4ca4
2019-01-25 12:02:52 +02:00
Michael Meeks
3be0fd9621 Xcode advice.
Change-Id: Ic323bb2c640cc811250fb2d28e88d50b3d663a0d
2019-01-24 14:21:52 +00:00
Tor Lillqvist
f2a2fd15ff Bump CFBundleVersion
Change-Id: Ia5f21b74c16ed40ae8c1b5fd3f4413f0c9152c92
2019-01-08 00:53:38 +02:00
Tor Lillqvist
60a6547085 Add some more core source files for easier breakpointing
Change-Id: I1b958c0fa9ec23aef963c0fc72e9991efe5e51b5
2019-01-07 12:26:19 +02:00
Tor Lillqvist
ee2a08095f Add some source files from vcl/source/filter
Change-Id: Id6065ebc4ec40eeeb9f75db619df139d147b3f6f
2019-01-07 12:26:19 +02:00
Tor Lillqvist
3ec92f137e Be less fragile in case of missing resources when downloading templates
It is not enough ot look at the NSError* parameter. Need to check the
HTTP status code, too.

Change-Id: I8db146c77626d4080ef6606999d27e6bb845876c
2018-12-19 13:38:43 +02:00
Tor Lillqvist
9deb186102 Bump CFBundleVersion
Change-Id: I98233b5423e66ebca43426d5cc51af957e31d7b5
2018-12-19 00:13:07 +02:00
Tor Lillqvist
b0b2c01a6c Don't crash if there is no WKJavaScriptExceptionMessage
Change-Id: I90b99ba13e06c511334bc085d43d85126808f42f
2018-12-18 20:39:18 +02:00
Tor Lillqvist
c909bcd83c Need offapi headers, too, when building against a 6.0 branch or core
Change-Id: I4bce152cd286f66aaed1f8354a21c76a27e771b0
2018-12-18 20:03:52 +02:00
Tor Lillqvist
61bd04fefb Add a way to have templates specific to a customer deployment
Add two settings: One setting "Template list URL" is a string that
should either be empty (the typical case for a random user of the
app), or contain a https: URL. If this setting is empty, only the
templates bundled in the app are provided.

If the "Template list URL" is non-empty, it should be a https: URL
pointing to a text file (or dynamically generated text resource). That
file is downloaded and read when the app starts. Each line in the file
should either be a comment (starting with a hash '#'), or a https: URL
pointing to a template document, that is of type .ott, .ots, or .otp.
That document is downloaded if it hasn't been downloaded already, or
if its time stamp is newer than that of the already downloaded copy.
Also a thumbnail image for the template, formed by appending ".png" to
its URL, is downloaded, if available.

Any previously downloaded templates that aren't mentioned in the list
file are removed.

The intent is that in some managed mass deployment environment, the
mobile device management software would set up this setting, so that
the end-user devices would see the same templates.

Obviously, this URL does not have to point to a static file on a web
server, but could point to some dynamically generated resource on a
web server, that enumerates the templates available on the server and
returns their URLs as a text document.

Another setting is "Empty tile cache next time". This is a toggle. If
toggled on, the next time a document is opened in the app, the tile
cache is emptied (and the toggle is reset off). This is mostly for
potential problem solving, and might be removd later.

Various refactoring to support the new functionality.

Change-Id: Ie2ebf032acb9e43bb1c6f7ae4d0c449ae66eaa05
2018-12-17 22:56:14 +02:00
Tor Lillqvist
600c3a8969 Add a dummy VEREIGN_URL here, too
Change-Id: I01f22ec18a2e56286520bb1f14fcd02bd43352cb
2018-12-13 16:17:12 +02:00
Tor Lillqvist
f3f1b1e228 Adapt to LibreOfficeKitClass no longer having the translateGet() method
This is a somewhat temporary quick solution. It bluntly uses the same
code here that I had added for a while as the implementation of
translateGet() for LibreOfficeKitClass in LO core.

Ideally we should have a script here in online to pick the needed
translation from the translations submodule of core and keep them
around even if a translation happens to evaporate from
core/translations. The same idea as in the scripts/unocommands.py, but
I did not yet start modifying or copying that.

Change-Id: I455ad6044e321ef59873d60f8e5f3e7032f2447e
2018-12-13 16:14:42 +02:00
Tor Lillqvist
4d038dc3e4 Bin commented-out #import
Change-Id: I2dc64b95b99d62816be78b3fdf302280714a26f4
2018-12-13 16:14:02 +02:00
Tor Lillqvist
8f1ed48145 Use the new LibreOfficeKit API to localise the template category headers
Change-Id: Icc91138cbe5de290103a746c8797e647259d5009
2018-12-10 22:41:55 +02:00
Tor Lillqvist
c65f3e43a1 Fetch the locale already in the AppDelegate's didFinishLaunchingWithOptions
It will be needed by code that runs before the Document object is
created.

Change-Id: I5c4646e08c670b88b6d3a4d38450cc80e11ec402
2018-12-10 22:41:55 +02:00
Tor Lillqvist
2768d8b9fd Bump CFBundleVersion
Change-Id: I0278c745924787fdf5f258bb7d334fa6eef14fc0
2018-12-07 15:28:11 +02:00
Tor Lillqvist
deb92ad3ba Finally figured out how to get 200x200 cells in the template collection
Change-Id: Idd977ccf52b2dd0e0aaae08f54f6d902791bcc6d
2018-12-07 11:20:15 +02:00
Tor Lillqvist
da45975a5a Make the template collection view look much better
Now it finally looks like I want, but oh boy was that a pain. I am not
sure at all I understand what I am doing in Xcode's Interface Builder.

I tried hard at first to use the cell size 200x220 for the cell size
of the UICollectionView, consisting of a 200x200 UIImageView and a
200x20 UILabel below. But that did not seem to work, it still used a
(default?) size of 150x150. Weird. Anyway, let's commit this state now
that seems to work.

Change-Id: I4021133619fbf62cd633392d93f19c2bbc81311a
2018-12-07 00:09:13 +02:00
Tor Lillqvist
8b106eb312 Look for thumbnails of the templates and show them in the template browser
Add such thumbnails. Rename the presentation templates to not have
colons in their name, as that seems to be problematic for macOS and/or
iOS, sigh. (Shadows of pre-OS X MacOS, where the coln was the path
component separator, not the slash.)

Hack on the storyboard scene for the template browser. More work is
needed there; the thumbnails aren't scaled down for some reason. I
need to make sure the aspect ratio is maintained, too. Maybe to get it
to look like I want I need to do some coding and not just tweak the
storyboard in the Xcode UI designer, sigh.

Change-Id: I959d051352c2f033c8563188155af5281961c7d8
2018-12-06 16:38:50 +02:00
Tor Lillqvist
4c8d0f2e25 Revert "Work in progress: Add .ott"
Using a template has been implemented to work in a way more
appropriate for the platform.

There is little reason to allow direct opening of a template in the
iOS app as long as it don't have any way to save it as an actual
document, based on the template, after editing, (with a different file
name) anyway.

This reverts commit f01a73fa92.

Change-Id: Iff4b2f299c6e6eda27c00e40a49374899af41cf0
2018-12-05 23:41:49 +02:00
Tor Lillqvist
1f0b0b6a0d Bin leftover dummy NSLog() call
Change-Id: I0597be90ff211dfb7f5fd2f321bfb36c9ec01308
2018-12-05 22:13:26 +02:00
Tor Lillqvist
296e0eb803 More work on template selection for a new document
It took quite some time for me to understand how to do it. Not sure if
this is The Right Way, but at least it now works better.

The trick was to store the importHandler block as a property of the
TemplateCollectionViewController and call it when the right template
has been selected.

There is no need to call the importHandler already in the
documentBrowser:didRequestDocumentCreationWithHandler: instance method
and it would not be possible anyway as there apparently is no way to
have the presentViewController:animated:completion: method work in a
truly modal way, so that it would not return until the selection has
been done.

Change-Id: Ia229500c181844fcd99f1f099b2e6744c22b5266
2018-12-05 22:02:59 +02:00