MSWTextStyles Class Reference

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

`#include <MSWTextStyles.hxx>`

## Public Types

enum | ZoneType { TextZone, TextStructZone, StyleZone, InParagraphDefinition }

## Public Member Functions

| MSWTextStyles (MSWText &textParser)
| constructor More...
virtual | ~MSWTextStyles ()
| destructor More...
int | version () const
| returns the file version More...

## Protected Member Functions

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

## Static Protected Member Functions

static std::vector< int > | orderStyles (std::vector< int > const &previous)
| try to reorder the styles to find a good order More...

## Protected Attributes

MWAWParserStatePtr | m_parserState
| the parser state More...
shared_ptr < MSWTextStylesInternal::State > | m_state
| the state More...
MSWParser * | m_mainParser
| the main parser; More...
MSWText * | m_textParser
| the text parser; More...

## Private Member Functions

| MSWTextStyles (MSWTextStyles const &orig)
MSWTextStyles & | operator= (MSWTextStyles const &orig)

## Friends

class | MSWText

## Detailed Description

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

## Member Enumeration Documentation

enum MSWTextStyles::ZoneType

Enumerator
TextZone |
TextStructZone |
StyleZone |
InParagraphDefinition |

## Constructor & Destructor Documentation

MSWTextStyles::MSWTextStyles | ( | MSWText & | textParser | ) |

constructor

MSWTextStyles::~MSWTextStyles | ( |  | ) |

virtual

destructor

MSWTextStyles::MSWTextStyles | ( | MSWTextStyles const & | orig | ) |

private

## Member Function Documentation

MWAWFont const & MSWTextStyles::getDefaultFont | ( |  | ) | const

protected

returns the default font

bool MSWTextStyles::getFont | ( | ZoneType | type,
|  | int | id,
|  | MSWStruct::Font & | actFont
| ) |  |

protected

return a font corresponding to an index

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

protected

returns the style id to next style id map

bool MSWTextStyles::getParagraph | ( | ZoneType | type,
|  | int | id,
|  | MSWStruct::Paragraph & | para
| ) |  |

protected

return a paragraph corresponding to an index

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

bool MSWTextStyles::getSection | ( | ZoneType | type,
|  | int | id,
|  | MSWStruct::Section & | section
| ) |  |

protected

return a section corresponding to an index

Referenced by getSectionFont(), and getSectionParagraph().

bool MSWTextStyles::getSectionFont | ( | ZoneType | type,
|  | int | id,
|  | MSWStruct::Font & | font
| ) |  |

protected

return a font corresponding to the section

bool MSWTextStyles::getSectionParagraph | ( | ZoneType | type,
|  | int | id,
|  | MSWStruct::Paragraph & | para
| ) |  |

protected

return a paragraph corresponding to the section

MSWTextStyles& MSWTextStyles::operator= | ( | MSWTextStyles const & | orig | ) |

private

std::vector< int > MSWTextStyles::orderStyles | ( | std::vector< int > const & | previous | ) |

static protected

try to reorder the styles to find a good order

Referenced by readStyles().

bool MSWTextStyles::readFont | ( | MSWStruct::Font & | font,
|  | MSWTextStyles::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(), and readPLC().

bool MSWTextStyles::readParagraph | ( | MSWStruct::Paragraph & | para,
|  | int | dataSz = `-1`
| ) |  |

protected

try to read a paragraph

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

bool MSWTextStyles::readPLC | ( | MSWEntry & | entry,
|  | int | type,
|  | Vec2< long > const & | fileLimit
| ) |  |

protected

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

Referenced by readPLCList().

bool MSWTextStyles::readPLCList | ( | MSWEntry & | entry | ) |

protected

read the main char/paragraph plc list

int MSWTextStyles::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)

bool MSWTextStyles::readSection | ( | MSWEntry & | entry,
|  | std::vector< long > & | cLimits
| ) |  |

protected

read the text section

bool MSWTextStyles::readSection | ( | MSWStruct::Section & | section,
|  | long | pos
| ) |  |

protected

try to read the section data

bool MSWTextStyles::readStyles | ( | MSWEntry & | entry | ) |

protected

try to read the styles zone

bool MSWTextStyles::readStylesFont | ( | MSWEntry & | zone,
|  | int | N,
|  | std::vector< int > const & | previous,
|  | std::vector< int > const & | order
| ) |  |

protected

try to read the styles fonts

Referenced by readStyles().

bool MSWTextStyles::readStylesHierarchy | ( | MSWEntry & | entry,
|  | int | N,
|  | std::vector< int > & | orig
| ) |  |

protected

try to read the styles hierachy

Referenced by readStyles().

bool MSWTextStyles::readStylesNames | ( | MSWEntry const & | zone,
|  | int | N,
|  | int & | Nnamed
| ) |  |

protected

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

Referenced by readStyles().

bool MSWTextStyles::readStylesParagraph | ( | MSWEntry & | 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().

bool MSWTextStyles::readTextStructList | ( | MSWEntry & | entry | ) |

protected

read the paragraphs at the beginning of the text structure zone

void MSWTextStyles::sendDefaultParagraph | ( |  | ) |

protected

send a default paragraph

bool MSWTextStyles::sendSection | ( | int | id,
|  | int | textStructId
| ) |  |

protected

try to send a section

void MSWTextStyles::setProperty | ( | MSWStruct::Font const & | font | ) |

protected

Referenced by sendDefaultParagraph(), sendSection(), and setProperty().

void MSWTextStyles::setProperty | ( | MSWStruct::Paragraph const & | para,
|  | bool | recursifCall = `false`
| ) |  |

protected

send paragraph properties

void MSWTextStyles::setProperty | ( | MSWStruct::Section const & | sec | ) |

protected

send section properties

int MSWTextStyles::version | ( |  | ) | const

returns the file version

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

## Friends And Related Function Documentation

friend class MSWText

friend

## Member Data Documentation

MSWParser* MSWTextStyles::m_mainParser

protected

the main parser;

Referenced by readFont(), and setProperty().

MWAWParserStatePtr MSWTextStyles::m_parserState

protected

the parser state

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

shared_ptr<MSWTextStylesInternal::State> MSWTextStyles::m_state

protected

the state

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

MSWText* MSWTextStyles::m_textParser

protected

the text parser;

Referenced by readPLC(), and readSection().

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

- MSWTextStyles.hxx
- MSWTextStyles.cxx