1. /*
  2. * @(#)RTFAttribute.java 1.10 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.text.rtf;
  8. import javax.swing.text.AttributeSet;
  9. import javax.swing.text.MutableAttributeSet;
  10. import java.io.IOException;
  11. /**
  12. * This interface describes a class which defines a 1-1 mapping between
  13. * an RTF keyword and a SwingText attribute.
  14. */
  15. interface RTFAttribute
  16. {
  17. static final int D_CHARACTER = 0;
  18. static final int D_PARAGRAPH = 1;
  19. static final int D_SECTION = 2;
  20. static final int D_DOCUMENT = 3;
  21. static final int D_META = 4;
  22. /* These next three should really be public variables,
  23. but you can't declare public variables in an interface... */
  24. /* int domain; */
  25. public int domain();
  26. /* String swingName; */
  27. public Object swingName();
  28. /* String rtfName; */
  29. public String rtfName();
  30. public boolean set(MutableAttributeSet target);
  31. public boolean set(MutableAttributeSet target, int parameter);
  32. public boolean setDefault(MutableAttributeSet target);
  33. /* TODO: This method is poorly thought out */
  34. public boolean write(AttributeSet source,
  35. RTFGenerator target,
  36. boolean force)
  37. throws IOException;
  38. public boolean writeValue(Object value,
  39. RTFGenerator target,
  40. boolean force)
  41. throws IOException;
  42. }