You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FopFactoryConfig.java 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.apps;
  19. import java.net.URI;
  20. import java.util.Map;
  21. import java.util.Set;
  22. import org.apache.xmlgraphics.image.loader.ImageManager;
  23. import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
  24. import org.apache.xmlgraphics.io.ResourceResolver;
  25. import org.apache.fop.apps.io.InternalResourceResolver;
  26. import org.apache.fop.configuration.Configuration;
  27. import org.apache.fop.fonts.FontManager;
  28. import org.apache.fop.layoutmgr.LayoutManagerMaker;
  29. /**
  30. * The configuration data for a {@link FopFactory} instance.
  31. */
  32. // TODO: Make this interface and any implementations of this interface package private. Though
  33. // they are used by classes that are considered the public API, this object doesn't need to be a
  34. // part of the API. Why would a user care how the internal objects are passed around? They shouldn't.
  35. public interface FopFactoryConfig {
  36. /** Defines if FOP should use an alternative rule to determine text indents */
  37. boolean DEFAULT_BREAK_INDENT_INHERITANCE = false;
  38. /** Defines if FOP should validate the user config strictly */
  39. boolean DEFAULT_STRICT_USERCONFIG_VALIDATION = true;
  40. /** Defines if FOP should use strict validation for FO and user config */
  41. boolean DEFAULT_STRICT_FO_VALIDATION = true;
  42. /** Defines the default page-width */
  43. String DEFAULT_PAGE_WIDTH = "8.26in";
  44. /** Defines the default page-height */
  45. String DEFAULT_PAGE_HEIGHT = "11in";
  46. /** Defines the default source resolution (72dpi) for FOP */
  47. float DEFAULT_SOURCE_RESOLUTION = 72.0f; //dpi
  48. /** Defines the default target resolution (72dpi) for FOP */
  49. float DEFAULT_TARGET_RESOLUTION = 72.0f; //dpi
  50. /**
  51. * Whether accessibility features are switched on.
  52. *
  53. * @return true if accessibility features have been requested
  54. */
  55. boolean isAccessibilityEnabled();
  56. boolean isKeepEmptyTags();
  57. /**
  58. * Returns the overriding LayoutManagerMaker instance, if any.
  59. * @return the overriding LayoutManagerMaker or null
  60. */
  61. LayoutManagerMaker getLayoutManagerMakerOverride();
  62. /**
  63. * The URI resolver used through-out FOP for controlling all file access.
  64. *
  65. * @return the URI resolver
  66. */
  67. ResourceResolver getResourceResolver();
  68. /**
  69. * The base URI from which URIs are resolved against.
  70. *
  71. * @return the base URI
  72. */
  73. URI getBaseURI();
  74. /**
  75. * Returns whether FOP is strictly validating input XSL
  76. * @return true of strict validation turned on, false otherwise
  77. */
  78. boolean validateStrictly();
  79. /**
  80. * Is the user configuration to be validated?
  81. * @return if the user configuration should be validated
  82. */
  83. boolean validateUserConfigStrictly();
  84. /**
  85. * @return true if the indent inheritance should be broken when crossing reference area
  86. * boundaries (for more info, see the javadoc for the relative member variable)
  87. */
  88. boolean isBreakIndentInheritanceOnReferenceAreaBoundary();
  89. /** @return the resolution for resolution-dependent input */
  90. float getSourceResolution();
  91. /** @return the resolution for resolution-dependent output */
  92. float getTargetResolution();
  93. /**
  94. * Gets the default page-height to use as fallback,
  95. * in case page-height="auto"
  96. *
  97. * @return the page-height, as a String
  98. */
  99. String getPageHeight();
  100. /**
  101. * Gets the default page-width to use as fallback,
  102. * in case page-width="auto"
  103. *
  104. * @return the page-width, as a String
  105. */
  106. String getPageWidth();
  107. /** @return the set of namespaces that are ignored by FOP */
  108. Set<String> getIgnoredNamespaces();
  109. /**
  110. * Indicates whether a namespace URI is on the ignored list.
  111. * @param namespace the namespace URI
  112. * @return true if the namespace is ignored by FOP
  113. */
  114. boolean isNamespaceIgnored(String namespace);
  115. /**
  116. * Returns the Avalon {@link Configuration} object.
  117. *
  118. * @return the Avalon config object
  119. */
  120. Configuration getUserConfig();
  121. /** @see org.apache.fop.render.RendererFactory#isRendererPreferred() */
  122. boolean preferRenderer();
  123. /**
  124. * Returns the font manager.
  125. * @return the font manager
  126. */
  127. FontManager getFontManager();
  128. /**
  129. * Returns the image manager.
  130. * @return the image manager
  131. */
  132. ImageManager getImageManager();
  133. boolean isComplexScriptFeaturesEnabled();
  134. /** @return the hyphenation pattern names */
  135. Map<String, String> getHyphenationPatternNames();
  136. InternalResourceResolver getHyphenationResourceResolver();
  137. /**
  138. * Controls the mechanisms that are used in the event that {@link javax.xml.transform.Source}
  139. * used for resources couldn't be read.
  140. * @return the fallback resolver
  141. */
  142. FallbackResolver getFallbackResolver();
  143. }