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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. /**
  57. * Returns the overriding LayoutManagerMaker instance, if any.
  58. * @return the overriding LayoutManagerMaker or null
  59. */
  60. LayoutManagerMaker getLayoutManagerMakerOverride();
  61. /**
  62. * The URI resolver used through-out FOP for controlling all file access.
  63. *
  64. * @return the URI resolver
  65. */
  66. ResourceResolver getResourceResolver();
  67. /**
  68. * The base URI from which URIs are resolved against.
  69. *
  70. * @return the base URI
  71. */
  72. URI getBaseURI();
  73. /**
  74. * Returns whether FOP is strictly validating input XSL
  75. * @return true of strict validation turned on, false otherwise
  76. */
  77. boolean validateStrictly();
  78. /**
  79. * Is the user configuration to be validated?
  80. * @return if the user configuration should be validated
  81. */
  82. boolean validateUserConfigStrictly();
  83. /**
  84. * @return true if the indent inheritance should be broken when crossing reference area
  85. * boundaries (for more info, see the javadoc for the relative member variable)
  86. */
  87. boolean isBreakIndentInheritanceOnReferenceAreaBoundary();
  88. /** @return the resolution for resolution-dependent input */
  89. float getSourceResolution();
  90. /** @return the resolution for resolution-dependent output */
  91. float getTargetResolution();
  92. /**
  93. * Gets the default page-height to use as fallback,
  94. * in case page-height="auto"
  95. *
  96. * @return the page-height, as a String
  97. */
  98. String getPageHeight();
  99. /**
  100. * Gets the default page-width to use as fallback,
  101. * in case page-width="auto"
  102. *
  103. * @return the page-width, as a String
  104. */
  105. String getPageWidth();
  106. /** @return the set of namespaces that are ignored by FOP */
  107. Set<String> getIgnoredNamespaces();
  108. /**
  109. * Indicates whether a namespace URI is on the ignored list.
  110. * @param namespace the namespace URI
  111. * @return true if the namespace is ignored by FOP
  112. */
  113. boolean isNamespaceIgnored(String namespace);
  114. /**
  115. * Returns the Avalon {@link Configuration} object.
  116. *
  117. * @return the Avalon config object
  118. */
  119. Configuration getUserConfig();
  120. /** @see org.apache.fop.render.RendererFactory#isRendererPreferred() */
  121. boolean preferRenderer();
  122. /**
  123. * Returns the font manager.
  124. * @return the font manager
  125. */
  126. FontManager getFontManager();
  127. /**
  128. * Returns the image manager.
  129. * @return the image manager
  130. */
  131. ImageManager getImageManager();
  132. boolean isComplexScriptFeaturesEnabled();
  133. /** @return the hyphenation pattern names */
  134. Map<String, String> getHyphenationPatternNames();
  135. InternalResourceResolver getHyphenationResourceResolver();
  136. /**
  137. * Controls the mechanisms that are used in the event that {@link javax.xml.transform.Source}
  138. * used for resources couldn't be read.
  139. * @return the fallback resolver
  140. */
  141. FallbackResolver getFallbackResolver();
  142. }