Skip to content

About

Euro-Office Documents for iOS: the app shell for the native iOS editors

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

31 Commits

Folders and files

documents-app-ios

The Euro-Office iOS app (in progress): the app shell around the native editors of editors-ios, the counterpart of documents-app-android. Both are submodules of MobileEditors.

From iOS 18 the app starts in the editor's launch view (UIDocumentViewController.LaunchOptions: New Document, Choose a Template, and the document browser below), on iOS 17 in the document browser. The browser (Recents and Browse of the Files app) opens docx, xlsx, pptx, pdf, odt, ods, odp, doc, xls, ppt, rtf, txt and csv in place (Document, a UIDocument). Documents, spreadsheets and presentations can be edited in the formats the engine writes; changes are saved by autosave and when the editor closes. PDFs are marked up, drawn on and their forms filled. The old formats are read-only.

New documents come from the browser's "+" (into the folder shown), from the launch view, Cmd-N (File > New on iPad) and the Home Screen quick actions (into the app's folder, On My iPhone): a blank document, spreadsheet or presentation in the user's language, or a template from the gallery. New documents open in edit mode.

Building

The project takes editors-ios' Engine package by relative path, ../editors-ios/Engine, as in MobileEditors' checkout. Its frameworks must be built first (Engine/build.sh in editors-ios, with the iOS slices).

A build phase copies the engine's runtime into the app's Runtime/ folder:

  • EO_RUNTIME_DIR: DoctRenderer.config, sdkjs and empty
  • EO_FONTS_DIR: the fonts (core-fonts; the app makes their index on the first launch)

A second one copies the documents new ones start from:

  • EO_DOCUMENT_TEMPLATES_DIR: the blank documents, document-templates/new (<language>/new.docx, .xlsx, .pptx)
  • EO_TEMPLATES_DIR: the templates with their thumbnails (<name>.docx.jpg), made by tools/templates.sh from Nextcloud's example templates in document-corpus' samples/ with editors-engine's eo-render (about 5 minutes; not committed). The templates' licences are in Documents/TemplateCredits.txt, for the About screen
xcodebuild -project Documents.xcodeproj -scheme Documents -destination 'platform=iOS Simulator,name=iPhone 15 Pro' \
    EO_RUNTIME_DIR=<runtime> EO_FONTS_DIR=<fonts> build

Debug builds open a file directly with the launch argument -EOOpenFile <path> (the simulator reads the Mac's files):

xcrun simctl launch booted eu.eurooffice.documents -EOOpenFile "$PWD/../document-templates/sample/sample.docx"

-EOCreate <docx|xlsx|pptx|template file name> (e.g. letter.docx) creates a document in the app's folder and opens it; -EOShowNew YES shows the choice of what to create and -EOShowTemplates YES the template gallery.

-EOTypeText <text> then types at the start of the document as the keyboard does, and -EOSelectTyped YES selects it and shows the edit menu. The document is saved in place: use a copy.

UI tests

DocumentsUITests touches the app as a user does: zoom in the viewer, typing and saving, the keyboard's capitalization, dragging a selection handle and correcting two words, a selected shape taking no text, the edit menu and undo, bold through the format inspector, the Picture tab for a picture, inserting a table, presentations (adding a slide and typing its title, the slide navigator's menu and the Slide tab, a shape on a slide, a table on a slide with the Table tab and its styles, the themes and the notes pane, the slideshow with the presenter view and back to portrait), new documents and templates (a new spreadsheet's bar keeps back, undo and Done), spreadsheets (typing a number and a formula, selecting cells and columns, adding, renaming and duplicating a sheet, filling a cell, frozen rows, resizing a column, typing into a shape, warnings), the title menu (export, duplicate, print) and back to the launch view or browser. It finds the editor's controls by their identifiers (editor.canvas with the zoom as value, editor.edit, editor.done, editor.undo, editor.redo, editor.insert, editor.format, editor.readOnly, editor.back, editor.titleMenu, slides.*). The tests open copies of document-templates' samples, ../document-templates/sample as in MobileEditors' checkout, or EO_SAMPLES_DIR. PdfUITests writes a small form PDF itself and checks the saved file with PDFKit: a highlight and filled fields with a combo box, ink drawn and erased, a shape, an inserted and rotated page.

TEST_RUNNER_EO_SAMPLES_DIR=<document-templates>/sample xcodebuild test -project Documents.xcodeproj -scheme Documents \
    -destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5' -resultBundlePath ui-tests.xcresult

-only-testing:DocumentsUITests/DocumentsUITests/testTypingIsSaved runs one test. The tests attach screenshots of their steps: xcrun xcresulttool export attachments --path ui-tests.xcresult --output-path <folder>.

About

Euro-Office Documents for iOS: the app shell for the native iOS editors

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages