From cbe828b7f759969c0d70eb818fca62d67379e648 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sun, 29 Oct 2017 11:05:39 +0100 Subject: iOS, move hipernate handling to LOkit interface Hipernate means stopping LOkit but of course saving first if a document is active and returning means starting LOkit again. for now the implementation is left as FIXME Change-Id: Id9ea2b056e87caec13c1d3fe82d4623ca3901ef2 --- ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c | 23 ++++++++++++++- ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h | 2 ++ .../LibreOfficeLight/DocumentController.swift | 33 ++++++++++++++-------- 3 files changed, 46 insertions(+), 12 deletions(-) (limited to 'ios') diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c index 59a1c217b514..a56daa71a09e 100644 --- a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c +++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c @@ -57,5 +57,26 @@ int BridgeLOkit_open(const char *path) int BridgeLOkit_ClientCommand(const char *input) { - return 0; + return 0; +} + + + +int BridgeLOkit_Hipernate() +{ + //FIXME + // check if document needs to be saved, to avoid data loss + // terminate all threads (basically terminate LOkit) + return 0; } + + + +int BridgeLOkit_LeaveHipernate() +{ + //FIXME + // restart LOkit + // reload document (it may have been changed by other programs, especially if iCloud + return 0; +} + diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h index b86156211893..56843ddfe0a2 100644 --- a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h +++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h @@ -14,3 +14,5 @@ int BridgeLOkit_Init(const char *path); int BridgeLOkit_open(const char *path); int BridgeLOkit_ClientCommand(const char *input); +int BridgeLOkit_Hipernate(); +int BridgeLOkit_LeaveHipernate(); diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift index 39a49d2a01eb..c05da106344a 100755 --- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift +++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift @@ -15,6 +15,28 @@ import UIKit // It is a delegate class to recieve Menu events as well as file handling events class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewControllerDelegate { + // Handling of Background (hipernate) + // iOS is not true multitasking, only 1 app can be active (foreground) at any time, + // therefore apps frequently are moved to the background. + // background really means hipernate by terminating all threads and solely keep the + // data + + // Moving to hipernate + public func Hipernate() -> Void + { + BridgeLOkit_Hipernate() + } + + + + // Moving back to foreground + public func LeaveHipernate() -> Void + { + BridgeLOkit_LeaveHipernate() + } + + + // handling of PropertiesController // The PropertiesController is a left sidebar, that will scroll in when activated // The Controller handles manipulation of properties in the document @@ -72,17 +94,6 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC } } - - - // Handling of Background (hipernate) - public func Hipernate() -> Void - { - } - - public func LeaveHipernate() -> Void - { - } - // var currentDocumentName : String? -- cgit