001: /**
002: * ===========================================
003: * JFreeReport : a free Java reporting library
004: * ===========================================
005: *
006: * Project Info: http://reporting.pentaho.org/
007: *
008: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
009: *
010: * This library is free software; you can redistribute it and/or modify it under the terms
011: * of the GNU Lesser General Public License as published by the Free Software Foundation;
012: * either version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015: * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: * See the GNU Lesser General Public License for more details.
017: *
018: * You should have received a copy of the GNU Lesser General Public License along with this
019: * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020: * Boston, MA 02111-1307, USA.
021: *
022: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023: * in the United States and other countries.]
024: *
025: * ------------
026: * ProcessingContext.java
027: * ------------
028: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029: */package org.jfree.report.function;
030:
031: import org.jfree.formula.FormulaContext;
032: import org.jfree.report.ResourceBundleFactory;
033: import org.jfree.report.layout.LayoutSupport;
034: import org.jfree.resourceloader.ResourceKey;
035: import org.jfree.resourceloader.ResourceManager;
036: import org.jfree.util.Configuration;
037:
038: /**
039: * The processing context hold information about the progress of the report processing and contains global properties
040: * used during the report processing.
041: *
042: * @author Thomas Morgner
043: */
044: public interface ProcessingContext {
045: /**
046: * Returns the current progress level. The number itself has no meaning and is only used to measure the progress of
047: * the report processing.
048: *
049: * @return the progress level.
050: */
051: public int getProgressLevel();
052:
053: /**
054: * Returns the total number of different activities the report will process.
055: *
056: * @return the number of different progress levels.
057: */
058: public int getProgressLevelCount();
059:
060: /**
061: * The processing-level is used for dependency tracking. A function that precomputes values should use this level
062: * value to determine its current activity.
063: *
064: * @return the processing level.
065: * @see Expression#getDependencyLevel()
066: */
067: public int getProcessingLevel();
068:
069: /**
070: * Returns the formula context of this report process. The formula context is required to evaluate inline expression
071: * with LibFormula.
072: *
073: * @return the current formula context.
074: */
075: public FormulaContext getFormulaContext();
076:
077: /**
078: * Returns true, if the current processing run is a prepare-run. A prepare run does not generate content, but will be
079: * needed to compute the layout. This flag can be used to possibly optimize the content computation. If in doubt on
080: * how to interpret the flag, then please ignore this flag. The process may be slightly slower, but at least it will
081: * work all the time.
082: *
083: * @return true, if this is a prepare-run, false if this is a content processing run.
084: */
085: public boolean isPrepareRun();
086:
087: /**
088: * Returns the export descriptor from the output-target.
089: *
090: * @return the export descriptor string.
091: * @see org.jfree.report.layout.output.OutputProcessorMetaData#getExportDescriptor()
092: */
093: public String getExportDescriptor();
094:
095: /**
096: * Returns the layout support. The layout support allows functions to do basic layouting.
097: *
098: * @return the layout support.
099: * @deprecated the layouter works differently now. The layout-support returned here is a dummy implementation and
100: * does no longer reflect the real layout computations.
101: */
102: public LayoutSupport getLayoutSupport();
103:
104: /**
105: * The resource-bundle factory encapsulates all locale specific resources and provides a system-independent way to
106: * create Resource-Bundles. This returns the initial master-report's resource-bundle factory.
107: *
108: * @return the report's resource-bundle factory.
109: */
110: public ResourceBundleFactory getResourceBundleFactory();
111:
112: /**
113: * Returns the content base of the initial master-report. The content-base resource-key can be used to
114: * resolve relative paths.
115: *
116: * @return the initial content base.
117: */
118: public ResourceKey getContentBase();
119:
120: /**
121: * Returns the initial master-report's resource manager. The resource manager can be used to load external resources
122: * in a system-independent way.
123: *
124: * @return the master-report's resourcemanager.
125: */
126: public ResourceManager getResourceManager();
127:
128: /**
129: * Returns the initial master-report's configuration. The initial configuration is used for all subreports.
130: *
131: * @return the global report configuration.
132: */
133: public Configuration getConfiguration();
134: }
|