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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.avalon.framework.configuration.Configuration;
  23. import org.apache.xmlgraphics.image.loader.ImageManager;
  24. import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
  25. import org.apache.xmlgraphics.io.ResourceResolver;
  26. import org.apache.fop.fonts.FontManager;
  27. import org.apache.fop.layoutmgr.LayoutManagerMaker;
  28. /**
  29. * The configuration data for a {@link FopFactory} instance.
  30. */
  31. // TODO: Make this interface and any implementations of this interface package private. Though
  32. // they are used by classes that are considered the public API, this object doesn't need to be a
  33. // part of the API. Why would a user care how the internal objects are passed around? They shouldn't.
  34. public interface FopFactoryConfig {
  35. /** Defines if FOP should use an alternative rule to determine text indents */
  36. boolean DEFAULT_BREAK_INDENT_INHERITANCE = false;
  37. /** Defines if FOP should validate the user config strictly */
  38. boolean DEFAULT_STRICT_USERCONFIG_VALIDATION = true;
  39. /** Defines if FOP should use strict validation for FO and user config */
  40. boolean DEFAULT_STRICT_FO_VALIDATION = true;
  41. /** Defines the default page-width */
  42. String DEFAULT_PAGE_WIDTH = "8.26in";
  43. /** Defines the default page-height */
  44. String DEFAULT_PAGE_HEIGHT = "11in";
  45. /** Defines the default source resolution (72dpi) for FOP */
  46. float DEFAULT_SOURCE_RESOLUTION = 72.0f; //dpi
  47. /** Defines the default target resolution (72dpi) for FOP */
  48. float DEFAULT_TARGET_RESOLUTION = 72.0f; //dpi
  49. /**
  50. * Whether accessibility features are switched on.
  51. *
  52. * @return true if accessibility features have been requested
  53. */
  54. boolean isAccessibilityEnabled();
  55. /**
  56. * Returns the overriding LayoutManagerMaker instance, if any.
  57. * @return the overriding LayoutManagerMaker or null
  58. */
  59. LayoutManagerMaker getLayoutManagerMakerOverride();
  60. /**
  61. * The URI resolver used through-out FOP for controlling all file access.
  62. *
  63. * @return the URI resolver
  64. */
  65. ResourceResolver getResourceResolver();
  66. /**
  67. * The base URI from which URIs are resolved against.
  68. *
  69. * @return the base URI
  70. */
  71. URI getBaseURI();
  72. /**
  73. * Returns whether FOP is strictly validating input XSL
  74. * @return true of strict validation turned on, false otherwise
  75. */
  76. boolean validateStrictly();
  77. /**
  78. * Is the user configuration to be validated?
  79. * @return if the user configuration should be validated
  80. */
  81. boolean validateUserConfigStrictly();
  82. /**
  83. * @return true if the indent inheritance should be broken when crossing reference area
  84. * boundaries (for more info, see the javadoc for the relative member variable)
  85. */
  86. boolean isBreakIndentInheritanceOnReferenceAreaBoundary();
  87. /** @return the resolution for resolution-dependent input */
  88. float getSourceResolution();
  89. /** @return the resolution for resolution-dependent output */
  90. float getTargetResolution();
  91. /**
  92. * Gets the default page-height to use as fallback,
  93. * in case page-height="auto"
  94. *
  95. * @return the page-height, as a String
  96. */
  97. String getPageHeight();
  98. /**
  99. * Gets the default page-width to use as fallback,
  100. * in case page-width="auto"
  101. *
  102. * @return the page-width, as a String
  103. */
  104. String getPageWidth();
  105. /** @return the set of namespaces that are ignored by FOP */
  106. Set<String> getIgnoredNamespaces();
  107. /**
  108. * Indicates whether a namespace URI is on the ignored list.
  109. * @param namespace the namespace URI
  110. * @return true if the namespace is ignored by FOP
  111. */
  112. boolean isNamespaceIgnored(String namespace);
  113. /**
  114. * Returns the Avalon {@link Configuration} object.
  115. *
  116. * @return the Avalon config object
  117. */
  118. Configuration getUserConfig();
  119. /** @see org.apache.fop.render.RendererFactory#isRendererPreferred() */
  120. boolean preferRenderer();
  121. /**
  122. * Returns the font manager.
  123. * @return the font manager
  124. */
  125. FontManager getFontManager();
  126. /**
  127. * Returns the image manager.
  128. * @return the image manager
  129. */
  130. ImageManager getImageManager();
  131. boolean isComplexScriptFeaturesEnabled();
  132. /** @return the hyphenation pattern names */
  133. Map<String, String> getHyphenationPatternNames();
  134. /**
  135. * Controls the mechanisms that are used in the event that {@link javax.xml.transform.Source}
  136. * used for resources couldn't be read.
  137. * @return the fallback resolver
  138. */
  139. FallbackResolver getFallbackResolver();
  140. }