com.lowagie.text.rtf.document

## Class RtfProtectionSetting

- java.lang.Object
- - com.lowagie.text.rtf.RtfElement
  - - com.lowagie.text.rtf.document.RtfProtectionSetting

- All Implemented Interfaces:
    RtfBasicElement, RtfElementInterface

      public class RtfProtectionSetting
      extends RtfElement

  The RtfProtectionSetting handles document protection elements
  Since:
    2.1.1
  Version:
    $Id$
  Author:
    Howard Shank (hgshank@yahoo.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static byte[]` | `ANNOTPROT` Constant for Annotation/Comment protection controlword Mutually exclusive
    `private static byte[]` | `ENFORCEPROT` Constant for enforceprot controlword
    `private static byte[]` | `FORMPROT` Constant for Form protection controlword Mutually exclusive
    `private static byte[]` | `PROTLEVEL` Constant for protlevel controlword
    `private static byte[]` | `READONLYRECOMMENDED` Constant for enforceprot controlword.
    `private static byte[]` | `READPROT` Constant for read only rotection controlword Mutually exclusive - exception, can be combined with ANNOTPROT for backwards compatibility
    `private static byte[]` | `REVPROT` Constant for Revision protection controlword Mutually exclusive

    - ### Fields inherited from class com.lowagie.text.rtf.RtfElement

      `document, inHeader, inTable`

    - ### Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement

      `CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RtfProtectionSetting(RtfDocument doc)` Constructs a `RtfProtectionSetting` belonging to a RtfDocument

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `writeContent(java.io.OutputStream result)` Writes the RTF protection control words
    `void` | `writeDefinition(java.io.OutputStream result)` Writes the RTF protection control words

    - ### Methods inherited from class com.lowagie.text.rtf.RtfElement

      `intToByteArray, isInTable, setInHeader, setInTable, setRtfDocument`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### FORMPROT

          private static final byte[] FORMPROT

      Constant for Form protection controlword Mutually exclusive
      Since:
        2.1.1
      See Also:
        `REVPROT`, `ANNOTPROT`, `READPROT`

    - #### REVPROT

          private static final byte[] REVPROT

      Constant for Revision protection controlword Mutually exclusive
      Since:
        2.1.1
      See Also:
        `FORMPROT`, `ANNOTPROT`, `READPROT`

    - #### ANNOTPROT

          private static final byte[] ANNOTPROT

      Constant for Annotation/Comment protection controlword Mutually exclusive
      Since:
        2.1.1
      See Also:
        `FORMPROT`, `REVPROT`, `READPROT`

    - #### READPROT

          private static final byte[] READPROT

      Constant for read only rotection controlword Mutually exclusive - exception, can be combined with ANNOTPROT for backwards compatibility
      Since:
        2.1.1
      See Also:
        `FORMPROT`, `REVPROT`, `ANNOTPROT`

    - #### PROTLEVEL

          private static final byte[] PROTLEVEL

      Constant for protlevel controlword
      Since:
        2.1.1

    - #### ENFORCEPROT

          private static final byte[] ENFORCEPROT

      Constant for enforceprot controlword
      Since:
        2.1.1

    - #### READONLYRECOMMENDED

          private static final byte[] READONLYRECOMMENDED

      Constant for enforceprot controlword. Implemented in Microsoft Word 2007.
      Since:
        2.1.1

  - ### Constructor Detail

    - #### RtfProtectionSetting

          public RtfProtectionSetting(RtfDocument doc)

      Constructs a `RtfProtectionSetting` belonging to a RtfDocument
      Parameters:
        `doc` - The `RtfDocument` this `RtfProtectionSetting` belongs to
      Since:
        2.1.1

  - ### Method Detail

    - #### writeContent

          public void writeContent(java.io.OutputStream result)
                            throws java.io.IOException

      Writes the RTF protection control words
      Specified by:
        `writeContent` in interface `RtfBasicElement`
      Specified by:
        `writeContent` in class `RtfElement`
      Parameters:
        `result` - The `OutputStream` to write the content to
      Throws:
        `java.io.IOException`
      Since:
        2.1.1

    - #### writeDefinition

          public void writeDefinition(java.io.OutputStream result)
                               throws java.io.IOException

      Writes the RTF protection control words
      Throws:
        `java.io.IOException`
      Since:
        2.1.1