]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/Document.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.document.linking.ui / src / org / simantics / document / linking / report / Document.java
diff --git a/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/Document.java b/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/Document.java
new file mode 100644 (file)
index 0000000..7ab7986
--- /dev/null
@@ -0,0 +1,73 @@
+package org.simantics.document.linking.report;\r
+\r
+/**\r
+ * Interface for creating documents.\r
+ * \r
+ * @author Marko Luukkainen <marko.luukkainen@vtt.fi>\r
+ *\r
+ */\r
+public interface Document {\r
+       \r
+       public static String TOC = "toc";\r
+       \r
+       public enum TextSize {TINY,SMALL,MEDIUM,LARGE,HUGE};\r
+\r
+       /**\r
+        * Creates a new element of given class\r
+        * @param cls\r
+        * @return\r
+        * @throws Exception\r
+        */\r
+       public <T extends DocumentElement> T newElement(Class<T> cls,String... options) throws Exception;\r
+       \r
+       /**\r
+        * Creates a new element of given class, copies parameters from previous element of the same class.\r
+        * @param cls\r
+        * @return\r
+        * @throws Exception\r
+        */\r
+       public <T extends DocumentElement> T nextElement(Class<T> cls, String... options) throws Exception;\r
+       \r
+       /**\r
+        * Returns last element of given class.\r
+        * @param cls\r
+        * @return\r
+        */\r
+       public <T extends DocumentElement> T getCurrentElement(Class<T> cls);\r
+       \r
+       \r
+       /**\r
+        * Creates a new item of given class\r
+        * @param cls\r
+        * @return\r
+        * @throws Exception\r
+        */\r
+       public <T extends DocumentItem> T newItem(Class<T> cls,String... options) throws Exception;\r
+\r
+       /**\r
+        * Requests a new page. After this call getCurrentLine() is expected to return 1.\r
+        * @throws Exception\r
+        */\r
+       public void nextPage() throws Exception;\r
+       \r
+       /**\r
+        * Returns current line (of the page). The number for first line is 1. \r
+        * @return\r
+        */\r
+       public int getCurrentLine();\r
+       \r
+       /**\r
+        * Returns estimated available lines for current page. For non-paged implementations returns Integer.MAX_VALUE;\r
+        * @return\r
+        */\r
+       public int getAvailableLines();\r
+       \r
+       /**\r
+        * Closes the document. \r
+        * \r
+        * @throws Exception\r
+        */\r
+       public void close() throws Exception;\r
+\r
+\r
+}
\ No newline at end of file