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.

RenderingContext.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.render;
  19. import java.util.Map;
  20. import org.apache.fop.apps.FOUserAgent;
  21. /**
  22. * Implementations of this interface provide context information needed by supporting classes
  23. * during specific tasks (like image rendering).
  24. */
  25. public interface RenderingContext {
  26. /**
  27. * Returns the MIME type associated with the current output format.
  28. * @return the MIME type (ex. application/pdf)
  29. */
  30. String getMimeType();
  31. /**
  32. * Returns the user agent. The user agent is used to access configuration and other information
  33. * for the rendering process.
  34. * @return the user agent
  35. */
  36. FOUserAgent getUserAgent();
  37. /**
  38. * Adds additional hints to the existing hints, overriding existing hints.
  39. * @param additionalHints a map of additional hints
  40. */
  41. void putHints(Map additionalHints);
  42. /**
  43. * Sets an additional hint, overriding an existing hint.
  44. * @param key the key
  45. * @param value the value
  46. */
  47. void putHint(Object key, Object value);
  48. /**
  49. * Returns an unmodifiable representation of all hints.
  50. * @return the hints
  51. */
  52. Map getHints();
  53. /**
  54. * Returns a hint identified by a key.
  55. * @param key the key
  56. * @return the hint or null if no hint with the given key could be found
  57. */
  58. Object getHint(Object key);
  59. }