Package com.codename1.wordprocessing
package com.codename1.wordprocessing
Word-processing documents.
A Document is an immutable list of Blocks -- Paragraphs of styled RichText,
Tables whose cells hold blocks of their own, and Pictures -- laid out on a PageSpec.
A DocumentModel holds the current document of an editor, tells its DocumentListeners
when it is replaced and keeps the undo history, the way a com.codename1.ui.table.TableModel
backs a table.
Documents are read and written as Codename One .cn1doc files, plain text, HTML and
Markdown; see Document.Format.
-
ClassDescriptionOne top-level unit of a
Document's body: aParagraph, aTableor aPicture.The.cn1docXML of a list of blocks, for formats that hold document text inside their own files.A review comment anchored to a range of the document: from an offset in one paragraph to an offset in the same or a later one.An immutable word-processing document: a list ofBlocks (paragraphs, tables and pictures), the page they are laid out on and a title.The file formatsreadandwriteunderstand.ADocumentViewwith its embedded components alive: each component box on screen holds a real Codename One component, made by the factoryEmbeddedComponentshas for its type, that the user can tap, drag and type into.A document broken into pages: every line, table, picture and footnote placed, in points.Notified when aDocumentModel's document is replaced, by an edit, an undo or a redo.The editable state behind a document view: the current immutableDocument, its listeners and its undo history.Shows a document as pages and edits it, the wayDataGridshows and edits aSheet.A live Codename One component placed in a document's text, such as a chart, a map, a button or a form.The registry that turns anEmbeddedComponent-- a type name and a state string in a document -- into a live Codename One component, and back.Creates the components of one type and reads their state back.A field: an instruction such asPAGE,DATE \@ "d MMMM yyyy"or=SUM(ABOVE)with the result it last produced.Content that sits inside a paragraph's text and takes one character there,RichText.OBJECT: aField, aNotereference, aPictureplaced in the line, or anEmbeddedComponent.One thing drawn on a laid out page: a piece of text, a filled or stroked rectangle, a line, a picture or the box of an embedded component.One page of aDocumentLayout: its size and everything drawn on it, in painting order.Paints laid out items on aGraphics, the wayDocumentViewpaints its pages.Measures text forDocumentLayout, in points.A footnote or endnote, placed in the text where its reference mark goes.Immutable page geometry in points: paper size and the four margins.An immutable paragraph: styled text plus the paragraph's own layout.Writes a laid out document as PDF, page for page asDocumentViewshows it.Measures with the fonts a PDF is drawn in, so a document paginates identically on screen and on paper.An immutable picture block: the original encoded image bytes, kept as they were read so a document written back carries the same image, plus its displayed size in points.A tracked change on a run of text: who inserted or deleted it and when.Immutable styled text: a sequence of runs, each a string with oneTextStyle, and inline objects -- fields, note references, pictures and embedded components -- each of which takes exactly one character,OBJECT.Accumulates runs into aRichText.Computes a new style from an old one, forrestyle.Receives the runs of a text in order.Moves content between aRichTextAreaand aDocument, so the light editor and the paged one can work on the same text.Measures text with the platform fontsDocumentViewdraws it in.Starts a new section: the blocks after it, up to the next break, are laid out on the page this break gives, with its margins, orientation and columns.An immutable table: a rectangular grid of cells, each holding its own blocks (paragraphs, pictures and nested tables), with optional merged ranges.A rectangular range of cells shown as one, anchored at its top-left cell.Keeps a table of a document and a liveSheetin step, so the table can be edited in aDataGridwith Excel formulas, sorting and a formula bar, and the document follows.Moves tables between documents and spreadsheets, so a table's numbers and formulas are calculated by the same engine as aWorkbook's.A tab stop: where the text after a tab character lines up.A place between two characters of a paragraph: the caret position a point on a page maps to.Immutable character formatting for a run of text.