Package com.independentsoft.office.odf

# Class TableOfContents

java.lang.Object
com.independentsoft.office.odf.TableOfContents

All Implemented Interfaces:
  `ICellContent`, `IContentElement`, `IIndexContent`, `ITextContent`, `IHeaderFooterContent`

public class TableOfContents extends Object implements ITextContent, IHeaderFooterContent
Represents a table of contents for a document.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TableOfContents()`
  Initializes a new instance of the MasterPage class.
  `TableOfContents​(InternalXMLStreamReader reader)`
  Instantiates a new table of contents.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TableOfContents`
  `clone()`
  Creates a new object that is a deep copy of the current instance.
  `List<IContentElement>`
  `getContentElements()`
  Returns all content elements.
  `IndexBody`
  `getIndexBody()`
  Gets the index.
  `String`
  `getName()`
  Gets the name.
  `IContentElement`
  `getParent()`
  Returns the parent content element.
  `String`
  `getProtectionKey()`
  Specifies that an authorization is required for removing the protection of a section.
  `TableOfContentsSource`
  `getSource()`
  Specifies how a table of contents is generated.
  `String`
  `getStyle()`
  Gets the style.
  `boolean`
  `isProtected()`
  Specifies whether a section is protected.
  `void`
  `setIndexBody​(IndexBody indexBody)`
  Sets the index.
  `void`
  `setName​(String name)`
  Sets the name.
  `void`
  `setParent​(IContentElement parent)`
  Sets the parent content element.
  `void`
  `setProtected​(boolean isProtected)`
  Specifies whether a section is protected.
  `void`
  `setProtectionKey​(String protectionKey)`
  Specifies that an authorization is required for removing the protection of a section.
  `void`
  `setSource​(TableOfContentsSource source)`
  Specifies how a table of contents is generated.
  `void`
  `setStyle​(String style)`
  Sets the style.
  `String`
  `toString()`
  Converts the value of the current TableOfContents object to its equivalent string representation.

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

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

- ## Constructor Details

  - ### TableOfContents

    public TableOfContents()
    Initializes a new instance of the MasterPage class.

  - ### TableOfContents

    public TableOfContents​(InternalXMLStreamReader reader) throws XMLStreamException
    Instantiates a new table of contents.
    Parameters:
      `reader` - the reader
    Throws:
      `XMLStreamException` - the xML stream exception

- ## Method Details

  - ### getContentElements

    public List<IContentElement> getContentElements()
    Returns all content elements.
    Specified by:
      `getContentElements` in interface `IContentElement`
    Returns:
      A collection of content elements.

  - ### getParent

    public IContentElement getParent()
    Returns the parent content element.
    Specified by:
      `getParent` in interface `IContentElement`
    Returns:
      the parent

  - ### setParent

    public void setParent​(IContentElement parent)
    Sets the parent content element.
    Specified by:
      `setParent` in interface `IContentElement`
    Parameters:
      `parent` - the new parent

  - ### clone

    public TableOfContents clone()
    Creates a new object that is a deep copy of the current instance.
    Specified by:
      `clone` in interface `ICellContent`
    Specified by:
      `clone` in interface `IContentElement`
    Specified by:
      `clone` in interface `IHeaderFooterContent`
    Specified by:
      `clone` in interface `IIndexContent`
    Specified by:
      `clone` in interface `ITextContent`
    Overrides:
      `clone` in class `Object`
    Returns:
      A new object that is a copy of this instance.

  - ### toString

    public String toString()
    Converts the value of the current TableOfContents object to its equivalent string representation.
    Overrides:
      `toString` in class `Object`
    Returns:
      the string

  - ### getSource

    public TableOfContentsSource getSource()
    Specifies how a table of contents is generated.
    Returns:
      the source

  - ### setSource

    public void setSource​(TableOfContentsSource source)
    Specifies how a table of contents is generated.
    Parameters:
      `source` - the new source

  - ### getIndexBody

    public IndexBody getIndexBody()
    Gets the index.
    Returns:
      the index body

  - ### setIndexBody

    public void setIndexBody​(IndexBody indexBody)
    Sets the index.
    Parameters:
      `indexBody` - the new index body

  - ### getName

    public String getName()
    Gets the name.
    Returns:
      the name

  - ### setName

    public void setName​(String name)
    Sets the name.
    Parameters:
      `name` - the new name

  - ### getStyle

    public String getStyle()
    Gets the style.
    Returns:
      the style

  - ### setStyle

    public void setStyle​(String style)
    Sets the style.
    Parameters:
      `style` - the new style

  - ### isProtected

    public boolean isProtected()
    Specifies whether a section is protected.
    Returns:
      true, if is protected

  - ### setProtected

    public void setProtected​(boolean isProtected)
    Specifies whether a section is protected.
    Parameters:
      `isProtected` - the new protected

  - ### getProtectionKey

    public String getProtectionKey()
    Specifies that an authorization is required for removing the protection of a section.
    Returns:
      the protection key

  - ### setProtectionKey

    public void setProtectionKey​(String protectionKey)
    Specifies that an authorization is required for removing the protection of a section.
    Parameters:
      `protectionKey` - the new protection key