home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / VCAFE.3.0A / JFC.bin / RTFAttribute.java < prev    next >
Text File  |  1998-06-30  |  2KB  |  63 lines

  1. /*
  2.  * @(#)RTFAttribute.java    1.2 97/12/16
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20. package com.sun.java.swing.text.rtf;
  21.  
  22. import com.sun.java.swing.text.AttributeSet;
  23. import com.sun.java.swing.text.MutableAttributeSet;
  24. import java.io.IOException;
  25.  
  26. /** 
  27.  * This interface describes a class which defines a 1-1 mapping between
  28.  * an RTF keyword and a SwingText attribute.
  29.  */
  30. interface RTFAttribute
  31. {
  32.     static final int D_CHARACTER = 0;
  33.     static final int D_PARAGRAPH = 1;
  34.     static final int D_SECTION = 2;
  35.     static final int D_DOCUMENT = 3;
  36.     static final int D_META = 4;
  37.  
  38.     /* These next three should really be public variables,
  39.        but you can't declare public variables in an interface... */
  40.     /* int domain; */
  41.     public int domain();
  42.     /* String swingName; */
  43.     public Object swingName();
  44.     /* String rtfName; */
  45.     public String rtfName();
  46.  
  47.     public boolean set(MutableAttributeSet target);
  48.     public boolean set(MutableAttributeSet target, int parameter);
  49.  
  50.     public boolean setDefault(MutableAttributeSet target);
  51.  
  52.     /* TODO: This method is poorly thought out */
  53.     public boolean write(AttributeSet source,
  54.                  RTFGenerator target,
  55.              boolean force)
  56.         throws IOException;
  57.  
  58.     public boolean writeValue(Object value,
  59.                   RTFGenerator target,
  60.                   boolean force)
  61.         throws IOException;
  62. }
  63.