You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by ja...@apache.org on 2015/08/17 10:49:55 UTC

[03/28] incubator-corinthia git commit: included MOC compiler for Qt implementation

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer0_Javascript/elementtypes/elements.txt
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer0_Javascript/elementtypes/elements.txt b/experiments/editorFramework/src/Layer0_Javascript/elementtypes/elements.txt
deleted file mode 100644
index bd23f64..0000000
--- a/experiments/editorFramework/src/Layer0_Javascript/elementtypes/elements.txt
+++ /dev/null
@@ -1,113 +0,0 @@
-#document
-#text
-#comment
-a
-abbr
-address
-area
-article
-aside
-audio
-b
-base
-bdi
-bdo
-blockquote
-body
-br
-button
-canvas
-caption
-cite
-code
-col
-colgroup
-command
-data
-datalist
-dd
-del
-details
-dfn
-dialog
-div
-dl
-dt
-em
-embed
-fieldset
-figcaption
-figure
-footer
-form
-h1
-h2
-h3
-h4
-h5
-h6
-head
-header
-hgroup
-hr
-html
-i
-iframe
-img
-input
-ins
-kbd
-keygen
-label
-legend
-li
-link
-map
-mark
-menu
-meta
-meter
-nav
-noscript
-object
-ol
-optgroup
-option
-output
-p
-param
-pre
-progress
-q
-rp
-rt
-ruby
-s
-samp
-script
-section
-select
-small
-source
-span
-strong
-style
-sub
-summary
-sup
-table
-tbody
-td
-textarea
-tfoot
-th
-thead
-time
-title
-tr
-track
-u
-ul
-var
-video
-wbr

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer0_Javascript/elementtypes/genelementtypes.pl
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer0_Javascript/elementtypes/genelementtypes.pl b/experiments/editorFramework/src/Layer0_Javascript/elementtypes/genelementtypes.pl
deleted file mode 100644
index 46416e1..0000000
--- a/experiments/editorFramework/src/Layer0_Javascript/elementtypes/genelementtypes.pl
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/perl
-
-$filename = $ARGV[0];
-
-#print "filename $filename\n";
-
-@names = ();
-
-open($fh,"<",$filename) or die "Can't open $filename";
-while ($name = <$fh>) {
-  $name =~ s/\n$//;
-  push(@names,$name);
-}
-close($fh);
-
-print("// Automatically generated from $filename\n");
-print("ElementTypes = {\n");
-$nextId = 1;
-for $name (@names) {
-  $upper = uc($name);
-  $lower = lc($name);
-  print("  \"$upper\": $nextId,\n");
-  print("  \"$lower\": $nextId,\n");
-  $nextId++;
-}
-print("};\n");
-print("\n");
-$nextId = 1;
-for $name (@names) {
-  $temp = $name;
-  $temp =~ s/#//;
-  $upper = uc($temp);
-  print("HTML_$upper = $nextId;\n");
-  $nextId++;
-}
-print("HTML_COUNT = $nextId;\n");

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer0_Javascript/empty.html
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer0_Javascript/empty.html b/experiments/editorFramework/src/Layer0_Javascript/empty.html
deleted file mode 100644
index 42682b4..0000000
--- a/experiments/editorFramework/src/Layer0_Javascript/empty.html
+++ /dev/null
@@ -1 +0,0 @@
-<html><body></body></html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer0_Javascript/first.js
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer0_Javascript/first.js b/experiments/editorFramework/src/Layer0_Javascript/first.js
deleted file mode 100644
index 48cfd85..0000000
--- a/experiments/editorFramework/src/Layer0_Javascript/first.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// FIXME: The _PREFIX variables below must be replaced with functions that return the
-// appropriate namespace prefix for the document in question (since we can't rely on the
-// values that LibreOffice/MS Word happen to use by default)
-
-var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
-
-// ODF
-
-var OFFICE_NAMESPACE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
-var STYLE_NAMESPACE = "urn:oasis:names:tc:opendocument:xmlns:style:1.0";
-var TEXT_NAMESPACE = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
-var TABLE_NAMESPACE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
-var FO_NAMESPACE = "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0";
-var SVG_NAMESPACE = "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0";
-var XLINK_NAMESPACE = "http://www.w3.org/1999/xlink";
-
-var OFFICE_PREFIX = "office:";
-var STYLE_PREFIX = "style:";
-var TEXT_PREFIX = "text:";
-var TABLE_PREFIX = "table:";
-var FO_PREFIX = "fo:";
-var SVG_PREFIX = "svg:";
-var XLINK_PREFIX = "xlink:";
-
-// OOXML
-
-var WORD_NAMESPACE = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
-var WORD_PREFIX = "w:";

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer0_Javascript/traversal.js
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer0_Javascript/traversal.js b/experiments/editorFramework/src/Layer0_Javascript/traversal.js
deleted file mode 100644
index 439870f..0000000
--- a/experiments/editorFramework/src/Layer0_Javascript/traversal.js
+++ /dev/null
@@ -1,184 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-function prevNode(node)
-{
-    if (node.previousSibling != null) {
-        node = node.previousSibling;
-        while (node.lastChild != null)
-            node = node.lastChild;
-        return node;
-    }
-    else {
-        return node.parentNode;
-    }
-}
-
-function nextNodeAfter(node,entering,exiting)
-{
-    while (node != null) {
-        if (node.nextSibling != null) {
-            if (exiting != null)
-                exiting(node);
-            node = node.nextSibling;
-            if (entering != null)
-                entering(node);
-            break;
-        }
-
-        if (exiting != null)
-            exiting(node);
-        node = node.parentNode;
-    }
-    return node;
-}
-
-function nextNode(node,entering,exiting)
-{
-    if (node.firstChild) {
-        node = node.firstChild;
-        if (entering != null)
-            entering(node);
-        return node;
-    }
-    else {
-        return nextNodeAfter(node,entering,exiting);
-    }
-}
-
-function prevTextNode(node)
-{
-    do {
-        node = prevNode(node);
-    } while ((node != null) && (node.nodeType != Node.TEXT_NODE));
-    return node;
-}
-
-function nextTextNode(node)
-{
-    do {
-        node = nextNode(node);
-    } while ((node != null) && (node.nodeType != Node.TEXT_NODE));
-    return node;
-}
-
-function firstChildElement(node)
-{
-    var first = node.firstChild;
-    while ((first != null) && (first.nodeType != Node.ELEMENT_NODE))
-        first = first.nextSibling;
-    return first;
-}
-
-function lastChildElement(node)
-{
-    var last = node.lastChild;
-    while ((last != null) && (last.nodeType != Node.ELEMENT_NODE))
-        last = last.previousSibling;
-    return last;
-}
-
-function firstDescendant(node)
-{
-    while (node.firstChild != null)
-        node = node.firstChild;
-    return node;
-}
-
-function lastDescendant(node)
-{
-    while (node.lastChild != null)
-        node = node.lastChild;
-    return node;
-}
-
-function firstDescendantOfType(node,type)
-{
-    if (node._type == type)
-        return node;
-
-    for (var child = node.firstChild; child != null; child = child.nextSibling) {
-        var result = firstDescendantOfType(child,type);
-        if (result != null)
-            return result;
-    }
-    return null;
-}
-
-function firstChildOfType(node,type)
-{
-    for (var child = node.firstChild; child != null; child = child.nextSibling) {
-        if (child._type == type)
-            return child;
-    }
-    return null;
-}
-
-function getNodeDepth(node)
-{
-    var depth = 0;
-    for (; node != null; node = node.parentNode)
-        depth++;
-    return depth;
-}
-
-function getNodeText(node)
-{
-    var strings = new Array();
-    recurse(node);
-    return strings.join("").replace(/\s+/g," ");
-
-    function recurse(node)
-    {
-        if (node.nodeType == Node.TEXT_NODE)
-            strings.push(node.nodeValue);
-
-        for (var child = node.firstChild; child != null; child = child.nextSibling)
-            recurse(child);
-    }
-}
-
-function isWhitespaceTextNode(node)
-{
-    if (node.nodeType != Node.TEXT_NODE)
-        return false;
-    return isWhitespaceString(node.nodeValue);
-}
-
-function isNonWhitespaceTextNode(node)
-{
-    if (node.nodeType != Node.TEXT_NODE)
-        return false;
-    return !isWhitespaceString(node.nodeValue);
-}
-
-function printTree(node,indent,offset)
-{
-    if (indent == null)
-        indent = "";
-    if (offset == null)
-        offset = "";
-    if ((node.nodeType == Node.ELEMENT_NODE) && node.hasAttribute("class"))
-        debug(indent+offset+nodeString(node)+"."+node.getAttribute("class"));
-    else
-        debug(indent+offset+nodeString(node));
-    var childOffset = 0;
-    for (var child = node.firstChild; child != null; child = child.nextSibling) {
-        printTree(child,indent+"    ",childOffset+" ");
-        childOffset++;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer0_Javascript/types.js
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer0_Javascript/types.js b/experiments/editorFramework/src/Layer0_Javascript/types.js
deleted file mode 100644
index b49a709..0000000
--- a/experiments/editorFramework/src/Layer0_Javascript/types.js
+++ /dev/null
@@ -1,280 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-var CONTAINER_ELEMENTS = new Array(HTML_COUNT);
-CONTAINER_ELEMENTS[HTML_DOCUMENT] = true;
-CONTAINER_ELEMENTS[HTML_HTML] = true;
-CONTAINER_ELEMENTS[HTML_BODY] = true;
-CONTAINER_ELEMENTS[HTML_UL] = true;
-CONTAINER_ELEMENTS[HTML_OL] = true,
-CONTAINER_ELEMENTS[HTML_LI] = true;
-CONTAINER_ELEMENTS[HTML_TABLE] = true;
-CONTAINER_ELEMENTS[HTML_CAPTION] = true;
-CONTAINER_ELEMENTS[HTML_THEAD] = true;
-CONTAINER_ELEMENTS[HTML_TFOOT] = true;
-CONTAINER_ELEMENTS[HTML_TBODY] = true;
-CONTAINER_ELEMENTS[HTML_TR] = true;
-CONTAINER_ELEMENTS[HTML_TH] = true;
-CONTAINER_ELEMENTS[HTML_TD] = true;
-CONTAINER_ELEMENTS[HTML_COL] = true;
-CONTAINER_ELEMENTS[HTML_FIGURE] = true;
-CONTAINER_ELEMENTS[HTML_FIGCAPTION] = true;
-CONTAINER_ELEMENTS[HTML_NAV] = true;
-
-var PARAGRAPH_ELEMENTS = new Array(HTML_COUNT);
-PARAGRAPH_ELEMENTS[HTML_P] = true;
-PARAGRAPH_ELEMENTS[HTML_H1] = true;
-PARAGRAPH_ELEMENTS[HTML_H2] = true;
-PARAGRAPH_ELEMENTS[HTML_H3] = true;
-PARAGRAPH_ELEMENTS[HTML_H4] = true;
-PARAGRAPH_ELEMENTS[HTML_H5] = true;
-PARAGRAPH_ELEMENTS[HTML_H6] = true;
-PARAGRAPH_ELEMENTS[HTML_DIV] = true;
-PARAGRAPH_ELEMENTS[HTML_PRE] = true;
-PARAGRAPH_ELEMENTS[HTML_BLOCKQUOTE] = true;
-
-var BLOCK_ELEMENTS = new Array(HTML_COUNT);
-for (var i = 0; i < HTML_COUNT; i++)
-    BLOCK_ELEMENTS[i] = (CONTAINER_ELEMENTS[i] || PARAGRAPH_ELEMENTS[i]);
-
-var INLINE_ELEMENTS = new Array(HTML_COUNT);
-for (var i = 0; i < HTML_COUNT; i++)
-    INLINE_ELEMENTS[i] = !BLOCK_ELEMENTS[i];
-
-var HEADING_ELEMENTS = new Array(HTML_COUNT);
-HEADING_ELEMENTS[HTML_H1] = true;
-HEADING_ELEMENTS[HTML_H2] = true;
-HEADING_ELEMENTS[HTML_H3] = true;
-HEADING_ELEMENTS[HTML_H4] = true;
-HEADING_ELEMENTS[HTML_H5] = true;
-HEADING_ELEMENTS[HTML_H6] = true;
-
-var CONTAINERS_ALLOWING_CHILDREN = new Array(HTML_COUNT);
-CONTAINERS_ALLOWING_CHILDREN[HTML_BODY] = true;
-CONTAINERS_ALLOWING_CHILDREN[HTML_LI] = true;
-CONTAINERS_ALLOWING_CHILDREN[HTML_CAPTION] = true;
-CONTAINERS_ALLOWING_CHILDREN[HTML_TH] = true;
-CONTAINERS_ALLOWING_CHILDREN[HTML_TD] = true;
-CONTAINERS_ALLOWING_CHILDREN[HTML_FIGURE] = true;
-CONTAINERS_ALLOWING_CHILDREN[HTML_FIGCAPTION] = true;
-CONTAINERS_ALLOWING_CHILDREN[HTML_NAV] = true;
-
-var OUTLINE_TITLE_ELEMENTS = new Array(HTML_COUNT);
-OUTLINE_TITLE_ELEMENTS[HTML_H1] = true;
-OUTLINE_TITLE_ELEMENTS[HTML_H2] = true;
-OUTLINE_TITLE_ELEMENTS[HTML_H3] = true;
-OUTLINE_TITLE_ELEMENTS[HTML_H4] = true;
-OUTLINE_TITLE_ELEMENTS[HTML_H5] = true;
-OUTLINE_TITLE_ELEMENTS[HTML_H6] = true;
-OUTLINE_TITLE_ELEMENTS[HTML_FIGCAPTION] = true;
-OUTLINE_TITLE_ELEMENTS[HTML_CAPTION] = true;
-
-var Keys = {
-    HEADING_NUMBER: "uxwrite-heading-number",
-    FIGURE_NUMBER: "uxwrite-figure-number",
-    TABLE_NUMBER: "uxwrite-table-number",
-    SECTION_TOC: "tableofcontents",
-    FIGURE_TOC: "listoffigures",
-    TABLE_TOC: "listoftables",
-    SELECTION_HIGHLIGHT: "uxwrite-selection-highlight",
-    AUTOCORRECT_ENTRY: "uxwrite-autocorrect-entry",
-    UXWRITE_PREFIX: "uxwrite-",
-    NONE_STYLE: "__none",
-    AUTOCORRECT_CLASS: "uxwrite-autocorrect",
-    SELECTION_CLASS: "uxwrite-selection",
-    ABSTRACT_ELEMENT: "uxwrite-abstract",
-    SPELLING_CLASS: "uxwrite-spelling",
-    MATCH_CLASS: "uxwrite-match",
-};
-
-var ITEM_NUMBER_CLASSES = {
-    "uxwrite-heading-number": true,
-    "uxwrite-figure-number": true,
-    "uxwrite-table-number": true,
-};
-
-var OPAQUE_NODE_CLASSES = {
-    "uxwrite-heading-number": true,
-    "uxwrite-figure-number": true,
-    "uxwrite-table-number": true,
-    "tableofcontents": true,
-    "listoffigures": true,
-    "listoftables": true,
-    "uxwrite-selection-highlight": true,
-    "uxwrite-field": true,
-};
-
-function isContainerNode(node)
-{
-    return CONTAINER_ELEMENTS[node._type];
-}
-
-function isParagraphNode(node)
-{
-    return PARAGRAPH_ELEMENTS[node._type];
-}
-
-function isHeadingNode(node)
-{
-    return HEADING_ELEMENTS[node._type];
-}
-
-function isBlockNode(node)
-{
-    return BLOCK_ELEMENTS[node._type];
-}
-
-function isBlockOrNoteNode(node)
-{
-    return BLOCK_ELEMENTS[node._type] || isNoteNode(node);
-}
-
-function isInlineNode(node)
-{
-    return INLINE_ELEMENTS[node._type];
-}
-
-function isListNode(node)
-{
-    var type = node._type;
-    return ((type == HTML_UL) || (type == HTML_OL));
-}
-
-function isTableCell(node)
-{
-    switch (node._type) {
-    case HTML_TD:
-    case HTML_TH:
-        return true;
-    default:
-        return false;
-    }
-}
-
-function isRefNode(node)
-{
-    return ((node._type == HTML_A) &&
-            node.hasAttribute("href") &&
-            node.getAttribute("href").charAt(0) == "#");
-}
-
-function isNoteNode(node)
-{
-    if (node._type != HTML_SPAN)
-        return false;
-    var className = DOM_getAttribute(node,"class");
-    return ((className == "footnote") || (className == "endnote"));
-}
-
-function isEmptyNoteNode(node)
-{
-    return isNoteNode(node) && !nodeHasContent(node);
-}
-
-function isItemNumber(node)
-{
-    if (node.nodeType == Node.TEXT_NODE) {
-        return isItemNumber(node.parentNode);
-    }
-    else if (node.nodeType == Node.ELEMENT_NODE) {
-        if ((node._type == HTML_SPAN) && node.hasAttribute("class")) {
-            return ITEM_NUMBER_CLASSES[node.getAttribute("class")];
-        }
-    }
-    return false;
-}
-
-function isOpaqueNode(node)
-{
-    if (node == null)
-        return false;
-
-    switch (node._type) {
-    case HTML_TEXT:
-    case HTML_COMMENT:
-        return isOpaqueNode(node.parentNode);
-    case HTML_IMG:
-        return true;
-    case HTML_A:
-        return node.hasAttribute("href");
-    case HTML_DOCUMENT:
-        return false;
-    default:
-        if (node.hasAttribute("class") && OPAQUE_NODE_CLASSES[node.getAttribute("class")])
-            return true;
-        else
-            return isOpaqueNode(node.parentNode);
-    }
-}
-
-function isAutoCorrectNode(node)
-{
-    return ((node._type == HTML_SPAN) &&
-            (node.getAttribute("class") == Keys.AUTOCORRECT_CLASS));
-}
-
-function isSelectionHighlight(node)
-{
-    return ((node.nodeType == Node.ELEMENT_NODE) &&
-            node.getAttribute("class") == Keys.SELECTION_CLASS);
-}
-
-function isSelectionSpan(node)
-{
-    return ((node != null) &&
-            (node._type == HTML_SPAN) &&
-            (DOM_getAttribute(node,"class") == Keys.SELECTION_CLASS));
-};
-
-function isTOCNode(node)
-{
-    if (node._type == HTML_NAV) {
-        var cls = node.getAttribute("class");
-        if ((cls == Keys.SECTION_TOC) ||
-            (cls == Keys.FIGURE_TOC) ||
-            (cls == Keys.TABLE_TOC))
-            return true;
-    }
-    return false;
-}
-
-function isInTOC(node)
-{
-    if (isTOCNode(node))
-        return true;
-    if (node.parentNode != null)
-        return isInTOC(node.parentNode);
-    return false;
-}
-
-function isSpecialBlockNode(node)
-{
-    switch (node._type) {
-    case HTML_TABLE:
-    case HTML_FIGURE:
-        return true;
-    case HTML_NAV:
-        return isTOCNode(node);
-    default:
-        return false;
-    }
-}
-
-function isAbstractSpan(node)
-{
-    return ((node._type == HTML_SPAN) && node.hasAttribute(Keys.ABSTRACT_ELEMENT));
-}

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer0_Javascript/util.js
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer0_Javascript/util.js b/experiments/editorFramework/src/Layer0_Javascript/util.js
deleted file mode 100644
index 191fc55..0000000
--- a/experiments/editorFramework/src/Layer0_Javascript/util.js
+++ /dev/null
@@ -1,365 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-function arrayContains(array,value)
-{
-    for (var i = 0; i < array.length; i++) {
-        if (array[i] == value)
-            return true;
-    }
-    return false;
-}
-
-// Note: you can use slice() to copy a real javascript array, but this function can be used to copy
-// DOM NodeLists (e.g. as returned by document.getElementsByTagName) as well, since they don't
-// support the slice method
-function arrayCopy(array)
-{
-    if (array == null)
-        return null;
-    var copy = new Array();
-    for (var i = 0; i < array.length; i++)
-        copy.push(array[i]);
-    return copy;
-}
-
-function quoteString(str)
-{
-    if (str == null)
-        return null;
-
-    if (str.indexOf('"') < 0)
-        return str;
-
-    var quoted = "";
-    for (var i = 0; i < str.length; i++) {
-        if (str.charAt(i) == '"')
-            quoted += "\\\"";
-        else
-            quoted += str.charAt(i);
-    }
-    return quoted;
-}
-
-function nodeString(node)
-{
-    if (node == null)
-        return "null";
-    var id = "";
-    if (window.debugIds)
-        id = node._nodeId+":";
-    if (node.nodeType == Node.TEXT_NODE) {
-        return id+JSON.stringify(node.nodeValue);
-    }
-    else if (node.nodeType == Node.ELEMENT_NODE) {
-        var name = (node.namespaceURI == null) ? node.nodeName.toUpperCase() : node.nodeName;
-        if (node.hasAttribute("id"))
-            return id+name+"#"+node.getAttribute("id");
-        else
-            return id+name;
-    }
-    else {
-        return id+node.toString();
-    }
-}
-
-function rectString(rect)
-{
-    if (rect == null)
-        return null;
-    else
-        return "("+rect.left+","+rect.top+") - ("+rect.right+","+rect.bottom+")";
-}
-
-function rectIsEmpty(rect)
-{
-    return ((rect == null) ||
-            ((rect.width == 0) && (rect.height == 0)));
-}
-
-function rectContainsPoint(rect,x,y)
-{
-    return ((x >= rect.left) && (x < rect.right) &&
-            (y >= rect.top) && (y < rect.bottom));
-}
-
-function clone(object)
-{
-    var result = new Object();
-    for (var name in object)
-        result[name] = object[name];
-    return result;
-}
-
-function nodeHasContent(node)
-{
-    switch (node._type) {
-    case HTML_TEXT:
-        return !isWhitespaceString(node.nodeValue);
-    case HTML_IMG:
-    case HTML_TABLE:
-        return true;
-    default:
-        if (isOpaqueNode(node))
-            return true;
-
-        for (var child = node.firstChild; child != null; child = child.nextSibling) {
-            if (nodeHasContent(child))
-                return true;
-        }
-        return false;
-    }
-}
-
-function isWhitespaceString(str)
-{
-    return (str.match(isWhitespaceString.regexp) != null);
-}
-
-isWhitespaceString.regexp = /^\s*$/;
-
-function normalizeWhitespace(str)
-{
-    str = str.replace(/^\s+/,"");
-    str = str.replace(/\s+$/,"");
-    str = str.replace(/\s+/g," ");
-    return str;
-}
-
-function DoublyLinkedList()
-{
-    this.first = null;
-    this.last = null;
-}
-
-DoublyLinkedList.prototype.insertAfter = function(item,after)
-{
-    item.prev = null;
-    item.next = null;
-
-    if (this.first == null) { // empty list
-        this.first = item;
-        this.last = item;
-    }
-    else if (after == null) { // insert at start
-        item.next = this.first;
-        this.first = item;
-    }
-    else {
-        item.next = after.next;
-        item.prev = after;
-        if (this.last == after)
-            this.last = item;
-    }
-
-    if (item.next != null)
-        item.next.prev = item;
-    if (item.prev != null)
-        item.prev.next = item;
-};
-
-DoublyLinkedList.prototype.remove = function(item)
-{
-    if (this.first == item)
-        this.first = this.first.next;
-    if (this.last == item)
-        this.last = this.last.prev;
-    if (item.prev != null)
-        item.prev.next = item.next;
-    if (item.next != null)
-        item.next.prev = item.prev;
-    item.prev = null;
-    item.next = null;
-};
-
-function diff(src,dest)
-{
-    var traces = new Array();
-
-    traces[1] = new DiffEntry(0,0,0,0,null);
-
-    for (var distance = 0; true; distance++) {
-        for (var k = -distance; k <= distance; k += 2) {
-            var srcEnd;
-            var prev;
-
-            var del = traces[k-1];
-            var ins = traces[k+1];
-
-            if (((k == -distance) && ins) ||
-                ((k != distance) && ins && del && (del.srcEnd < ins.srcEnd))) {
-                // Down - insertion
-                prev = ins;
-                srcEnd = prev.srcEnd;
-            }
-            else if (del) {
-                // Right - deletion
-                prev = del;
-                srcEnd = prev.srcEnd+1;
-            }
-            else {
-                traces[k] = null;
-                continue;
-            }
-
-            destEnd = srcEnd - k;
-            var srcStart = srcEnd;
-            var destStart = destEnd;
-            while ((srcEnd < src.length) && (destEnd < dest.length) &&
-                   (src[srcEnd] == dest[destEnd])) {
-                srcEnd++;
-                destEnd++;
-            }
-            if ((srcEnd > src.length) || (destEnd > dest.length))
-                traces[k] = null;
-            else
-                traces[k] = new DiffEntry(srcStart,destStart,srcEnd,destEnd,prev);
-            if ((srcEnd >= src.length) && (destEnd >= dest.length)) {
-                return entryToArray(src,dest,traces[k]);
-            }
-        }
-    }
-
-    function DiffEntry(srcStart,destStart,srcEnd,destEnd,prev)
-    {
-        this.srcStart = srcStart;
-        this.destStart = destStart;
-        this.srcEnd = srcEnd;
-        this.destEnd = destEnd;
-        this.prev = prev;
-    }
-
-    function entryToArray(src,dest,entry)
-    {
-        var results = new Array();
-        results.push(entry);
-        for (entry = entry.prev; entry != null; entry = entry.prev) {
-            if ((entry.srcStart != entry.srcEnd) || (entry.destStart != entry.destEnd))
-                results.push(entry);
-        }
-        return results.reverse();
-    }
-}
-
-function TimingEntry(name,time)
-{
-    this.name = name;
-    this.time = time;
-}
-
-function TimingInfo()
-{
-    this.entries = new Array();
-    this.total = 0;
-    this.lastTime = null;
-}
-
-TimingInfo.prototype.start = function()
-{
-    this.entries.length = 0;
-    this.lastTime = new Date();
-};
-
-TimingInfo.prototype.addEntry = function(name)
-{
-    if (this.lastTime == null)
-        this.start();
-
-    var now = new Date();
-    var interval = now - this.lastTime;
-    this.entries.push(new TimingEntry(name,interval));
-    this.total += interval;
-    this.lastTime = now;
-};
-
-TimingInfo.prototype.print = function(title)
-{
-    debug(title);
-    for (var i = 0; i < this.entries.length; i++) {
-        var entry = this.entries[i];
-        debug("    "+entry.name+": "+entry.time+"ms");
-    }
-};
-
-function readFileApp(filename)
-{
-    var req = new XMLHttpRequest("file:///read/"+filename);
-    req.open("POST","/read/"+encodeURI(filename),false);
-    req.send();
-    if (req.status == 404)
-        return null; // file not found
-    else if ((req.status != 200) && (req.status != 0))
-        throw new Error(req.status+": "+req.responseText);
-    var doc = req.responseXML;
-    if (doc != null)
-        DOM_assignNodeIds(doc);
-    return doc;
-}
-
-function readFileTest(filename)
-{
-    var req = new XMLHttpRequest();
-    req.open("GET",filename,false);
-    req.send();
-    var xml = req.responseXML;
-    if (xml == null)
-        return null;
-    DOM_assignNodeIds(xml.documentElement);
-    return xml;
-}
-
-function fromTokenList(value)
-{
-    var result = new Object();
-    if (value != null) {
-        var components = value.toLowerCase().split(/\s+/);
-        for (var i = 0; i < components.length; i++) {
-            if (components[i].length > 0)
-                result[components[i]] = true;
-        }
-    }
-    return result;
-}
-
-function toTokenList(properties)
-{
-    var tokens = new Array();
-
-    if (properties != null) {
-        // Sort the names to ensure deterministic results in test cases
-        var names = Object.getOwnPropertyNames(properties).sort();
-        for (var i = 0; i < names.length; i++) {
-            var name = names[i];
-            if (properties[name])
-                tokens.push(name);
-        }
-    }
-
-    if (tokens.length == null)
-        return null;
-    else
-        return tokens.join(" ");
-}
-
-function xywhAbsElementRect(element)
-{
-    var rect = element.getBoundingClientRect();
-    return { x: rect.left + window.scrollX,
-             y: rect.top + window.scrollY,
-             width: rect.width,
-             height: rect.height };
-}

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer1_toolkit/Layer1_interface.hpp
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/Layer1_interface.hpp b/experiments/editorFramework/src/Layer1_toolkit/Layer1_interface.hpp
deleted file mode 100644
index 042a1a7..0000000
--- a/experiments/editorFramework/src/Layer1_toolkit/Layer1_interface.hpp
+++ /dev/null
@@ -1,480 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#pragma once
-
-#include <QString>
-#include <QRect>
-#include <QJsonObject>
-#include <QJsonArray>
-#include <QTextStream>
-
-/**
- * \file JSInterface.h
- *
- * C++ interface to the JavaScript editor library
- *
- * All of the core editing operations for Corinthia are implemented in the Editor library, which is
- * written in JavaScript. This library can be used either from within a web browser, or, in the case
- * of the Qt application, from an embedded web view. For this app, we use a QWebView instance which
- * maintains the in-memory DOM tree of the document, and has injected into it all of the javascript
- * code that is part of the editor library.
- *
- * The source code of the Editor library lives in (repository-root)/Editor/src. During build of the
- * Qt app, all the javascript files are copied into (build-dir)/share/corinthia/js. If you wish to
- * make changes to the javascript code, you should modify the files in the former location, as the
- * latter files will be overwritten on every build.
- *
- * The purpose of JSInterface.h and JSInterface.cpp is to provide a C++ wrapper over this. All of
- * the methods defined in the classes below (with the exception of callbacks) ultimately result in a
- * call to QWebFrame's evaluateJavaScript() method. See the documentation for JSInterface.cpp for
- * details.
- *
- * The editor library is divided into *modules*, each of which implements a specific aspect of
- * editing functionality. For example, the Cursor module contains methods for moving the cursor
- * around the document, and inserting or deleting text at the current cursor position. Similarly,
- * the Tables module contains methods for inserting, deleting, and modifying tables. A separate C++
- * class is defined for each module, and an instance of each class is maintained by the "container"
- * class, JSInterface. When using the code here, you should do so via a JSInterface instance.
- */
-
-#define JS_MODULE_COMMON(className) \
-Q_DISABLE_COPY(className) \
-public: \
-className(JSEvaluator *evaluator) : JSModule(evaluator) {}
-
-QTextStream& qStdOut();
-QString QRectString(QRect rect);
-
-/**
- * Callback interface
- *
- * While the module classes are for making calls from C++ to JavaScript, the JSCallbacks abstract
- * class is for responding to requests from JavaScript to invoke C++ code. This is declared here as
- * an abstract class (that is, with all methods virtual and no implementations provided) to avoid
- * dependencies between the code in this file and other parts of the application. The
- * EditorJSCallbacks class in Editor.cpp provides a concrete implementation of this, which is where
- * the actual callback functions are implemented.
- *
- * Callbacks are always invoked *after* the execution of a particular editor library API function,
- * not during. The reason for this design design in the library was to enable support for web view
- * classes that did not provide native support for callbacks (as was the case for iOS, at least at
- * the time the library was originally written).
- *
- * The way that callbacks are invoked is that after each editor API call, a query is performed for a
- * list of pending callback messages. The evaluation logic iterates through these and invokes the
- * appropriate callback method for each. For this reason, callbacks method are all 'void' - they
- * never return a value. Callbacks are for notification purposes only - typically telling the
- * application to update the UI in some manner.
- */
-class JSCallbacks
-{
-public:
-    virtual ~JSCallbacks() {}
-    virtual void debug(const QString &message) = 0;
-    virtual void addOutlineItem(const QString &itemId, const QString &type, const QString &title) = 0;
-    virtual void updateOutlineItem(const QString &itemId, const QString &title) = 0;
-    virtual void removeOutlineItem(const QString &itemId) = 0;
-    virtual void outlineUpdated() = 0;
-    virtual void setCursor(int x, int y, int width, int height) = 0;
-    virtual void setSelectionHandles(int x1, int y1, int height1, int x2, int y2, int height2) = 0;
-    virtual void setTableSelection(int x, int y, int width, int height) = 0;
-    virtual void setSelectionBounds(int left, int top, int right, int bottom) = 0;
-    virtual void clearSelectionHandlesAndCursor() = 0;
-    virtual void updateAutoCorrect() = 0;
-    virtual void error(const QString &message, const QString &operation) = 0;
-};
-
-/**
- * The JSEvaluator abstract class provides an evaluate() method which is called (indirectly) by all
- * of the individual module methods. As with JSCallbacks, it is defined as abstract to avoid a
- * dependency on the code outside of this file. The EditorJSEvaluator class in Editor.cpp provides a
- * concrete implementation of this; its evaluate() method simply calls through to the
- * evaluateJavaScript() method of QWebView.
- *
- * JSEvaluator also has a callbacks() method, which must return an instance of JSCallbacks. This
- * makes JSEvaluator the "central point of contact" between the JavaScript interface and the rest of
- * the application, in that it provides the necessary access to call *in* to javascript, and to
- * respond (via callbacks) to calls *out* of javascript. Upon initialisation of a document window,
- * concrete implementations of both JSCallbacks and JSEvaluator are created, the latter maintaining
- * a reference to the former. See Editor::Editor() for where ths is actually done.
- */
-class JSEvaluator
-{
-public:
-    virtual ~JSEvaluator() {}
-    virtual QString evaluate(const QString &script) = 0;
-    virtual JSCallbacks *callbacks() = 0;
-};
-
-class JSAutoCorrect;
-class JSChangeTracking;
-class JSClipboard;
-class JSCursor;
-class JSEquations;
-class JSFigures;
-class JSFormatting;
-class JSInput;
-class JSLists;
-class JSMain;
-class JSMetadata;
-class JSOutline;
-class JSPreview;
-class JSScan;
-class JSSelection;
-class JSStyles;
-class JSTables;
-class JSUndoManager;
-class JSViewport;
-class EDScanParagraph;
-
-class JSError
-{
-public:
-    const QString &type() { return _type; }
-    const QString &message() { return _message; }
-    const QString &operation() { return _operation; }
-    const QString &html() { return _html; }
-
-private:
-
-    QString _type;
-    QString _message;
-    QString _operation;
-    QString _html;
-};
-
-class JSModule
-{
-    Q_DISABLE_COPY(JSModule)
-public:
-    JSModule(JSEvaluator *evaluator) : _evaluator(evaluator) {};
-protected:
-    JSEvaluator *_evaluator;
-};
-
-// Functions implemented in AutoCorrect.js
-
-class JSAutoCorrect : public JSModule
-{
-    JS_MODULE_COMMON(JSAutoCorrect)
-    void correctPrecedingWord(int numChars, const QString &replacement, bool confirmed);
-    QJsonObject getCorrection();
-    QJsonObject getCorrectionCoords();
-    void acceptCorrection();
-    void replaceCorrection(const QString &replacement);
-};
-
-// Functions implemented in ChangeTracking.js
-
-class JSChangeTracking : public JSModule
-{
-    JS_MODULE_COMMON(JSChangeTracking)
-    bool showChanges();
-    bool trackChanges();
-    void setShowChanges(bool showChanges);
-    void setTrackChanges(bool trackChanges);
-};
-
-// Functions implemented in Clipboard.js
-
-class JSClipboard : public JSModule
-{
-    JS_MODULE_COMMON(JSClipboard)
-    QJsonObject clipboardCut();
-    QJsonObject clipboardCopy();
-    void pasteHTML(const QString &html);
-    void pasteText(const QString &text);
-};
-
-// Functions implemented in Cursor.js
-
-class JSCursor : public JSModule
-{
-    JS_MODULE_COMMON(JSCursor)
-    QString positionCursor(int x, int y, bool wordBoundary);
-    QRect getCursorPosition();
-    void moveLeft();
-    void moveRight();
-    void moveToStartOfDocument();
-    void moveToEndOfDocument();
-    void insertReference(const QString &itemId);
-    void insertLink(const QString &text, const QString &url);
-    void insertCharacter(unsigned short character, bool allowInvalidPos);
-    void deleteCharacter();
-    void enterPressed();
-    QString getPrecedingWord();
-    QJsonObject getLinkProperties();
-    void setLinkProperties(QJsonObject properties);
-    void setReferenceTarget(const QString &itemId);
-    void insertFootnote(const QString &content);
-    void insertEndnote(const QString &content);
-};
-
-// Functions implemented in Equations.js
-
-class JSEquations : public JSModule
-{
-    JS_MODULE_COMMON(JSEquations)
-    void insertEquation();
-};
-
-// Functions implemented in Figures.js
-
-class JSFigures : public JSModule
-{
-    JS_MODULE_COMMON(JSFigures)
-    void insertFigure(const QString &filename, const QString &width,
-                      bool numbered, const QString &caption);
-    QString getSelectedFigureId();
-    QJsonObject getProperties(const QString &itemId);
-    void setProperties(const QString &itemId, const QString &width, const QString &src);
-    QJsonObject getGeometry(const QString &itemId);
-};
-
-// Functions implemented in Formatting.js
-
-class JSFormatting : public JSModule
-{
-    JS_MODULE_COMMON(JSFormatting)
-    QJsonObject getFormatting();
-    void applyFormattingChanges(const QString &style, QJsonObject properties);
-};
-
-// Functions implemented in Input.js
-
-class JSInput : public JSModule
-{
-    JS_MODULE_COMMON(JSInput)
-    void removePosition(int posId);
-
-    QString textInRange(int startId, int startAdjust, int endId, int endAdjust);
-    void replaceRange(int startId, int endId, const QString &text);
-    QJsonObject selectedTextRange();
-    void setSelectedTextRange(int startId, int endId);
-    QJsonObject markedTextRange();
-    void setMarkedText(const QString &text, int startOffset, int endOffset);
-    void unmarkText();
-    bool forwardSelectionAffinity();
-    void setForwardSelectionAffinity(bool forwardSelectionAffinity);
-    int positionFromPositionOffset(int posId, int offset);
-    int positionFromPositionInDirectionOffset(int posId, const QString &direction, int offset);
-    int comparePositionToPosition(int positionId, int otherId);
-    int offsetFromPositionToPosition(int fromPosition, int toPosition);
-    int positionWithinRangeFarthestInDirection(int startId, int endId, const QString &direction);
-    QJsonObject characterRangeByExtendingPositionInDirection(int positionId, const QString &direction);
-    QJsonObject firstRectForRange(int startId, int endId);
-    QJsonObject caretRectForPosition(int posId);
-    int closestPositionToPoint(int x, int y);
-    int closestPositionToPointWithinRange(int x, int y, int startId, int endId);
-    QJsonObject characterRangeAtPoint(int x, int y);
-    int positionWithinRangeAtCharacterOffset(int startId, int endId, int offset);
-    int characterOffsetOfPositionWithinRange(int positionId, int startId, int endId);
-
-    bool isPositionAtBoundaryGranularityInDirection(int posId, const QString &granularity,
-                                                    const QString &direction);
-    bool isPositionWithinTextUnitInDirection(int posId, const QString &granularity,
-                                             const QString &direction);
-    int positionFromPositionToBoundaryInDirection(int posId, const QString &granularity,
-                                                  const QString &direction);
-    QJsonObject rangeEnclosingPositionWithGranularityInDirection(int posId,
-                                                                 const QString &granularity,
-                                                                 const QString &direction);
-};
-
-// Functions implemented in Lists.js
-
-class JSLists : public JSModule
-{
-    JS_MODULE_COMMON(JSLists)
-    void increaseIndent();
-    void decreaseIndent();
-    void clearList();
-    void setUnorderedList();
-    void setOrderedList();
-};
-
-// Functions implemented in Main.js
-
-class JSMain : public JSModule
-{
-    JS_MODULE_COMMON(JSMain)
-    QString getLanguage();
-    void setLanguage(const QString &language);
-    QString setGenerator(const QString &generator);
-    bool prepareForSave();
-    QString getHTML();
-    bool isEmptyDocument();
-};
-
-// Functions implemented in Metadata.js
-
-class JSMetadata : public JSModule
-{
-    JS_MODULE_COMMON(JSMetadata)
-    QJsonObject getMetadata();
-    void setMetadata(const QJsonObject &metadata);
-};
-
-// Functions implemented in Outline.js
-
-class JSOutline : public JSModule
-{
-    JS_MODULE_COMMON(JSOutline)
-    QJsonObject getOutline();
-    void moveSection(const QString &sectionId, const QString &parentId, const QString &nextId);
-    void deleteItem(const QString &itemId);
-    void goToItem(const QString &itemId);
-    void scheduleUpdateStructure();
-    void setNumbered(const QString &itemId, bool numbered);
-    void setTitle(const QString &itemId, const QString &title);
-    void insertTableOfContents();
-    void insertListOfFigures();
-    void insertListOfTables();
-    void setPrintMode(bool printMode);
-    QJsonObject examinePrintLayout(int pageHeight);
-    bool detectSectionNumbering();
-    QJsonObject findUsedStyles();
-};
-
-// Functions implemented in Preview.js
-
-class JSPreview : public JSModule
-{
-    JS_MODULE_COMMON(JSPreview)
-    void showForStyle(const QString &styleId, const QString &uiName, const QString &title);
-};
-
-// Functions implemented in Scan.js
-
-class JSScan : public JSModule
-{
-    JS_MODULE_COMMON(JSScan)
-    void reset();
-    EDScanParagraph *next();
-    int addMatch(int start, int end);
-    void showMatch(int matchId);
-    void replaceMatch(int matchId, const QString &text);
-    void removeMatch(int matchId);
-    void goToMatch(int matchId);
-};
-
-// Functions implemented in Selection.js
-
-class JSSelection : public JSModule
-{
-    JS_MODULE_COMMON(JSSelection)
-    void update();
-    void selectAll();
-    void selectParagraph();
-    void selectWordAtCursor();
-    QString dragSelectionBegin(int x, int y, bool selectWord);
-    QString dragSelectionUpdate(int x, int y, bool selectWord);
-    QString moveStartLeft();
-    QString moveStartRight();
-    QString moveEndLeft();
-    QString moveEndRight();
-    void setSelectionStartAtCoords(int x, int y);
-    void setSelectionEndAtCoords(int x, int y);
-    void setTableSelectionEdgeAtCoords(const QString &edge, int x, int y);
-    void print();
-};
-
-// Functions implemented in Styles.js
-
-class JSStyles : public JSModule
-{
-    JS_MODULE_COMMON(JSStyles)
-    QString getCSSText();
-    void setCSSText(const QString &cssText, const QJsonObject &rules);
-    QString paragraphClass();
-    void setParagraphClass(const QString &paragraphClass);
-};
-
-// Functions implemented in Tables.js
-
-class JSTables : public JSModule
-{
-    JS_MODULE_COMMON(JSTables)
-    void insertTable(int rows, int cols, const QString &width, bool numbered,
-                     const QString &caption, const QString &className);
-    void addAdjacentRow();
-    void addAdjacentColumn();
-    void removeAdjacentRow();
-    void removeAdjacentColumn();
-    void clearCells();
-    void mergeCells();
-    void splitSelection();
-    QString getSelectedTableId();
-    QJsonObject getProperties(const QString &itemId);
-    void setProperties(const QString &itemId, const QString &width);
-    void setColWidths(const QString &itemId, const QJsonArray &colWidths);
-    QJsonObject getGeometry(const QString &itemId);
-};
-
-// Functions implemented in UndoManager.js
-
-class JSUndoManager : public JSModule
-{
-    JS_MODULE_COMMON(JSUndoManager)
-    int getLength();
-    int getIndex();
-    void setIndex(int index);
-    void undo();
-    void redo();
-    void newGroup(const QString &name);
-    QString groupType();
-};
-
-// Functions implemented in Viewport.js
-
-class JSViewport : public JSModule
-{
-    JS_MODULE_COMMON(JSViewport)
-    void setViewportWidth(int width);
-    void setTextScale(int textScale);
-};
-
-// All modules
-
-class JSInterface
-{
-    Q_DISABLE_COPY(JSInterface)
-public:
-    JSInterface(JSEvaluator *evaluator);
-    JSAutoCorrect autoCorrect;
-    JSChangeTracking changeTracking;
-    JSClipboard clipboard;
-    JSCursor cursor;
-    JSEquations equations;
-    JSFigures figures;
-    JSFormatting formatting;
-    JSInput input;
-    JSLists lists;
-    JSMain main;
-    JSMetadata metadata;
-    JSOutline outline;
-    JSPreview preview;
-    JSScan scan;
-    JSSelection selection;
-    JSStyles styles;
-    JSTables tables;
-    JSUndoManager undoManager;
-    JSViewport viewport;
-};
-
-void processCallbacks(JSEvaluator *evaluator);

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer1_toolkit/README
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/README b/experiments/editorFramework/src/Layer1_toolkit/README
deleted file mode 100644
index 8288d80..0000000
--- a/experiments/editorFramework/src/Layer1_toolkit/README
+++ /dev/null
@@ -1,3 +0,0 @@
-first example will be Qt
-
-Code will be moved in from other experiments

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer1_toolkit/qt/README
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/qt/README b/experiments/editorFramework/src/Layer1_toolkit/qt/README
deleted file mode 100644
index 0c59bb8..0000000
--- a/experiments/editorFramework/src/Layer1_toolkit/qt/README
+++ /dev/null
@@ -1 +0,0 @@
-Qt example code

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.cpp
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.cpp b/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.cpp
deleted file mode 100644
index 4e1fba4..0000000
--- a/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#pragma once
-#include "windows.hpp"
-#include "qt_toolkit.hpp"
-
-
-
-toolkit * toolkit::createInstance(toolkit_callback *tk, int debug_level) {
-    return (toolkit *)new qt_toolkit();
-}
-
-
-
-bool qt_toolkit::startWindow() {
-    int    argc = 0;
-    char **argv = NULL;
-
-    app    = new QApplication(argc, argv);
-    window = new MainWindow(app);
-    return true;
-}
-
-
-
-void qt_toolkit::run() {
-    window->show();
-    app->exec();
-}
-
-
-
-bool qt_toolkit::callJavascript(const char *function) {
-    return true;
-}
-
-
-
-#if 0
-{
-}
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.hpp
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.hpp b/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.hpp
deleted file mode 100644
index 84da8b2..0000000
--- a/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#pragma once
-#include "../toolkit.hpp"
-#include <QtWidgets/QApplication>
-
-/*
- * Implementation of toolkit generic interface in Qt
- *
- */
-
-
-class qt_toolkit : toolkit
-{
-    /* toolkit qt implementation */
-
-public:
-    /* Inherited functions */
-    bool startWindow();
-    void run();
-    bool callJavascript(const char *function);
-
-private: 
-    QApplication     *app;
-    MainWindow       *window;
-    toolkit_callback *callback;
-    int               debugLevel;
-};
-

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer1_toolkit/qt/windows.hpp
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/qt/windows.hpp b/experiments/editorFramework/src/Layer1_toolkit/qt/windows.hpp
deleted file mode 100644
index cdf0ee7..0000000
--- a/experiments/editorFramework/src/Layer1_toolkit/qt/windows.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#pragma once
-
-/******************** WINDOWS.HPP ********************
- * This file contain all the graphical classes 
- * inherited from Qt
- */
-
-#include <QtWidgets/QWidget>
-
-
-
-class MainWindow : public QWidget
-{
-    Q_OBJECT
-public:
-    MainWindow(QApplication *app);
-    virtual ~MainWindow();
-    public slots:
-    void insertTable();
-    void insertLink();
-    void insertCharacter();
-    void backspace();
-    void moveLeft();
-    void moveRight();
-    void undo();
-    void redo();
-private:
-    QApplication *_app;
-//    Toolbar *_toolbar;
-//    Editor *_editor;
-};

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer1_toolkit/toolkit.hpp
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/toolkit.hpp b/experiments/editorFramework/src/Layer1_toolkit/toolkit.hpp
deleted file mode 100644
index 507ffc0..0000000
--- a/experiments/editorFramework/src/Layer1_toolkit/toolkit.hpp
+++ /dev/null
@@ -1,123 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#pragma once
-
-/*
- * Interface between implementation dependent toolkit and the rest of corinthia.
- *
- * This file describes the smallest possible interface, in order to facilitate easier
- * implementation of other toolkits.
- *
- * The toolkit implementation has the following responsibilities:
- * - Make all graphic manipulation and event handling
- * - Generate the main window, with buttons and a text frame (to show the actual text). Layout is in the TK.
- * - Receive and pass events from the windows/buttons/javasscripts
- * - Manipulate the buttons (enable/disable etc)
- * - Handle dialog boxes, layout is in the TK
- * - Start Javascripts on the text
- * - Provide low level call back with results
- *
- * The toolkit generic part has the following responsibilities:
- * - Provide single calls for every javascript function
- * - Provide manipulation calls (enable, focus etc) for every button
- * - Provide high level call back for each javascript function and button
- *
- * Some of the TK implementations might have a license incompatible with a Apache release, as a consequence the toolkit class
- * makes a complete seperation between the apache world, and the potential non-apache world.
- *
- * The interface consist of 2 classes (each singletons)
- * the toolkit class is instanciated in Layer1 (in the individual implementations) and called from generic Layer1 to
- * activate actions.
- *
- * The toolkit_callback class is instanciated in the generic Layer1 and called from the toolkit implementation to pass results
- * back to the generic layer
- */
-
-
-
-class toolkit_callback {
-    /* Callback interface
-     *
-     * Callbacks are always invoked *after* the execution of a particular editor library API function,
-     * not during. The reason for this design design in the library was to enable support for web view
-     * classes that did not provide native support for callbacks (as was the case for iOS, at least at
-     * the time the library was originally written).
-     *
-     * The way that callbacks are invoked is that after each editor API call, a query is performed for a
-     * list of pending callback messages. The evaluation logic iterates through these and invokes the
-     * appropriate callback method for each. For this reason, callbacks method are all 'void' - they
-     * never return a value. Callbacks are for notification purposes only - typically telling layer2
-     * to update the UI in some manner.
-     */
-
-public:
-    // class is a singleton, so the destructor will only be called when terminating the application
-    ~toolkit_callback() {}
-
-    // Request a debug message to be passed to the log system 
-    // level can have values as defined in the toolkit class
-    void debug(int level, const char *message);
-
-    // pass back Javascript result
-    void notifyJavascript(const char *message);
-
-    // pass back Button action
-    // button can have values as defined in toolkit class
-    // (note windows actions are handled as special buttons)
-    void notifyButtonPressed(int button);
-
-    // pass back Dialogbox action
-    // dialog can have values as defined in toolkit class
-    virtual void notifyDialog(int dialog, const char *message) = 0;
-};
-
-
-
-class toolkit
-{
-    /* toolkit interface
-    *
-    * this class is pure virtual, to make sure it gets implemented in toolkit implementation without any dependencies
-    * from the generic layer.
-    *
-    * Methods in this class activate graphical functions
-    *
-    * A static createInstance() is supplied to allow the TK implementation to instanciate the derived class
-    */
-
-public:
-    // Create instance
-    static const enum {
-        DEBUG_NONE,
-        DEBUG_INFO,
-        DEBUG_WARNING,
-        DEBUG_DEBUG,
-        DEBUG_ERROR
-    };
-    static toolkit *createInstance(toolkit_callback *callback, int debugLevel);
-
-    // Start windows etc
-    virtual bool startWindow() = 0;
-
-    // Start message loop
-    virtual void run() = 0;
-
-    // Start Javascript
-    virtual bool callJavascript(const char *function) = 0;
-};
-

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer1_toolkit/web/README
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/web/README b/experiments/editorFramework/src/Layer1_toolkit/web/README
deleted file mode 100644
index ffb28ff..0000000
--- a/experiments/editorFramework/src/Layer1_toolkit/web/README
+++ /dev/null
@@ -1 +0,0 @@
-Web server code

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9bf02bb2/experiments/editorFramework/src/Layer2_API/EDJSInterface.h
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer2_API/EDJSInterface.h b/experiments/editorFramework/src/Layer2_API/EDJSInterface.h
deleted file mode 100644
index bd6e0d5..0000000
--- a/experiments/editorFramework/src/Layer2_API/EDJSInterface.h
+++ /dev/null
@@ -1,349 +0,0 @@
-//
-//  EDJSInterface.h
-//  Editor
-//
-//  Created by Peter Kelly on 22/11/11.
-//  Copyright (c) 2011-2014 UX Productivity Pty Ltd. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <CoreGraphics/CoreGraphics.h>
-
-@class JSAutoCorrect;
-@class JSChangeTracking;
-@class JSClipboard;
-@class JSCursor;
-@class JSEquations;
-@class JSFigures;
-@class JSFormatting;
-@class JSInput;
-@class JSLists;
-@class JSMain;
-@class JSMetadata;
-@class JSOutline;
-@class JSPreview;
-@class JSScan;
-@class JSSelection;
-@class JSStyles;
-@class JSTables;
-@class JSUndoManager;
-@class JSViewport;
-@class EDScanParagraph;
-
-@interface JSError : NSError
-
-@property (copy, readonly) NSString *type;
-@property (copy, readonly) NSString *message;
-@property (copy, readonly) NSString *operation;
-@property (copy, readonly) NSString *html;
-
-@end
-
-@protocol JSInterfaceDelegate
-
-- (void)jsAddOutlineItem:(NSString *)itemId type:(NSString *)type title:(NSString *)title;
-- (void)jsUpdateOutlineItem:(NSString *)itemId title:(NSString *)title;
-- (void)jsRemoveOutlineItem:(NSString *)itemId;
-- (void)jsOutlineUpdated;
-- (void)jsSetCursorX:(int)x y:(int)y width:(int)width height:(int)height;
-- (void)jsSetSelectionHandlesX1:(int)x1 y1:(int)y1 height1:(int)height1
-                             x2:(int)x2 y2:(int)y2 height2:(int)height2;
-- (void)jsSetTableSelectionX:(int)x y:(int)y width:(int)width height:(int)height;
-- (void)jsSetSelectionBoundsLeft:(int)left top:(int)top right:(int)right bottom:(int)bottom;
-- (void)jsClearSelectionHandlesAndCursor;
-- (void)jsUpdateAutoCorrect;
-
-@end
-
-@protocol JSEvaluator
-
-- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script;
-
-@end
-
-@interface JSInterface : NSObject
-
-@property (weak) NSObject<JSEvaluator> *evaluator;
-@property (weak) NSObject<JSInterfaceDelegate> *delegate;
-@property (assign) BOOL jsInitialised;
-@property (strong) JSAutoCorrect *autoCorrect;
-@property (strong) JSChangeTracking *changeTracking;
-@property (strong) JSClipboard *clipboard;
-@property (strong) JSCursor *cursor;
-@property (strong) JSEquations *equations;
-@property (strong) JSFigures *figures;
-@property (strong) JSFormatting *formatting;
-@property (strong) JSInput *input;
-@property (strong) JSLists *lists;
-@property (strong) JSMain *main;
-@property (strong) JSMetadata *metadata;
-@property (strong) JSOutline *outline;
-@property (strong) JSPreview *preview;
-@property (strong) JSScan *scan;
-@property (strong) JSSelection *selection;
-@property (strong) JSStyles *styles;
-@property (strong) JSTables *tables;
-@property (strong) JSUndoManager *undoManager;
-@property (strong) JSViewport *viewport;
-@property (copy) NSString *currentOperation;
-@property (strong) JSError *error;
-@property (assign) BOOL documentModified;
-
-- (JSInterface *)initWithEvaluator:(NSObject<JSEvaluator> *)evaluator;
-- (BOOL)initJavaScriptWidth:(int)width textScale:(int)textScale cssURL:(NSString *)cssURL
-             clientRectsBug:(BOOL)clientRectsBug;
-- (void)printStatistics;
-
-@end
-
-@interface JSModule : NSObject
-
-@property (assign) JSInterface *js;
-
-- (JSModule *)initWithJS:(JSInterface *)js;
-
-@end
-
-// Functions implemented in AutoCorrect.js
-
-@interface JSAutoCorrect : JSModule
-
-- (void)correctPreceding:(int)numChars word:(NSString *)replacement confirmed:(BOOL)confirmed;
-- (NSDictionary *)getCorrection;
-- (NSDictionary *)getCorrectionCoords;
-- (void)acceptCorrection;
-- (void)replaceCorrection:(NSString *)replacement;
-
-@end
-
-// Functions implemented in ChangeTracking.js
-
-@interface JSChangeTracking : JSModule
-- (BOOL)showChanges;
-- (BOOL)trackChanges;
-- (void)setShowChanges:(BOOL)showChanges;
-- (void)setTrackChanges:(BOOL)trackChanges;
-@end
-
-// Functions implemented in Clipboard.js
-
-@interface JSClipboard : JSModule
-- (NSDictionary *)clipboardCut;
-- (NSDictionary *)clipboardCopy;
-- (void)pasteHTML:(NSString *)html;
-- (void)pasteText:(NSString *)text;
-@end
-
-// Functions implemented in Cursor.js
-
-@interface JSCursor : JSModule
-- (NSString *)positionCursorX:(int)x y:(int)y wordBoundary:(BOOL)wordBoundary;
-- (CGRect)getCursorPosition;
-- (void)moveLeft;
-- (void)moveRight;
-- (void)moveToStartOfDocument;
-- (void)moveToEndOfDocument;
-- (void)insertReference:(NSString *)itemId;
-- (void)insertLinkWithText:(NSString *)text URL:(NSString *)URL;
-- (void)insertCharacter:(unichar)character allowInvalidPos:(BOOL)allowInvalidPos;
-- (void)deleteCharacter;
-- (void)enterPressed;
-- (NSString *)getPrecedingWord;
-- (NSDictionary *)getLinkProperties;
-- (void)setLinkProperties:(NSDictionary *)properties;
-- (void)setReferenceTarget:(NSString *)itemId;
-- (void)insertFootnote:(NSString *)content;
-- (void)insertEndnote:(NSString *)content;
-@end
-
-// Functions implemented in Equations.js
-
-@interface JSEquations : JSModule
-- (void)insertEquation;
-@end
-
-// Functions implemented in Figures.js
-
-@interface JSFigures : JSModule
-- (void)insertFigure:(NSString *)filename width:(NSString *)width
-            numbered:(BOOL)numbered caption:(NSString *)caption;
-- (NSString *)getSelectedFigureId;
-- (NSDictionary *)getProperties:(NSString *)itemId;
-- (void)setProperties:(NSString *)itemId width:(NSString *)width src:(NSString *)src;
-- (NSDictionary *)getGeometry:(NSString *)itemId;
-@end
-
-// Functions implemented in Formatting.js
-
-@interface JSFormatting : JSModule
-- (NSDictionary *)getFormatting;
-- (void)applyFormattingChangesStyle:(NSString *)style properties:(NSDictionary *)properties;
-@end
-
-// Functions implemented in Input.js
-
-@interface JSInput : JSModule
-- (void)removePosition:(int)posId;
-
-// UITextInput methods
-- (NSString *)textInRangeStartId:(int)startId startAdjust:(int)startAdjust
-                           endId:(int)endId endAdjust:(int)endAdjust;
-- (void)replaceRangeStart:(int)startId end:(int)endId withText:(NSString *)text;
-- (NSDictionary *)selectedTextRange;
-- (void)setSelectedTextRangeStart:(int)startId end:(int)endId;
-- (NSDictionary *)markedTextRange;
-- (void)setMarkedText:(NSString *)text startOffset:(int)startOffset endOffset:(int)endOffset;
-- (void)unmarkText;
-- (BOOL)forwardSelectionAffinity;
-- (void)setForwardSelectionAffinity:(BOOL)forwardSelectionAffinity;
-- (int)positionFromPosition:(int)posId offset:(int)offset;
-- (int)positionFromPosition:(int)posId inDirection:(NSString *)direction offset:(int)offset;
-- (int)comparePosition:(int)positionId toPosition:(int)otherId;
-- (int)offsetFromPosition:(int)fromPosition toPosition:(int)toPosition;
-- (int)positionWithinRangeStart:(int)startId end:(int)endId farthestInDirection:(NSString *)direction;
-- (NSDictionary *)characterRangeByExtendingPosition:(int)positionId inDirection:(NSString *)direction;
-- (NSDictionary *)firstRectForRangeStart:(int)startId end:(int)endId;
-- (NSDictionary *)caretRectForPosition:(int)posId;
-- (int)closestPositionToPointX:(int)x y:(int)y;
-- (int)closestPositionToPointX:(int)x y:(int)y withinRangeStart:(int)startId end:(int)endId;
-- (NSDictionary *)characterRangeAtPointX:(int)x y:(int)y;
-- (int)positionWithinRangeStart:(int)startId end:(int)endId atCharacterOffset:(int)offset;
-- (int)characterOffsetOfPosition:(int)positionId withinRangeStart:(int)startId end:(int)endId;
-
-// UITextInputTokenizer methods
-- (BOOL)isPosition:(int)posId atBoundary:(NSString *)granularity inDirection:(NSString *)direction;
-- (BOOL)isPosition:(int)posId withinTextUnit:(NSString *)granularity inDirection:(NSString *)direction;
-- (int)positionFromPosition:(int)posId toBoundary:(NSString *)granularity inDirection:(NSString *)direction;
-- (NSDictionary *)rangeEnclosingPosition:(int)posId withGranularity:(NSString *)granularity inDirection:(NSString *)direction;
-@end
-
-// Functions implemented in Lists.js
-
-@interface JSLists : JSModule
-- (void)increaseIndent;
-- (void)decreaseIndent;
-- (void)clearList;
-- (void)setUnorderedList;
-- (void)setOrderedList;
-@end
-
-// Functions implemented in Main.js
-
-@interface JSMain : JSModule
-- (NSString *)getLanguage;
-- (void)setLanguage:(NSString *)language;
-- (NSString *)setGenerator:(NSString *)generator;
-- (BOOL)prepareForSave;
-- (NSString *)getHTML;
-- (BOOL)isEmptyDocument;
-@end
-
-// Functions implemented in Metadata.js
-
-@interface JSMetadata : JSModule
-- (NSDictionary *)getMetadata;
-- (void)setMetadata:(NSDictionary *)metadata;
-@end
-
-// Functions implemented in Outline.js
-
-@interface JSOutline : JSModule
-- (NSDictionary *)getOutline;
-- (void)moveSection:(NSString *)sectionId parentId:(NSString *)parentId nextId:(NSString *)nextId;
-- (void)deleteItem:(NSString *)itemId;
-- (void)goToItem:(NSString *)itemId;
-- (void)scheduleUpdateStructure;
-- (void)set:(NSString *)itemId numbered:(BOOL)numbered;
-- (void)set:(NSString *)itemId title:(NSString *)title;
-- (void)insertTableOfContents;
-- (void)insertListOfFigures;
-- (void)insertListOfTables;
-- (void)setPrintMode:(BOOL)printMode;
-- (NSDictionary *)examinePrintLayout:(int)pageHeight;
-- (BOOL)detectSectionNumbering;
-- (NSDictionary *)findUsedStyles;
-@end
-
-// Functions implemented in Preview.js
-
-@interface JSPreview : JSModule
-- (void)showForStyle:(NSString *)styleId uiName:(NSString *)uiName title:(NSString *)title;
-@end
-
-// Functions implemented in Scan.js
-
-@interface JSScan : JSModule
-- (void)reset;
-- (EDScanParagraph *)next;
-- (int)addMatchStart:(int)start end:(int)end;
-- (void)showMatch:(int)matchId;
-- (void)replaceMatch:(int)matchId with:(NSString *)text;
-- (void)removeMatch:(int)matchId;
-- (void)goToMatch:(int)matchId;
-@end
-
-// Functions implemented in Selection.js
-
-@interface JSSelection : JSModule
-- (void)update;
-- (void)selectAll;
-- (void)selectParagraph;
-- (void)selectWordAtCursor;
-- (NSString *)dragSelectionBeginX:(int)x y:(int)y selectWord:(BOOL)selectWord;
-- (NSString *)dragSelectionUpdateX:(int)x y:(int)y selectWord:(BOOL)selectWord;
-- (NSString *)moveStartLeft;
-- (NSString *)moveStartRight;
-- (NSString *)moveEndLeft;
-- (NSString *)moveEndRight;
-- (void)setSelectionStartAtCoordsX:(int)x y:(int)y;
-- (void)setSelectionEndAtCoordsX:(int)x y:(int)y;
-- (void)setTableSelectionEdge:(NSString *)edge atCoordsX:(int)x y:(int)y;
-- (void)print;
-@end
-
-// Functions implemented in Styles.js
-
-@interface JSStyles : JSModule
-- (NSString *)getCSSText;
-- (void)setCSSText:(NSString *)cssText rules:(NSDictionary *)rules;
-- (NSString *)paragraphClass;
-- (void)setParagraphClass:(NSString *)paragraphClass;
-@end
-
-// Functions implemented in Tables.js
-
-@interface JSTables : JSModule
-- (void)insertTableRows:(int)rows cols:(int)cols width:(NSString *)width numbered:(BOOL)numbered
-                caption:(NSString *)caption className:(NSString *)className;
-- (void)addAdjacentRow;
-- (void)addAdjacentColumn;
-- (void)removeAdjacentRow;
-- (void)removeAdjacentColumn;
-- (void)clearCells;
-- (void)mergeCells;
-- (void)splitSelection;
-- (NSString *)getSelectedTableId;
-- (NSDictionary *)getProperties:(NSString *)itemId;
-- (void)setProperties:(NSString *)itemId width:(NSString *)width;
-- (void)set:(NSString *)itemId colWidths:(NSArray *)colWidths;
-- (NSDictionary *)getGeometry:(NSString *)itemId;
-@end
-
-// Functions implemented in UndoManager.js
-
-@interface JSUndoManager : JSModule
-- (int)getLength;
-- (int)getIndex;
-- (void)setIndex:(int)index;
-- (void)undo;
-- (void)redo;
-- (void)newGroup:(NSString *)name;
-- (NSString *)groupType;
-@end
-
-// Functions implemented in Viewport.js
-
-@interface JSViewport : JSModule
-- (void)setViewportWidth:(int)width;
-- (void)setTextScale:(int)textScale;
-@end