MsWrdTextStyles Class Reference

the main class to read/store the text font, paragraph, section stylesread More...

`#include <MsWrdTextStyles.hxx>`

## Public Types
enum | ZoneType { TextZone , TextStructZone , StyleZone , InParagraphDefinition }

## Public Member Functions
| MsWrdTextStyles (MsWrdText &textParser)
| constructor
virtual | ~MsWrdTextStyles ()
| destructor
int | version () const
| returns the file version

## Protected Member Functions
MWAWFont const & | getDefaultFont () const
| returns the default font
bool | getFont (ZoneType type, int id, MsWrdStruct::Font &actFont)
| return a font corresponding to an index
void | setProperty (MsWrdStruct::Font const &font)
bool | readFont (MsWrdStruct::Font &font, ZoneType type)
| try to read a font.
bool | getParagraph (ZoneType type, int id, MsWrdStruct::Paragraph &para)
| return a paragraph corresponding to an index
bool | readParagraph (MsWrdStruct::Paragraph &para, int dataSz=-1)
| try to read a paragraph
void | sendDefaultParagraph ()
| send a default paragraph
bool | readPLCList (MsWrdEntry const &entry)
| read the main char/paragraph plc list
bool | readTextStructList (MsWrdEntry &entry)
| read the paragraphs at the beginning of the text structure zone
int | readPropertyModifier (bool &complex, std::string &extra)
| read the property modifier (2 bytes last bytes of text struct ).
bool | readPLC (MsWrdEntry &entry, int type, MWAWVec2< long > const &fileLimit)
| read the char/paragraph plc : type=0: char, type=1: parag
bool | getSection (ZoneType type, int id, MsWrdStruct::Section &section)
| return a section corresponding to an index
bool | getSectionParagraph (ZoneType type, int id, MsWrdStruct::Paragraph &para)
| return a paragraph corresponding to the section
bool | getSectionFont (ZoneType type, int id, MsWrdStruct::Font &font)
| return a font corresponding to the section
bool | readSection (MsWrdEntry &entry, std::vector< long > &cLimits)
| read the text section
bool | sendSection (int id, int textStructId)
| try to send a section
bool | readSection (MsWrdStruct::Section &section, long pos)
| try to read the section data
void | setProperty (MsWrdStruct::Section const &sec)
| send section properties
bool | readStyles (MsWrdEntry &entry)
| try to read the styles zone
bool | readStylesHierarchy (MsWrdEntry &entry, int N, std::vector< int > &orig)
| try to read the styles hierachy
bool | readStylesNames (MsWrdEntry const &zone, int N, int &Nnamed)
| try to read the styles names and fill the number of "named" styles...
bool | readStylesFont (MsWrdEntry &zone, int N, std::vector< int > const &previous, std::vector< int > const &order)
| try to read the styles fonts
bool | readStylesParagraph (MsWrdEntry &zone, int N, std::vector< int > const &previous, std::vector< int > const &order)
| try to read the styles fonts
std::map< int, int > const & | getNextStyleMap () const
| returns the style id to next style id map

## Static Protected Member Functions
static std::vector< int > | orderStyles (std::vector< int > const &previous)
| try to reorder the styles to find a good order

## Protected Attributes
MWAWParserStatePtr | m_parserState
| the parser state
std::shared_ptr< MsWrdTextStylesInternal::State > | m_state
| the state
MsWrdParser * | m_mainParser
| the main parser;
MsWrdText * | m_textParser
| the text parser;

## Private Member Functions
| MsWrdTextStyles (MsWrdTextStyles const &orig)=delete
MsWrdTextStyles & | operator= (MsWrdTextStyles const &orig)=delete

## Friends
class | MsWrdText

## Detailed Description

the main class to read/store the text font, paragraph, section stylesread

## Member Enumeration Documentation

## ◆ ZoneType

enum MsWrdTextStyles::ZoneType

Enumerator
TextZone |
TextStructZone |
StyleZone |
InParagraphDefinition |

## Constructor & Destructor Documentation

## ◆ MsWrdTextStyles() [1/2]

MsWrdTextStyles::MsWrdTextStyles | ( | MsWrdText & | textParser | ) |
| explicit

constructor

Referenced by MsWrdTextStyles(), and operator=().

## ◆ ~MsWrdTextStyles()

MsWrdTextStyles::~MsWrdTextStyles | ( |  | ) |
| virtual

destructor

## ◆ MsWrdTextStyles() [2/2]

MsWrdTextStyles::MsWrdTextStyles | ( | MsWrdTextStyles const & | orig | ) |
| private delete

## Member Function Documentation

## ◆ getDefaultFont()

MWAWFont const & MsWrdTextStyles::getDefaultFont | ( |  | ) | const
| protected

returns the default font

## ◆ getFont()

bool MsWrdTextStyles::getFont | ( | ZoneType | type,
|  | int | id,
|  | MsWrdStruct::Font & | actFont )
| protected

return a font corresponding to an index

## ◆ getNextStyleMap()

std::map< int, int > const & MsWrdTextStyles::getNextStyleMap | ( |  | ) | const
| protected

returns the style id to next style id map

## ◆ getParagraph()

bool MsWrdTextStyles::getParagraph | ( | ZoneType | type,
|  | int | id,
|  | MsWrdStruct::Paragraph & | para )
| protected

return a paragraph corresponding to an index

Referenced by getSectionFont(), getSectionParagraph(), and sendSection().

## ◆ getSection()

bool MsWrdTextStyles::getSection | ( | ZoneType | type,
|  | int | id,
|  | MsWrdStruct::Section & | section )
| protected

return a section corresponding to an index

Referenced by getSectionFont(), and getSectionParagraph().

## ◆ getSectionFont()

bool MsWrdTextStyles::getSectionFont | ( | ZoneType | type,
|  | int | id,
|  | MsWrdStruct::Font & | font )
| protected

return a font corresponding to the section

## ◆ getSectionParagraph()

bool MsWrdTextStyles::getSectionParagraph | ( | ZoneType | type,
|  | int | id,
|  | MsWrdStruct::Paragraph & | para )
| protected

return a paragraph corresponding to the section

## ◆ operator=()

MsWrdTextStyles & MsWrdTextStyles::operator= | ( | MsWrdTextStyles const & | orig | ) |
| private delete

## ◆ orderStyles()

std::vector< int > MsWrdTextStyles::orderStyles | ( | std::vector< int > const & | previous | ) |
| static protected

try to reorder the styles to find a good order

Referenced by readStyles().

## ◆ readFont()

bool MsWrdTextStyles::readFont | ( | MsWrdStruct::Font & | font,
|  | MsWrdTextStyles::ZoneType | type )
| protected

try to read a font.

Parameters

  font | : the read font,
  type | : the zone in which the font is read

Referenced by readParagraph(), readPLC(), and readStylesFont().

## ◆ readParagraph()

bool MsWrdTextStyles::readParagraph | ( | MsWrdStruct::Paragraph & | para,
|  | int | dataSz = -1 )
| protected

try to read a paragraph

Referenced by readPLC(), readPropertyModifier(), readStylesParagraph(), and readTextStructList().

## ◆ readPLC()

bool MsWrdTextStyles::readPLC | ( | MsWrdEntry & | entry,
|  | int | type,
|  | MWAWVec2< long > const & | fileLimit )
| protected

read the char/paragraph plc : type=0: char, type=1: parag

Referenced by readPLC(), and readPLCList().

## ◆ readPLCList()

bool MsWrdTextStyles::readPLCList | ( | MsWrdEntry const & | entry | ) |
| protected

read the main char/paragraph plc list

## ◆ readPropertyModifier()

int MsWrdTextStyles::readPropertyModifier | ( | bool & | complex,
|  | std::string & | extra )
| protected

read the property modifier (2 bytes last bytes of text struct ).

Returns a textstruct parag id or -1 (PRM)

## ◆ readSection() [1/2]

bool MsWrdTextStyles::readSection | ( | MsWrdEntry & | entry,
|  | std::vector< long > & | cLimits )
| protected

read the text section

Referenced by readSection().

## ◆ readSection() [2/2]

bool MsWrdTextStyles::readSection | ( | MsWrdStruct::Section & | section,
|  | long | pos )
| protected

try to read the section data

## ◆ readStyles()

bool MsWrdTextStyles::readStyles | ( | MsWrdEntry & | entry | ) |
| protected

try to read the styles zone

## ◆ readStylesFont()

bool MsWrdTextStyles::readStylesFont | ( | MsWrdEntry & | zone,
|  | int | N,
|  | std::vector< int > const & | previous,
|  | std::vector< int > const & | order )
| protected

try to read the styles fonts

Referenced by readStyles().

## ◆ readStylesHierarchy()

bool MsWrdTextStyles::readStylesHierarchy | ( | MsWrdEntry & | entry,
|  | int | N,
|  | std::vector< int > & | orig )
| protected

try to read the styles hierachy

Referenced by readStyles().

## ◆ readStylesNames()

bool MsWrdTextStyles::readStylesNames | ( | MsWrdEntry const & | zone,
|  | int | N,
|  | int & | Nnamed )
| protected

try to read the styles names and fill the number of "named" styles...

Referenced by readStyles().

## ◆ readStylesParagraph()

bool MsWrdTextStyles::readStylesParagraph | ( | MsWrdEntry & | zone,
|  | int | N,
|  | std::vector< int > const & | previous,
|  | std::vector< int > const & | order )
| protected

try to read the styles fonts

osnola: update the font style here or after reading data ?

Referenced by readStyles().

## ◆ readTextStructList()

bool MsWrdTextStyles::readTextStructList | ( | MsWrdEntry & | entry | ) |
| protected

read the paragraphs at the beginning of the text structure zone

## ◆ sendDefaultParagraph()

void MsWrdTextStyles::sendDefaultParagraph | ( |  | ) |
| protected

send a default paragraph

## ◆ sendSection()

bool MsWrdTextStyles::sendSection | ( | int | id,
|  | int | textStructId )
| protected

try to send a section

## ◆ setProperty() [1/2]

void MsWrdTextStyles::setProperty | ( | MsWrdStruct::Font const & | font | ) |
| protected

Referenced by sendSection().

## ◆ setProperty() [2/2]

void MsWrdTextStyles::setProperty | ( | MsWrdStruct::Section const & | sec | ) |
| protected

send section properties

## ◆ version()

int MsWrdTextStyles::version | ( |  | ) | const

returns the file version

Referenced by getSectionFont(), readParagraph(), readPLC(), readPLCList(), readPropertyModifier(), readSection(), readStylesParagraph(), readTextStructList(), sendDefaultParagraph(), and sendSection().

## Friends And Related Symbol Documentation

## ◆ MsWrdText

friend class MsWrdText
| friend

Referenced by MsWrdText, and MsWrdTextStyles().

## Member Data Documentation

## ◆ m_mainParser

MsWrdParser* MsWrdTextStyles::m_mainParser
| protected

the main parser;

Referenced by MsWrdTextStyles(), readFont(), and setProperty().

## ◆ m_parserState

MWAWParserStatePtr MsWrdTextStyles::m_parserState
| protected

the parser state

Referenced by MsWrdTextStyles(), readFont(), readParagraph(), readPLC(), readPLCList(), readPropertyModifier(), readSection(), readSection(), readStyles(), readStylesFont(), readStylesHierarchy(), readStylesNames(), readStylesParagraph(), readTextStructList(), sendDefaultParagraph(), sendSection(), setProperty(), setProperty(), and version().

## ◆ m_state

std::shared_ptr<MsWrdTextStylesInternal::State> MsWrdTextStyles::m_state
| protected

the state

Referenced by getDefaultFont(), getFont(), getNextStyleMap(), getParagraph(), getSection(), MsWrdTextStyles(), readPLC(), readPropertyModifier(), readSection(), readStyles(), readStylesFont(), readStylesHierarchy(), readStylesParagraph(), readTextStructList(), sendSection(), setProperty(), and version().

## ◆ m_textParser

MsWrdText* MsWrdTextStyles::m_textParser
| protected

the text parser;

Referenced by MsWrdTextStyles(), readPLC(), and readSection().

The documentation for this class was generated from the following files:

- MsWrdTextStyles.hxx
- MsWrdTextStyles.cxx