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