org.apache.poi.hslf.record

## Class StyleTextPropAtom

- java.lang.Object
- - org.apache.poi.hslf.record.Record
  - - org.apache.poi.hslf.record.RecordAtom
    - - org.apache.poi.hslf.record.StyleTextPropAtom

- All Implemented Interfaces:
    GenericRecord

      public final class StyleTextPropAtom
      extends RecordAtom

  A StyleTextPropAtom (type 4001). Holds basic character properties (bold, italic, underline, font size etc) and paragraph properties (alignment, line spacing etc) for the block of text (TextBytesAtom or TextCharsAtom) that this record follows. You will find two lists within this class. 1 - Paragraph style list (paragraphStyles) 2 - Character style list (charStyles) Both are lists of TextPropCollections. These define how many characters the style applies to, and what style elements make up the style (another list, this time of TextProps). Each TextProp has a value, which somehow encapsulates a property of the style

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `_type`

    - ### Fields inherited from class org.apache.poi.hslf.record.Record

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StyleTextPropAtom(byte[] source, int start, int len)` For the Text Style Properties (StyleTextProp) Atom
    `StyleTextPropAtom(int parentTextSize)` A new set of text style properties for some text without any.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TextPropCollection` | `addCharacterTextPropCollection(int charactersCovered)` Create a new Character TextPropCollection, and add it to the list
    `void` | `addCharacterTextPropCollection(TextPropCollection tpc)`
    `TextPropCollection` | `addParagraphTextPropCollection(int charactersCovered)` Create a new Paragraph TextPropCollection, and add it to the list
    `void` | `addParagraphTextPropCollection(TextPropCollection tpc)`
    `void` | `clearStyles()` Clear styles, so new collections can be added
    `java.util.List<TextPropCollection>` | `getCharacterStyles()`
    `int` | `getCharacterTextLengthCovered()` Returns how many characters the character's TextPropCollections cover.
    `java.util.Map<java.lang.String,java.util.function.Supplier<?>>` | `getGenericProperties()`
    `java.util.List<TextPropCollection>` | `getParagraphStyles()`
    `int` | `getParagraphTextLengthCovered()` Returns how many characters the paragraph's TextPropCollections cover.
    `long` | `getRecordType()` We are of type 4001
    `void` | `setCharacterStyles(java.util.List<TextPropCollection> cs)` Updates the link list of TextPropCollections which make up the character stylings
    `void` | `setParagraphStyles(java.util.List<TextPropCollection> ps)` Updates the link list of TextPropCollections which make up the paragraph stylings
    `void` | `setParentTextSize(int size)` Tell us how much text the parent TextCharsAtom or TextBytesAtom contains, so we can go ahead and initialise ourselves.
    `java.lang.String` | `toString()`
    `void` | `writeOut(java.io.OutputStream out)` Write the contents of the record back, so it can be written to disk

    - ### Methods inherited from class org.apache.poi.hslf.record.RecordAtom

      `getChildRecords, isAnAtom`

    - ### Methods inherited from class org.apache.poi.hslf.record.Record

      `buildRecordAtOffset, createRecordForType, findChildRecords, getGenericChildren, getGenericRecordType, writeLittleEndian, writeLittleEndian`

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

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

- - ### Field Detail

    - #### _type

          public static final long _type

  - ### Constructor Detail

    - #### StyleTextPropAtom

          public StyleTextPropAtom(byte[] source,
                                   int start,
                                   int len)

      For the Text Style Properties (StyleTextProp) Atom

    - #### StyleTextPropAtom

          public StyleTextPropAtom(int parentTextSize)

      A new set of text style properties for some text without any.

  - ### Method Detail

    - #### getParagraphStyles

          public java.util.List<TextPropCollection> getParagraphStyles()

    - #### setParagraphStyles

          public void setParagraphStyles(java.util.List<TextPropCollection> ps)

      Updates the link list of TextPropCollections which make up the paragraph stylings

    - #### getCharacterStyles

          public java.util.List<TextPropCollection> getCharacterStyles()

    - #### setCharacterStyles

          public void setCharacterStyles(java.util.List<TextPropCollection> cs)

      Updates the link list of TextPropCollections which make up the character stylings

    - #### getParagraphTextLengthCovered

          public int getParagraphTextLengthCovered()

      Returns how many characters the paragraph's TextPropCollections cover. (May be one or two more than the underlying text does, due to having extra characters meaning something special to powerpoint)

    - #### getCharacterTextLengthCovered

          public int getCharacterTextLengthCovered()

      Returns how many characters the character's TextPropCollections cover. (May be one or two more than the underlying text does, due to having extra characters meaning something special to powerpoint)

    - #### getRecordType

          public long getRecordType()

      We are of type 4001
      Specified by:
        `getRecordType` in class `Record`

    - #### writeOut

          public void writeOut(java.io.OutputStream out)
                        throws java.io.IOException

      Write the contents of the record back, so it can be written to disk
      Specified by:
        `writeOut` in class `Record`
      Throws:
        `java.io.IOException`

    - #### setParentTextSize

          public void setParentTextSize(int size)

      Tell us how much text the parent TextCharsAtom or TextBytesAtom contains, so we can go ahead and initialise ourselves.

    - #### clearStyles

          public void clearStyles()

      Clear styles, so new collections can be added

    - #### addParagraphTextPropCollection

          public TextPropCollection addParagraphTextPropCollection(int charactersCovered)

      Create a new Paragraph TextPropCollection, and add it to the list
      Parameters:
        `charactersCovered` - The number of characters this TextPropCollection will cover
      Returns:
        the new TextPropCollection, which will then be in the list

    - #### addParagraphTextPropCollection

          public void addParagraphTextPropCollection(TextPropCollection tpc)

    - #### addCharacterTextPropCollection

          public TextPropCollection addCharacterTextPropCollection(int charactersCovered)

      Create a new Character TextPropCollection, and add it to the list
      Parameters:
        `charactersCovered` - The number of characters this TextPropCollection will cover
      Returns:
        the new TextPropCollection, which will then be in the list

    - #### addCharacterTextPropCollection

          public void addCharacterTextPropCollection(TextPropCollection tpc)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the string representation of the record data

    - #### getGenericProperties

          public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.