summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorjan Iversen <jani@libreoffice.org>2017-10-29 14:16:19 +0100
committerjan Iversen <jani@libreoffice.org>2017-10-29 19:46:29 +0100
commitc8d1c4350b6828f64121ff4a443700a5b9035e9d (patch)
tree4e222e2b7f513201f114c768f0395f4c677665e4 /ios
parentfeb6cfb1048925ab87485acc4357c3ac23ff944a (diff)
iOS, tested document open from 3rd party app.
This patch allows integration of 3rd party app. if e.g. in mail and clicking on a OO document, LibreOfficeLight will open and present the document Change-Id: I86c77cd3af3aac41fda441b7c5625a2063343971
Diffstat (limited to 'ios')
-rw-r--r--ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift7
-rwxr-xr-xios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift26
2 files changed, 24 insertions, 9 deletions
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
index 31da9986b9f3..766aa4976a29 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
@@ -24,8 +24,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate
// remark if the app is not started it will be started first
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
{
- // called when started from another Application.
- //FIXME
+ let document = window?.rootViewController?.childViewControllers[0] as! DocumentController
+ document.doOpen(url)
return true
}
@@ -102,7 +102,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate
// Saves changes in the application's managed object context before the application terminates.
func applicationWillTerminate(_ application: UIApplication)
{
- // Jan to be done (terminate LO)
+ let document = window?.rootViewController?.childViewControllers[0] as! DocumentController
+ document.Hipernate()
}
}
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
index a6c4a0b26f82..5034d46533c1 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
@@ -67,6 +67,8 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// The PropertiesController is a left sidebar, that will scroll in when activated
// The Controller handles manipulation of properties in the document
+
+
// Activate/Deactivate PropertiesController (from navigationController, see storyboard)
@IBAction func doProperties(_ sender: UIBarButtonItem)
{
@@ -155,10 +157,10 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
switch tag
{
case 1: // Open...
- doOpenDocument()
+ startOpenDocument()
case 2: // Properties
- doProperties()
+ showProperties()
case 3: // Save
doSave()
@@ -173,7 +175,7 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
doSaveAsPDF()
case 6: // Print...
- doPrint()
+ startPrint()
default: // should not happen
print("unknown menu" + String(tag))
@@ -188,7 +190,7 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// Load document into LibreOfficeKit and present it
- internal func doOpenDocument()
+ internal func startOpenDocument()
{
//FIXME
@@ -205,7 +207,7 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// Show document properties (new overloaded page)
- internal func doProperties()
+ internal func showProperties()
{
//FIXME
print("menu Properties to be done")
@@ -250,7 +252,7 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
// print current document
- internal func doPrint()
+ internal func startPrint()
{
//FIXME
print("menu Print... to be done")
@@ -297,6 +299,18 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
internal func documentBrowser(_ controller: UIDocumentBrowserViewController,
didPickDocumentURLs documentURLs: [URL])
{
+ doOpen(documentURLs[0])
+ }
+
+
+
+ // *** Handling of document (open/print)
+
+
+
+ // Real open and presentation of document
+ public func doOpen(_ docURL : URL)
+ {
//FIXME
//BridgeLOkit_open(documentURLs);
}