X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.document.linking.ui%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Flinking%2Freport%2FDocument.java;fp=bundles%2Forg.simantics.document.linking.ui%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Flinking%2Freport%2FDocument.java;h=7ab79865bb3854c10d23f7dc770abf59080c6d8d;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git 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 index 000000000..7ab79865b --- /dev/null +++ b/bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/Document.java @@ -0,0 +1,73 @@ +package org.simantics.document.linking.report; + +/** + * Interface for creating documents. + * + * @author Marko Luukkainen + * + */ +public interface Document { + + public static String TOC = "toc"; + + public enum TextSize {TINY,SMALL,MEDIUM,LARGE,HUGE}; + + /** + * Creates a new element of given class + * @param cls + * @return + * @throws Exception + */ + public T newElement(Class cls,String... options) throws Exception; + + /** + * Creates a new element of given class, copies parameters from previous element of the same class. + * @param cls + * @return + * @throws Exception + */ + public T nextElement(Class cls, String... options) throws Exception; + + /** + * Returns last element of given class. + * @param cls + * @return + */ + public T getCurrentElement(Class cls); + + + /** + * Creates a new item of given class + * @param cls + * @return + * @throws Exception + */ + public T newItem(Class cls,String... options) throws Exception; + + /** + * Requests a new page. After this call getCurrentLine() is expected to return 1. + * @throws Exception + */ + public void nextPage() throws Exception; + + /** + * Returns current line (of the page). The number for first line is 1. + * @return + */ + public int getCurrentLine(); + + /** + * Returns estimated available lines for current page. For non-paged implementations returns Integer.MAX_VALUE; + * @return + */ + public int getAvailableLines(); + + /** + * Closes the document. + * + * @throws Exception + */ + public void close() throws Exception; + + +} \ No newline at end of file