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