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.

AFPEventProducer.java 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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.afp;
  19. import org.apache.fop.events.EventBroadcaster;
  20. import org.apache.fop.events.EventProducer;
  21. /**
  22. * Event producer interface for AFP-specific events.
  23. */
  24. public interface AFPEventProducer extends EventProducer {
  25. /** Provider class for the event producer. */
  26. static final class Provider {
  27. private Provider() {
  28. }
  29. /**
  30. * Returns an event producer.
  31. * @param broadcaster the event broadcaster to use
  32. * @return the event producer
  33. */
  34. public static AFPEventProducer get(EventBroadcaster broadcaster) {
  35. return broadcaster.getEventProducerFor(AFPEventProducer.class);
  36. }
  37. }
  38. /**
  39. * Warn about using default font setup.
  40. *
  41. * @param source the event source
  42. * @event.severity WARN
  43. */
  44. void warnDefaultFontSetup(Object source);
  45. /**
  46. * Warn about a missing default "any" font configuration.
  47. *
  48. * @param source the event source
  49. * @param style the font style
  50. * @param weight the font weight
  51. * @event.severity WARN
  52. */
  53. void warnMissingDefaultFont(Object source, String style, int weight);
  54. /**
  55. * A character set encoding error occurred.
  56. *
  57. * @param source the event source
  58. * @param charSetName the character set name
  59. * @param encoding the encoding
  60. * @event.severity ERROR
  61. */
  62. void characterSetEncodingError(Object source, String charSetName, String encoding);
  63. /**
  64. * Triggered when an external resource fails to be embedded.
  65. *
  66. * @param source the event source
  67. * @param resourceName the name of the resource where the error occurred
  68. * @param e the original exception
  69. * @event.severity ERROR
  70. */
  71. void resourceEmbeddingError(Object source, String resourceName, Exception e);
  72. /**
  73. * A mandatory font configuration node is missing at location.
  74. * @param source the event source
  75. * @param missingConfig the expected configuration element
  76. * @param location the position of the missing element within the config file.
  77. * @event.severity ERROR
  78. */
  79. void fontConfigMissing(Object source, String missingConfig, String location);
  80. /**
  81. * The character set given has an invalid name.
  82. * @param source the event source
  83. * @param msg the error message
  84. * @event.severity ERROR
  85. */
  86. void characterSetNameInvalid(Object source, String msg);
  87. /**
  88. * The code page for an AFP font could not be found.
  89. * @param source the event source
  90. * @param e the original exception
  91. * @event.severity ERROR
  92. */
  93. void codePageNotFound(Object source, Exception e);
  94. /**
  95. * This is a generic event for invalid configuration errors.
  96. * @param source the event source
  97. * @param e the original exception
  98. * @event.severity ERROR
  99. */
  100. void invalidConfiguration(Object source, Exception e);
  101. /**
  102. * The characterset is missing metric information for the specified character
  103. * @param source the event source
  104. * @param character the character with missing metric information.
  105. * @param charSet the character set containing missing metric information
  106. * @event.severity WARN
  107. */
  108. void charactersetMissingMetrics(Object source, char character, String charSet);
  109. /**
  110. * Double-byte fonts are not currently supported in SVG.
  111. * @param source the event source
  112. * @param fontFamily name of DB font
  113. * @event.severity WARN
  114. */
  115. void invalidDBFontInSVG(Object source, String fontFamily);
  116. }