]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 package org.simantics.document.linking.report;\r
2 \r
3 /**\r
4  * Interface for creating documents.\r
5  * \r
6  * @author Marko Luukkainen <marko.luukkainen@vtt.fi>\r
7  *\r
8  */\r
9 public interface Document {\r
10         \r
11         public static String TOC = "toc";\r
12         \r
13         public enum TextSize {TINY,SMALL,MEDIUM,LARGE,HUGE};\r
14 \r
15         /**\r
16          * Creates a new element of given class\r
17          * @param cls\r
18          * @return\r
19          * @throws Exception\r
20          */\r
21         public <T extends DocumentElement> T newElement(Class<T> cls,String... options) throws Exception;\r
22         \r
23         /**\r
24          * Creates a new element of given class, copies parameters from previous element of the same class.\r
25          * @param cls\r
26          * @return\r
27          * @throws Exception\r
28          */\r
29         public <T extends DocumentElement> T nextElement(Class<T> cls, String... options) throws Exception;\r
30         \r
31         /**\r
32          * Returns last element of given class.\r
33          * @param cls\r
34          * @return\r
35          */\r
36         public <T extends DocumentElement> T getCurrentElement(Class<T> cls);\r
37         \r
38         \r
39         /**\r
40          * Creates a new item of given class\r
41          * @param cls\r
42          * @return\r
43          * @throws Exception\r
44          */\r
45         public <T extends DocumentItem> T newItem(Class<T> cls,String... options) throws Exception;\r
46 \r
47         /**\r
48          * Requests a new page. After this call getCurrentLine() is expected to return 1.\r
49          * @throws Exception\r
50          */\r
51         public void nextPage() throws Exception;\r
52         \r
53         /**\r
54          * Returns current line (of the page). The number for first line is 1. \r
55          * @return\r
56          */\r
57         public int getCurrentLine();\r
58         \r
59         /**\r
60          * Returns estimated available lines for current page. For non-paged implementations returns Integer.MAX_VALUE;\r
61          * @return\r
62          */\r
63         public int getAvailableLines();\r
64         \r
65         /**\r
66          * Closes the document. \r
67          * \r
68          * @throws Exception\r
69          */\r
70         public void close() throws Exception;\r
71 \r
72 \r
73 }