MacWrtProStructures.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 
34 #ifndef MAC_WRT_PRO_STRUCTURES
35 # define MAC_WRT_PRO_STRUCTURES
36 
37 #include <list>
38 #include <string>
39 #include <vector>
40 
41 #include "MWAWPosition.hxx"
42 
43 #include "MWAWEntry.hxx"
44 
45 #include "MWAWDebug.hxx"
46 #include "MWAWInputStream.hxx"
47 
48 class MacWrtProParser;
49 
51 {
52 class SubDocument;
53 }
54 
56 {
57 struct Block;
58 struct Cell;
59 struct Font;
60 struct Paragraph;
61 struct Section;
62 struct State;
63 class SubDocument;
64 }
65 
67 
71 {
72 public:
74  MacWrtProStructuresListenerState(std::shared_ptr<MacWrtProStructures> const &structures, bool mainZone, int version);
77 
79  bool isSent(int blockId);
81  bool send(int blockId);
82 
84  void sendSection(int numSection);
86  bool sendFont(int id);
88  bool sendParagraph(int id);
90  void sendChar(char c);
91 
93  bool resendAll();
94 
96  int numSection() const
97  {
98  if (!m_isMainZone) {
99  MWAW_DEBUG_MSG(("MacWrtProStructuresListenerState::numSection: not called in main zone\n"));
100  return 0;
101  }
102  return m_section;
103  }
104 
106  std::vector<int> getPageBreaksPos() const;
108  void insertSoftPageBreak();
109 
111  std::string getFontDebugString(int fontId);
112 
114  std::string getParagraphDebugString(int paraId);
115 
116 protected:
118  bool newPage(bool softBreak=false);
119 
124 
125  // true if this is the mainZone
127  // the file version
129  // the actual page
131  // the actual tab
132  int m_actTab;
133  // the number of tab
134  int m_numTab;
135  // the actual section ( if mainZone )
137  // the actual number of columns
139  // a flag to know if a new page has just been open
141  // the main structure parser
142  std::shared_ptr<MacWrtProStructures> m_structures;
143  // the current font
144  std::shared_ptr<MacWrtProStructuresInternal::Font> m_font;
145  // the current paragraph
146  std::shared_ptr<MacWrtProStructuresInternal::Paragraph> m_paragraph;
147 };
148 
155 {
156  friend class MacWrtProParser;
160 public:
162  explicit MacWrtProStructures(MacWrtProParser &mainParser);
164  virtual ~MacWrtProStructures();
165 
169  int version() const;
170 
172  void setAsciiName(char const *name)
173  {
174  m_asciiName = name;
175  }
176 
177 protected:
179  void init();
180 
182  bool createZones();
183 
188  bool createZonesV2();
189 
191  int numPages() const;
192 
194  bool sendMainZone();
195 
197  void updatePageSpan(int page, bool hasTitlePage, MWAWPageSpan &pageSpan);
198 
200  void flushExtra();
201 
203  void buildPageStructures();
204 
206  void buildTableStructures();
207 
208  //
209  // low level
210  //
211 
213  bool readStyles();
214 
216  bool readStyle(int styleId);
217 
219  bool readCharStyles();
220 
222  bool readParagraphs();
223 
226 
228  std::shared_ptr<MacWrtProStructuresInternal::Block> readBlock();
229 
231  std::shared_ptr<MacWrtProStructuresInternal::Block> readBlockV2(int id);
232 
234  bool readBlocksList();
235 
237  bool readFontsName();
238 
240  bool readFontsDef();
241 
244 
246  bool readSections(std::vector<MacWrtProStructuresInternal::Section> &sections);
247 
249  bool readSelection();
250 
252  bool readStructB();
253 
255  static bool readString(MWAWInputStreamPtr input, std::string &res);
256 
258  bool getColor(int colId, MWAWColor &color) const;
259 
261  bool getPattern(int patId, float &patternPercent) const;
262 
264  bool getColor(int colId, int patId, MWAWColor &color) const;
265 
267  bool isSent(int blockId);
268 
273  bool send(int blockId, bool mainZone=false);
274 
277 
280  {
281  return m_asciiFile;
282  }
283 
285  std::string const &asciiName() const
286  {
287  return m_asciiName;
288  }
289 
290 protected:
291  //
292  // data
293  //
294 
297 
300 
303 
305  std::shared_ptr<MacWrtProStructuresInternal::State> m_state;
306 
309 
311  std::string m_asciiName;
312 };
313 #endif
314 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWTextListenerPtr
std::shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:565
MacWrtProStructuresInternal::State::updateLineType
static bool updateLineType(int lineType, MWAWBorder &border)
try to set the line properties of a border
Definition: MacWrtProStructures.cxx:563
MacWrtProStructuresInternal::State::m_inputData
librevenge::RVNGBinaryData m_inputData
the input data
Definition: MacWrtProStructures.cxx:596
MWAWTable::numCells
int numCells() const
returns the number of cell
Definition: MWAWTable.hxx:113
MacWrtProStructures::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: MacWrtProStructures.hxx:296
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:549
MacWrtProStructuresInternal::Block::m_contentType
Type m_contentType
the type
Definition: MacWrtProStructures.cxx:264
MWAW_shared_ptr_noop_deleter
an noop deleter used to transform a libwpd pointer in a false std::shared_ptr
Definition: libmwaw_internal.hxx:101
MWAWInputStream::get
static std::shared_ptr< MWAWInputStream > get(librevenge::RVNGBinaryData const &data, bool inverted)
returns a new input stream corresponding to a librevenge::RVNGBinaryData
Definition: MWAWInputStream.cxx:102
MWAWFont::set
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:314
MWAWPosition::YPos
YPos
an enum used to define the relative Y position
Definition: MWAWPosition.hxx:57
MacWrtProStructuresInternal::State::m_footnotesList
std::vector< int > m_footnotesList
the foonote list (for MWII)
Definition: MacWrtProStructures.cxx:611
MacWrtProStructuresListenerState::MacWrtProStructuresListenerState
MacWrtProStructuresListenerState(std::shared_ptr< MacWrtProStructures > const &structures, bool mainZone, int version)
the constructor
Definition: MacWrtProStructures.cxx:2781
MWAWFont::setUnderlineType
void setUnderlineType(Line::Type type=Line::Single)
sets the underline type
Definition: MWAWFont.hxx:474
MacWrtProStructuresInternal::Block::m_send
bool m_send
true if we have send the data
Definition: MacWrtProStructures.cxx:317
MacWrtProStructuresInternal::Block::hasSameBorders
bool hasSameBorders() const
Definition: MacWrtProStructures.cxx:200
MacWrtProStructuresInternal::State::m_blocksSendSet
std::set< MWAWVec2i > m_blocksSendSet
a list of block use to avoid potential loop in bad file
Definition: MacWrtProStructures.cxx:617
MWAWPageSpan::setPageSpan
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:266
MWAWFont::smallCapsBit
Definition: MWAWFont.hxx:192
MWAWTabStop::m_leaderCharacter
uint16_t m_leaderCharacter
the leader char
Definition: MWAWParagraph.hxx:78
MacWrtProStructures::getColor
bool getColor(int colId, MWAWColor &color) const
try to return the color corresponding to colId
Definition: MacWrtProStructures.cxx:714
MacWrtProStructures::getTextListener
MWAWTextListenerPtr & getTextListener()
returns the actual listener
Definition: MacWrtProStructures.cxx:655
MacWrtProStructures::readSelection
bool readSelection()
try to read a 16 bytes the zone which follow the char styles zone ( the selection?...
Definition: MacWrtProStructures.cxx:2516
MWAWHeaderFooter::HEADER
Definition: MWAWPageSpan.hxx:48
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MacWrtProStructuresInternal::Section::StartType
StartType
Definition: MacWrtProStructures.cxx:455
MacWrtProStructuresInternal::Block::m_fileBlock
int m_fileBlock
the file block id
Definition: MacWrtProStructures.cxx:267
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:840
MacWrtProStructures::flushExtra
void flushExtra()
flush not send zones
Definition: MacWrtProStructures.cxx:2735
MacWrtProStructures::readStyle
bool readStyle(int styleId)
try to read a style
Definition: MacWrtProStructures.cxx:1738
MWAWListener::ColumnBreak
Definition: MWAWListener.hxx:58
libmwaw::DebugFile::addDelimiter
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
MWAWBox2::max
const MWAWVec2< T > & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:1042
MWAWBorder::m_type
Type m_type
the border repetition
Definition: libmwaw_internal.hxx:385
MWAWCell::setBdBox
void setBdBox(MWAWBox2f box)
set the bdbox (unit point)
Definition: MWAWCell.hxx:208
MacWrtProStructures::readBlocksList
bool readBlocksList()
try to read the list of block entries
Definition: MacWrtProStructures.cxx:1834
MWAWBorder::isEmpty
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:356
MacWrtProStructures::updatePageSpan
void updatePageSpan(int page, bool hasTitlePage, MWAWPageSpan &pageSpan)
update the page span
Definition: MacWrtProStructures.cxx:667
MacWrtProStructures::readSections
bool readSections(std::vector< MacWrtProStructuresInternal::Section > &sections)
try to read the section info ?
Definition: MacWrtProStructures.cxx:2394
MWAWPosition::setRelativePosition
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:236
MacWrtProStructuresInternal::Font::m_token
int m_token
the token type(checkme)
Definition: MacWrtProStructures.cxx:354
MacWrtProStructuresInternal::Section::m_start
StartType m_start
the way to start the new section
Definition: MacWrtProStructures.cxx:528
MWAWParagraph::m_tabs
MWAWVariable< std::vector< MWAWTabStop > > m_tabs
the tabulations
Definition: MWAWParagraph.hxx:161
MacWrtProStructuresInternal::Section
Internal: the section of a MacWrtProStructures.
Definition: MacWrtProStructures.cxx:454
MacWrtProStructuresInternal::State::m_fontsList
std::vector< Font > m_fontsList
the list of fonts
Definition: MacWrtProStructures.cxx:599
MacWrtProStructures::getPattern
bool getPattern(int patId, float &patternPercent) const
try to return the pattern corresponding to patId
Definition: MacWrtProStructures.cxx:772
MWAWPosition::setPage
void setPage(int pg) const
sets the page
Definition: MWAWPosition.hxx:204
MacWrtProStructuresInternal::Block::isTable
bool isTable() const
returns true is this is a table zone
Definition: MacWrtProStructures.cxx:196
MWAWHeaderFooter::EVEN
Definition: MWAWPageSpan.hxx:50
MacWrtProStructuresInternal::State::State
State()
constructor
Definition: MacWrtProStructures.cxx:545
MWAWFont::boldBit
Definition: MWAWFont.hxx:190
MacWrtProStructures::m_mainParser
MacWrtProParser & m_mainParser
the main parser
Definition: MacWrtProStructures.hxx:302
MacWrtProStructuresInternal::Cell::m_blockId
int m_blockId
the block id
Definition: MacWrtProStructures.cxx:421
MacWrtProStructures::setAsciiName
void setAsciiName(char const *name)
Debugging: change the default ascii file (by default struct )
Definition: MacWrtProStructures.hxx:172
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:250
MWAWTable.hxx
MWAWFont::setColor
void setColor(MWAWColor color)
sets the font color
Definition: MWAWFont.hxx:341
libmwaw::DebugFile::open
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
MWAWBox2::min
const MWAWVec2< T > & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:1037
libmwaw::BottomBit
Definition: libmwaw_internal.hxx:178
MWAWTabStop::CENTER
Definition: MWAWParagraph.hxx:48
MacWrtProStructuresInternal::Block::m_extra
std::string m_extra
extra data
Definition: MacWrtProStructures.cxx:314
MacWrtProStructuresListenerState::numSection
int numSection() const
returns the actual section
Definition: MacWrtProStructures.hxx:96
MWAWEntry.hxx
MacWrtProStructuresListenerState::~MacWrtProStructuresListenerState
~MacWrtProStructuresListenerState()
the destructor
Definition: MacWrtProStructures.cxx:2804
MacWrtProStructures::asciiName
const std::string & asciiName() const
return the ascii file name
Definition: MacWrtProStructures.hxx:285
MWAWPosition::YCenter
Definition: MWAWPosition.hxx:57
MWAWFontConverter.hxx
MacWrtProStructuresInternal::State::m_sectionsList
std::vector< Section > m_sectionsList
the list of section
Definition: MacWrtProStructures.cxx:603
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:192
MacWrtProStructuresInternal::Cell::m_parser
MacWrtProStructures & m_parser
the text parser
Definition: MacWrtProStructures.cxx:419
MacWrtProStructuresInternal::Block::m_attachment
bool m_attachment
true if this is an attachment
Definition: MacWrtProStructures.cxx:273
MWAWSection::setColumns
void setColumns(int num, double width, librevenge::RVNGUnit widthUnit, double colSep=0)
a function which sets n uniform columns
Definition: MWAWSection.cxx:109
MWAWGraphicStyle::setBackgroundColor
void setBackgroundColor(MWAWColor const &col, float opacity=1)
set the background color
Definition: MWAWGraphicStyle.hxx:354
MacWrtProStructuresInternal::Block::m_borderCellList
MWAWBorder m_borderCellList[4]
the cell borders
Definition: MacWrtProStructures.cxx:285
MacWrtProStructuresListenerState::m_numTab
int m_numTab
Definition: MacWrtProStructures.hxx:134
MacWrtProStructuresListenerState::getFontDebugString
std::string getFontDebugString(int fontId)
debug function which returns a string corresponding to a fontId
Definition: MacWrtProStructures.cxx:2977
MacWrtProStructuresListenerState::m_paragraph
std::shared_ptr< MacWrtProStructuresInternal::Paragraph > m_paragraph
Definition: MacWrtProStructures.hxx:146
MacWrtProStructures::m_input
MWAWInputStreamPtr m_input
the main input
Definition: MacWrtProStructures.hxx:299
MacWrtProStructuresInternal::State::m_blocksList
std::vector< std::shared_ptr< Block > > m_blocksList
the list of block
Definition: MacWrtProStructures.cxx:605
MacWrtProStructuresInternal::Block::GRAPHIC
Definition: MacWrtProStructures.cxx:63
MacWrtProStructures::createZones
bool createZones()
finds the different objects zones
Definition: MacWrtProStructures.cxx:813
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:84
MWAWPosition::WDynamic
Definition: MWAWPosition.hxx:53
MacWrtProStructuresInternal::Font
Internal: the fonts.
Definition: MacWrtProStructures.cxx:322
MWAWFont::Line::Simple
Definition: MWAWFont.hxx:49
MacWrtProStructuresInternal::Section::m_textLength
long m_textLength
the number of character in the sections
Definition: MacWrtProStructures.cxx:536
MacWrtProStructures::readFont
bool readFont(MacWrtProStructuresInternal::Font &font)
try to read a font
Definition: MacWrtProStructures.cxx:1310
MWAWHeaderFooter::m_subDocument
MWAWSubDocumentPtr m_subDocument
the document data
Definition: MWAWPageSpan.hxx:91
MWAWBorder::m_width
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:387
MacWrtProStructuresInternal::Cell
Internal: the cell of a MacWrtProStructure.
Definition: MacWrtProStructures.cxx:388
MWAWCell::setBackgroundColor
void setBackgroundColor(MWAWColor color)
sets the background color
Definition: MWAWCell.hxx:319
MacWrtProStructuresInternal::Block::m_col
int m_col
number of columns, filled for table
Definition: MacWrtProStructures.cxx:308
MacWrtProStructures::readBlock
std::shared_ptr< MacWrtProStructuresInternal::Block > readBlock()
try to read a block entry
Definition: MacWrtProStructures.cxx:2121
MacWrtProStructures::readStyles
bool readStyles()
try to read the paragraph styles zone which begins at address 0x200
Definition: MacWrtProStructures.cxx:1697
MacWrtProStructuresInternal::Block::Block
Block()
the constructor
Definition: MacWrtProStructures.cxx:65
MacWrtProStructuresListenerState::m_version
int m_version
Definition: MacWrtProStructures.hxx:128
libmwaw::DebugFile::addNote
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
MWAWFont::setDeltaLetterSpacing
void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
sets the letter spacing ( delta value in point )
Definition: MWAWFont.hxx:292
MacWrtProStructuresListenerState::newPage
bool newPage(bool softBreak=false)
create a new page
Definition: MacWrtProStructures.cxx:2827
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
MacWrtProStructuresInternal::State::m_tablesMap
std::map< int, std::shared_ptr< Table > > m_tablesMap
a map block id -> table
Definition: MacWrtProStructures.cxx:609
MacWrtProParser::parseDataZone
bool parseDataZone(int blockId, int type)
parse a data zone
Definition: MacWrtProParser.cxx:953
MWAWTabStop::DECIMAL
Definition: MWAWParagraph.hxx:48
MacWrtProParser.hxx
MacWrtProParser::getSubDocument
std::shared_ptr< MWAWSubDocument > getSubDocument(int blockId)
returns a subdocument corresponding to a blockid
Definition: MacWrtProParser.cxx:389
MacWrtProStructures::readCharStyles
bool readCharStyles()
try to read the character styles zone
Definition: MacWrtProStructures.cxx:1609
MWAWFont::embossBit
Definition: MWAWFont.hxx:190
MacWrtProStructuresInternal::Font::m_flags
int m_flags
some unknown flag
Definition: MacWrtProStructures.cxx:352
MacWrtProParser::sendEmptyFrameZone
bool sendEmptyFrameZone(MWAWPosition const &pos, MWAWGraphicStyle const &style)
try to send an empty zone (can exist in MacWrtPro1.5)
Definition: MacWrtProParser.cxx:1325
MWAWHeaderFooter
a class which stores the header/footer data
Definition: MWAWPageSpan.hxx:44
MWAWFont::uppercaseBit
Definition: MWAWFont.hxx:192
MacWrtProStructuresInternal::Table::~Table
~Table() final
destructor
Definition: MacWrtProStructures.cxx:448
MWAWCell.hxx
MacWrtProStructures::ascii
libmwaw::DebugFile & ascii()
returns the debug file
Definition: MacWrtProStructures.hxx:279
MacWrtProStructuresListenerState::m_structures
std::shared_ptr< MacWrtProStructures > m_structures
Definition: MacWrtProStructures.hxx:142
MacWrtProStructures::~MacWrtProStructures
virtual ~MacWrtProStructures()
destructor
Definition: MacWrtProStructures.cxx:637
MWAWTabStop
class to store a tab use by MWAWParagraph
Definition: MWAWParagraph.hxx:46
MWAWFont::setStrikeOutStyle
void setStrikeOutStyle(Line::Style style=Line::None, bool doReset=true)
sets the strikeoutline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:427
MWAWColor::barycenter
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:206
MacWrtProStructures::readFontsName
bool readFontsName()
try to read the fonts zone
Definition: MacWrtProStructures.cxx:1192
MacWrtProStructuresInternal::Block::m_row
int m_row
number of row, filled for table
Definition: MacWrtProStructures.cxx:305
MacWrtProStructuresInternal::Block
Internal: the data block.
Definition: MacWrtProStructures.cxx:62
MacWrtProStructuresListenerState::resendAll
bool resendAll()
force resent data : font + paragraph
Definition: MacWrtProStructures.cxx:2945
MWAWParagraph::AtLeast
Definition: MWAWParagraph.hxx:94
MacWrtProStructuresInternal::Block::UNKNOWN
Definition: MacWrtProStructures.cxx:63
MacWrtProStructuresInternal::Block::m_type
int m_type
the type
Definition: MacWrtProStructures.cxx:261
MacWrtProStructures::m_state
std::shared_ptr< MacWrtProStructuresInternal::State > m_state
the state
Definition: MacWrtProStructures.hxx:305
libmwaw::DebugFile::reset
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
MWAWFont::m_extra
std::string m_extra
extra data
Definition: MWAWFont.hxx:573
MacWrtProStructuresInternal::Cell::Cell
Cell(MacWrtProStructures &parser, Block *block)
constructor
Definition: MacWrtProStructures.cxx:390
MWAWBorder::m_widthsList
std::vector< double > m_widthsList
the different length used for each line/sep (if defined)
Definition: libmwaw_internal.hxx:391
MacWrtProStructuresInternal::State::m_paragraphsList
std::vector< Paragraph > m_paragraphsList
the list of paragraph
Definition: MacWrtProStructures.cxx:601
MacWrtProStructures::m_asciiName
std::string m_asciiName
the debug file name
Definition: MacWrtProStructures.hxx:311
MWAWParagraph::JustificationCenter
Definition: MWAWParagraph.hxx:90
MacWrtProStructuresInternal::Block::m_borderWList
double m_borderWList[4]
the borders width
Definition: MacWrtProStructures.cxx:282
MWAWFont::shadowBit
Definition: MWAWFont.hxx:191
MWAWParagraph.hxx
MacWrtProStructures::readStructB
bool readStructB()
try to read a zone which follow the fonts zone(checkme)
Definition: MacWrtProStructures.cxx:2589
MacWrtProParser::findNumHardBreaks
int findNumHardBreaks(int blockId)
compute the number of hard page break
Definition: MacWrtProParser.cxx:1337
MacWrtProParser::sendTextBoxZone
bool sendTextBoxZone(int blockId, MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
send a textbox zone
Definition: MacWrtProParser.cxx:1382
libmwaw::Bottom
Definition: libmwaw_internal.hxx:176
MacWrtProStructuresListenerState::m_actTab
int m_actTab
Definition: MacWrtProStructures.hxx:132
MacWrtProStructures::buildTableStructures
void buildTableStructures()
look for tables structures and if so, prepare data
Definition: MacWrtProStructures.cxx:1135
MWAWPosition.hxx
MacWrtProStructuresInternal::State
Internal: the state of a MacWrtProStructures.
Definition: MacWrtProStructures.cxx:543
MacWrtProStructuresListenerState::m_font
std::shared_ptr< MacWrtProStructuresInternal::Font > m_font
Definition: MacWrtProStructures.hxx:144
MacWrtProStructuresInternal::Table::get
Cell * get(int id)
return a cell corresponding to id
Definition: MacWrtProStructures.cxx:438
MacWrtProStructuresInternal::Block::m_isHeader
bool m_isHeader
filled for header/footer
Definition: MacWrtProStructures.cxx:300
MacWrtProStructuresInternal::Block::intersects
bool intersects(MWAWBox2f const &box) const
Definition: MacWrtProStructures.cxx:249
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:47
MacWrtProStructuresListenerState::m_numCols
int m_numCols
Definition: MacWrtProStructures.hxx:138
MacWrtProStructuresInternal::Section::numColumns
int numColumns() const
return the number of columns
Definition: MacWrtProStructures.cxx:486
MWAWBorder
a border
Definition: libmwaw_internal.hxx:333
MWAWSection::m_columns
std::vector< Column > m_columns
the different column
Definition: MWAWSection.hxx:107
MacWrtProStructuresInternal::State::m_blocksMap
std::map< int, std::shared_ptr< Block > > m_blocksMap
a map block id -> block
Definition: MacWrtProStructures.cxx:607
MacWrtProStructuresInternal::Section::S_Page
Definition: MacWrtProStructures.cxx:455
MacWrtProStructuresInternal::Font::Font
Font()
the constructor
Definition: MacWrtProStructures.cxx:324
MWAWPosition::m_wrapping
Wrapping m_wrapping
Wrapping.
Definition: MWAWPosition.hxx:277
MWAWGraphicStyle::setBorders
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWGraphicStyle.cxx:172
MWAWTable
a class used to recreate the table structure using cell informations, ....
Definition: MWAWTable.hxx:51
libmwaw::DebugFile::setStream
void setStream(MWAWInputStreamPtr const &ip)
resets the input
Definition: MWAWDebug.hxx:81
libmwaw::RightBit
Definition: libmwaw_internal.hxx:178
MWAWVec2< int >
MWAWFont::size
float size() const
returns the font size
Definition: MWAWFont.hxx:270
MacWrtProStructuresInternal::Paragraph::Paragraph
Paragraph()
Constructor.
Definition: MacWrtProStructures.cxx:363
MWAWHeaderFooter::ODD
Definition: MWAWPageSpan.hxx:50
MacWrtProParser::getZoneData
bool getZoneData(librevenge::RVNGBinaryData &data, int blockId)
retrieve the data which corresponds to a zone
Definition: MacWrtProParser.cxx:448
MWAWTabStop::m_alignment
Alignment m_alignment
the alignment ( left, center, ...)
Definition: MWAWParagraph.hxx:76
MWAWSection
a class which stores section properties
Definition: MWAWSection.hxx:45
MWAWDebug.hxx
MacWrtProStructuresInternal::Cell::sendContent
bool sendContent(MWAWListenerPtr listener, MWAWTable &) final
send the content
Definition: MacWrtProStructures.cxx:409
MacWrtProStructuresInternal::Paragraph::operator=
Paragraph & operator=(Paragraph const &)=default
MacWrtProStructuresListenerState::m_isMainZone
bool m_isMainZone
Definition: MacWrtProStructures.hxx:126
MWAWFont::getDebugString
std::string getDebugString(std::shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:181
MacWrtProStructuresInternal::Table::Table
Table()
constructor
Definition: MacWrtProStructures.cxx:432
MacWrtProStructures::readFontsDef
bool readFontsDef()
try to read the list of fonts
Definition: MacWrtProStructures.cxx:1258
MacWrtProStructuresListenerState::m_actPage
int m_actPage
Definition: MacWrtProStructures.hxx:130
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1191
MacWrtProStructuresInternal::Font::operator<<
friend std::ostream & operator<<(std::ostream &o, Font const &font)
operator<<
Definition: MacWrtProStructures.cxx:332
MacWrtProStructuresInternal::Block::isText
bool isText() const
returns true is this is a text zone (or a not)
Definition: MacWrtProStructures.cxx:191
MacWrtProParser::sendPictureZone
bool sendPictureZone(int blockId, MWAWPosition const &pictPos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
try to send a picture
Definition: MacWrtProParser.cxx:1613
MWAWTabStop::m_position
double m_position
the tab position
Definition: MWAWParagraph.hxx:74
MWAWFont::setId
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:264
MacWrtProStructures::MacWrtProStructures
MacWrtProStructures(MacWrtProParser &mainParser)
constructor
Definition: MacWrtProStructures.cxx:626
MacWrtProStructuresInternal
Internal: the structures of a MacWrtProStructures.
Definition: MacWrtProStructures.cxx:58
MWAWTabStop::m_decimalCharacter
uint16_t m_decimalCharacter
the decimal char
Definition: MWAWParagraph.hxx:80
MacWrtProStructuresInternal::Section::m_colsPos
std::vector< float > m_colsPos
the columns position ( series of end columns <-> new column begin)
Definition: MacWrtProStructures.cxx:530
MWAWHeaderFooter::FOOTER
Definition: MWAWPageSpan.hxx:48
MWAWPosition::Char
Definition: MWAWPosition.hxx:51
MacWrtProStructuresInternal::State::m_footersMap
std::map< int, int > m_footersMap
a map page -> footer id
Definition: MacWrtProStructures.cxx:615
MacWrtProStructuresInternal::Block::m_surfaceColor
MWAWColor m_surfaceColor
the background color
Definition: MacWrtProStructures.cxx:291
MacWrtProStructuresInternal::Block::getPosition
MWAWPosition getPosition() const
Definition: MacWrtProStructures.cxx:220
MacWrtProStructuresListenerState::getPageBreaksPos
std::vector< int > getPageBreaksPos() const
return a list of page break position ( as some page break are soft )
Definition: MacWrtProStructures.cxx:2858
MacWrtProStructuresListenerState::m_newPageDone
bool m_newPageDone
Definition: MacWrtProStructures.hxx:140
MacWrtProStructures::readBlockV2
std::shared_ptr< MacWrtProStructuresInternal::Block > readBlockV2(int id)
try to read a block entry
Definition: MacWrtProStructures.cxx:1915
MacWrtProParser::sendTextZone
bool sendTextZone(int blockId, bool mainZone=false)
send a text box
Definition: MacWrtProParser.cxx:1371
MacWrtProStructuresInternal::Block::operator<<
friend std::ostream & operator<<(std::ostream &o, Block const &bl)
operator<<
Definition: MacWrtProStructures.cxx:89
libmwaw::Top
Definition: libmwaw_internal.hxx:176
MacWrtProStructuresInternal::Section::S_PageRight
Definition: MacWrtProStructures.cxx:455
MacWrtProStructuresInternal::Section::operator<<
friend std::ostream & operator<<(std::ostream &o, Section const &sec)
operator<<
Definition: MacWrtProStructures.cxx:492
MWAWHeader.hxx
MacWrtProParserInternal::SubDocument
Internal: the subdocument of a MacWrtProParser.
Definition: MacWrtProParser.cxx:267
MacWrtProStructuresInternal::Block::m_baseline
float m_baseline
the baseline ( in point 0=bottom aligned)
Definition: MacWrtProStructures.cxx:288
MWAWFont::setSize
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:275
MacWrtProStructuresInternal::Block::contains
bool contains(MWAWBox2f const &box) const
Definition: MacWrtProStructures.cxx:244
MWAWHeaderFooter::ALL
Definition: MWAWPageSpan.hxx:50
MacWrtProStructuresListenerState::sendChar
void sendChar(char c)
send a character
Definition: MacWrtProStructures.cxx:2870
MacWrtProStructuresInternal::State::m_headersMap
std::map< int, int > m_headersMap
a map page -> header id
Definition: MacWrtProStructures.cxx:613
MWAWBorder::Double
Definition: libmwaw_internal.hxx:337
libmwaw::LeftBit
Definition: libmwaw_internal.hxx:178
MacWrtProStructuresInternal::Section::S_Line
Definition: MacWrtProStructures.cxx:455
MacWrtProStructuresInternal::Section::m_extra
std::string m_extra
extra data
Definition: MacWrtProStructures.cxx:538
MacWrtProStructuresInternal::Section::getSection
MWAWSection getSection() const
returns a MWAWSection
Definition: MacWrtProStructures.cxx:468
MWAWFont::italicBit
Definition: MWAWFont.hxx:190
MacWrtProStructuresListenerState::sendParagraph
bool sendParagraph(int id)
try to send a paragraph
Definition: MacWrtProStructures.cxx:3000
MacWrtProStructuresInternal::Font::m_font
MWAWFont m_font
the font
Definition: MacWrtProStructures.cxx:350
MacWrtProStructuresInternal::Block::hasBorders
bool hasBorders() const
Definition: MacWrtProStructures.cxx:209
MacWrtProStructuresInternal::Section::Section
Section()
constructor
Definition: MacWrtProStructures.cxx:458
MacWrtProStructuresListenerState::getParagraphDebugString
std::string getParagraphDebugString(int paraId)
debug function which returns a string corresponding to a paragrapId
Definition: MacWrtProStructures.cxx:3023
MacWrtProStructures::readString
static bool readString(MWAWInputStreamPtr input, std::string &res)
try to read a string
Definition: MacWrtProStructures.cxx:2556
MacWrtProStructures::version
int version() const
returns the file version.
Definition: MacWrtProStructures.cxx:648
MWAWParagraph::NoBreakWithNextBit
Definition: MWAWParagraph.hxx:88
MWAWTextListener.hxx
MacWrtProStructures::send
bool send(int blockId, bool mainZone=false)
try to send a block which corresponds to blockid
Definition: MacWrtProStructures.cxx:2650
MacWrtProStructuresListenerState::m_section
int m_section
Definition: MacWrtProStructures.hxx:136
MacWrtProStructures::createZonesV2
bool createZonesV2()
finds the different objects zones in a MacWriteII file
Definition: MacWrtProStructures.cxx:931
MacWrtProStructuresInternal::Table
Definition: MacWrtProStructures.cxx:430
MacWrtProStructuresInternal::Font::m_values
int m_values[5]
unknown values
Definition: MacWrtProStructures.cxx:356
libmwaw::Right
Definition: libmwaw_internal.hxx:176
MacWrtProStructuresInternal::State::m_numPages
int m_numPages
the number of pages
Definition: MacWrtProStructures.cxx:593
MacWrtProStructuresInternal::Block::isGraphic
bool isGraphic() const
returns true is this is a graphic zone
Definition: MacWrtProStructures.cxx:186
MacWrtProStructures::sendMainZone
bool sendMainZone()
send the main zone
Definition: MacWrtProStructures.cxx:1040
MWAWPosition::Page
Definition: MWAWPosition.hxx:51
MacWrtProStructuresInternal::Block::NOTE
Definition: MacWrtProStructures.cxx:63
MWAWParagraph::JustificationFull
Definition: MWAWParagraph.hxx:90
MWAWSection.hxx
MWAWParagraph::JustificationRight
Definition: MWAWParagraph.hxx:91
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:555
libmwaw::TopBit
Definition: libmwaw_internal.hxx:178
MacWrtProStructuresInternal::Block::m_id
int m_id
the block id
Definition: MacWrtProStructures.cxx:270
MacWrtProStructures
the main class to read the structures part of MacWrite Pro file
Definition: MacWrtProStructures.hxx:154
libmwaw::DebugFile::addPos
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
MWAWCell::setBorders
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWCell.cxx:379
MacWrtProStructuresListenerState::sendSection
void sendSection(int numSection)
try to send the i^th section
Definition: MacWrtProStructures.cxx:3040
MWAWBorder::m_extra
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:395
MacWrtProStructuresListenerState::isSent
bool isSent(int blockId)
returns true if the block is already sent ( or does not exists)
Definition: MacWrtProStructures.cxx:2808
MWAWFont::Script::super
static Script super()
return a yposition which correspond to a basic superscript
Definition: MWAWFont.hxx:130
MacWrtProStructuresInternal::Block::m_headerFooterFlags
int m_headerFooterFlags
the header/footer flags(MWII)
Definition: MacWrtProStructures.cxx:302
MWAWPosition::YTop
Definition: MWAWPosition.hxx:57
MWAWPageSpan::setHeaderFooter
void setHeaderFooter(MWAWHeaderFooter const &headerFooter)
add a header/footer on some page
Definition: MWAWPageSpan.cxx:227
MacWrtProStructuresListenerState
an interface to transmit the info of MacWrtProStructures to a listener
Definition: MacWrtProStructures.hxx:70
MacWrtProStructures::readParagraph
bool readParagraph(MacWrtProStructuresInternal::Paragraph &para)
try to read a paragraph
Definition: MacWrtProStructures.cxx:1452
MacWrtProStructuresInternal::Cell::~Cell
~Cell() final
destructor
Definition: MacWrtProStructures.cxx:424
libmwaw::Left
Definition: libmwaw_internal.hxx:176
MWAWBox2::size
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1065
MacWrtProStructuresInternal::Block::getRelativeYPos
MWAWPosition::YPos getRelativeYPos() const
Definition: MacWrtProStructures.cxx:237
libmwaw::DebugFile
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:65
MacWrtProStructuresInternal::State::m_version
int m_version
the file version
Definition: MacWrtProStructures.cxx:590
MWAWPosition::WRunThrough
Definition: MWAWPosition.hxx:53
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:106
MWAWFont::Line::Double
Definition: MWAWFont.hxx:51
MWAWPosition::XLeft
Definition: MWAWPosition.hxx:55
MWAWPosition::YBottom
Definition: MWAWPosition.hxx:57
MWAWInputStream.hxx
MacWrtProStructuresInternal::Block::TEXT
Definition: MacWrtProStructures.cxx:63
MacWrtProStructuresInternal::Block::Type
Type
Definition: MacWrtProStructures.cxx:63
MacWrtProStructuresInternal::Section::S_PageLeft
Definition: MacWrtProStructures.cxx:455
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:289
MWAWListenerPtr
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:551
MacWrtProStructuresInternal::Block::m_box
MWAWBox2f m_box
the bdbox
Definition: MacWrtProStructures.cxx:279
MWAWFont.hxx
MacWrtProStructuresInternal::Paragraph
Internal: class to store the paragraph properties.
Definition: MacWrtProStructures.cxx:361
MacWrtProParser::getBlocksCalledByToken
const std::vector< int > & getBlocksCalledByToken() const
return the list of blockid called by token.
Definition: MacWrtProParser.cxx:384
MWAWTable::get
std::shared_ptr< MWAWCell > get(int id)
returns the i^th cell
Definition: MWAWTable.cxx:122
MacWrtProStructuresListenerState::sendFont
bool sendFont(int id)
try to send a character style
Definition: MacWrtProStructures.cxx:2954
MWAWTabStop::RIGHT
Definition: MWAWParagraph.hxx:48
MWAWBox2< float >
MacWrtProStructuresInternal::Section::m_headerIds
int m_headerIds[2]
the header block ids
Definition: MacWrtProStructures.cxx:532
MacWrtProParserInternal
Internal: the structures of a MacWrtProParser.
Definition: MacWrtProParser.cxx:61
MacWrtProStructuresInternal::Block::fillFrame
void fillFrame(MWAWGraphicStyle &style) const
update the style to include frame style
Definition: MacWrtProStructures.cxx:169
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:43
MacWrtProStructuresInternal::Paragraph::m_value
int m_value
a unknown value
Definition: MacWrtProStructures.cxx:379
MacWrtProStructuresInternal::Block::m_page
int m_page
the page (if absolute)
Definition: MacWrtProStructures.cxx:276
MWAWCell
a structure used to define a cell and its format
Definition: MWAWCell.hxx:52
MWAWFont::setLanguage
void setLanguage(std::string const &lang)
set the language ( in the for en_US, en_GB, en, ...)
Definition: MWAWFont.hxx:500
MacWrtProStructuresInternal::Block::m_textboxCellType
int m_textboxCellType
filled for textbox : 0: unknown/textbox, 1: cell, 2: textbox(opened)
Definition: MacWrtProStructures.cxx:311
MacWrtProStructuresInternal::Block::m_textPos
int m_textPos
filled for pagebreak pos
Definition: MacWrtProStructures.cxx:297
MacWrtProStructures::buildPageStructures
void buildPageStructures()
look for pages structures
Definition: MacWrtProStructures.cxx:1070
MacWrtProStructuresInternal::Block::m_lineBorder
MWAWBorder m_lineBorder
the line border
Definition: MacWrtProStructures.cxx:294
MWAWBorder::m_color
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:393
MacWrtProStructuresListenerState::send
bool send(int blockId)
try to send a block which corresponds to blockid
Definition: MacWrtProStructures.cxx:2814
MacWrtProStructuresListenerState::insertSoftPageBreak
void insertSoftPageBreak()
insert a page break ( if we are not on a new page )
Definition: MacWrtProStructures.cxx:2821
MacWrtProParser
the main class to read a MacWrite II and MacWrite Pro file
Definition: MacWrtProParser.hxx:67
libmwaw::DebugStream
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
MacWrtProStructures::readParagraphs
bool readParagraphs()
try to read a list of paragraph
Definition: MacWrtProStructures.cxx:1397
MWAWFont::setUnderlineStyle
void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
sets the underline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:466
MacWrtProStructuresInternal::Section::m_footerIds
int m_footerIds[2]
the footerer block ids
Definition: MacWrtProStructures.cxx:534
MacWrtProStructures::m_asciiFile
libmwaw::DebugFile m_asciiFile
the debug file
Definition: MacWrtProStructures.hxx:308
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:97
MacWrtProStructuresInternal::Paragraph::~Paragraph
~Paragraph() final
destructor
Definition: MacWrtProStructures.cxx:382
MacWrtProStructures::numPages
int numPages() const
returns the number of pages
Definition: MacWrtProStructures.cxx:660
MacWrtProStructures::isSent
bool isSent(int blockId)
returns true if the block is already sent ( or does not exists)
Definition: MacWrtProStructures.cxx:2631
MWAWParagraph::NoBreakBit
Definition: MWAWParagraph.hxx:88
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:325
MWAWFont::lowercaseBit
Definition: MWAWFont.hxx:193
MacWrtProStructures.hxx
MacWrtProStructures::init
void init()
inits all internal variables
Definition: MacWrtProStructures.cxx:642

Generated on Wed Jul 24 2024 02:19:05 for libmwaw by doxygen 1.8.16