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 <string>
38 #include <vector>
39 
40 #include "MWAWDebug.hxx"
41 #include "MWAWEntry.hxx"
42 #include "MWAWInputStream.hxx"
43 #include "MWAWPosition.hxx"
44 #include "MWAWStream.hxx"
45 
46 class MacWrtProParser;
47 
49 {
50 class SubDocument;
51 }
52 
54 {
55 struct Graphic;
56 struct Page;
57 struct Cell;
58 struct Font;
59 struct Paragraph;
60 struct Section;
61 struct State;
62 class SubDocument;
63 }
64 
66 
70 {
71 public:
73  MacWrtProStructuresListenerState(std::shared_ptr<MacWrtProStructures> const &structures, bool mainZone, int version);
76 
78  bool isSent(int graphicId);
80  bool send(int graphicId);
81 
83  void sendSection(int numSection);
85  bool sendFont(int id);
87  bool sendParagraph(int id);
89  void sendChar(char c);
90 
92  int numSection() const
93  {
94  if (!m_isMainZone) {
95  MWAW_DEBUG_MSG(("MacWrtProStructuresListenerState::numSection: not called in main zone\n"));
96  return 0;
97  }
98  return m_section;
99  }
100 
102  std::vector<int> getPageBreaksPos() const;
104  void insertSoftPageBreak();
105 
106 protected:
108  bool newPage(bool softBreak=false);
109 
110  // true if this is the mainZone
112  // the file version
114  // the actual page
116  // the actual tab
117  int m_actTab;
118  // the number of tab
119  int m_numTab;
120  // the actual section ( if mainZone )
122  // the actual number of columns
124  // a flag to know if a new page has just been open
126  // the main structure parser
127  std::shared_ptr<MacWrtProStructures> m_structures;
128 };
129 
136 {
137  friend class MacWrtProParser;
141 public:
143  explicit MacWrtProStructures(MacWrtProParser &mainParser);
145  virtual ~MacWrtProStructures();
146 
150  int version() const;
151 
152 protected:
154  void init();
155 
157  bool createZones(std::shared_ptr<MWAWStream> &stream, int numPages);
158 
163  bool createZonesII(std::shared_ptr<MWAWStream> &stream, int numPages);
164 
166  int numPages() const;
167 
169  bool sendMainZone();
170 
172  void updatePageSpan(int page, bool hasTitlePage, MWAWPageSpan &pageSpan);
173 
175  void flushExtra();
176 
178  void buildPageStructures();
179 
181  void buildTableStructures();
182 
183  //
184  // low level
185  //
186 
188  bool readStyles(std::shared_ptr<MWAWStream> &stream);
189 
191  bool readStyle(std::shared_ptr<MWAWStream> &stream, int styleId);
192 
194  bool readCharStyles(std::shared_ptr<MWAWStream> &stream);
195 
197  bool readParagraphs(std::shared_ptr<MWAWStream> &stream);
198 
200  bool readParagraph(std::shared_ptr<MWAWStream> &stream, MacWrtProStructuresInternal::Paragraph &para);
201 
203  bool readGraphicsList(std::shared_ptr<MWAWStream> &stream, int nuumPages);
205  std::shared_ptr<MacWrtProStructuresInternal::Graphic> readGraphic(std::shared_ptr<MWAWStream> &stream);
206 
208  bool readPagesListII(std::shared_ptr<MWAWStream> const &stream, int numPages);
210  bool readPageII(std::shared_ptr<MWAWStream> const &stream, int wh, MacWrtProStructuresInternal::Page &page);
212  bool readGraphicII(std::shared_ptr<MWAWStream> const &stream, int id, bool mainGraphic, MacWrtProStructuresInternal::Graphic &graphic);
213 
215  bool readFontsName(std::shared_ptr<MWAWStream> &stream);
216 
218  bool readFontsDef(std::shared_ptr<MWAWStream> &stream);
219 
221  bool readFont(std::shared_ptr<MWAWStream> &stream, MacWrtProStructuresInternal::Font &font);
222 
224  bool readSections(std::shared_ptr<MWAWStream> &stream, std::vector<MacWrtProStructuresInternal::Section> &sections);
225 
227  bool readSelection(std::shared_ptr<MWAWStream> &stream);
228 
230  bool readStructB(std::shared_ptr<MWAWStream> &stream);
231 
233  static bool readString(MWAWInputStreamPtr input, std::string &res);
234 
236  bool getColor(int colId, MWAWColor &color) const;
237 
239  bool getPattern(int patId, float &patternPercent) const;
240 
242  bool getColor(int colId, int patId, MWAWColor &color) const;
243 
245  bool isSent(int graphicId);
246 
251  bool send(int graphicId, bool mainZone=false);
252 
255 
256 protected:
257  //
258  // data
259  //
260 
263 
266 
268  std::shared_ptr<MacWrtProStructuresInternal::State> m_state;
269 
271  std::string m_asciiName;
272 };
273 #endif
274 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MacWrtProStructuresInternal::Graphic::intersects
bool intersects(MWAWBox2f const &box) const
Definition: MacWrtProStructures.cxx:305
MWAWTextListenerPtr
std::shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:567
MacWrtProStructuresInternal::State::updateLineType
static bool updateLineType(int lineType, MWAWBorder &border)
try to set the line properties of a border
Definition: MacWrtProStructures.cxx:670
MacWrtProStructuresInternal::State::m_inputData
librevenge::RVNGBinaryData m_inputData
the input data
Definition: MacWrtProStructures.cxx:703
MacWrtProStructures::readStyle
bool readStyle(std::shared_ptr< MWAWStream > &stream, int styleId)
try to read a style
Definition: MacWrtProStructures.cxx:1780
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:262
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
MacWrtProStructuresInternal::Graphic::m_extra
std::string m_extra
extra data
Definition: MacWrtProStructures.cxx:391
MacWrtProStructures::isSent
bool isSent(int graphicId)
returns true if the graphic is already sent ( or does not exists)
Definition: MacWrtProStructures.cxx:2677
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
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::Cell::m_graphicId
int m_graphicId
the graphic id
Definition: MacWrtProStructures.cxx:528
MacWrtProStructuresInternal::State::m_pagesList
std::vector< Page > m_pagesList
the pages list (for MWII)
Definition: MacWrtProStructures.cxx:710
MacWrtProStructuresListenerState::MacWrtProStructuresListenerState
MacWrtProStructuresListenerState(std::shared_ptr< MacWrtProStructures > const &structures, bool mainZone, int version)
the constructor
Definition: MacWrtProStructures.cxx:2838
MWAWFont::setUnderlineType
void setUnderlineType(Line::Type type=Line::Single)
sets the underline type
Definition: MWAWFont.hxx:474
MacWrtProStructures::readPageII
bool readPageII(std::shared_ptr< MWAWStream > const &stream, int wh, MacWrtProStructuresInternal::Page &page)
try to read a page entry: II
Definition: MacWrtProStructures.cxx:1894
MWAWPageSpan::setPageSpan
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:268
MWAWFont::smallCapsBit
@ smallCapsBit
Definition: MWAWFont.hxx:192
MWAWTabStop::m_leaderCharacter
uint16_t m_leaderCharacter
the leader char
Definition: MWAWParagraph.hxx:78
MacWrtProStructuresInternal::Page::m_page
int m_page
the page (if absolute)
Definition: MacWrtProStructures.cxx:416
MacWrtProStructures::getColor
bool getColor(int colId, MWAWColor &color) const
try to return the color corresponding to colId
Definition: MacWrtProStructures.cxx:822
MacWrtProStructures::getTextListener
MWAWTextListenerPtr & getTextListener()
returns the actual listener
Definition: MacWrtProStructures.cxx:758
MWAWHeaderFooter::HEADER
@ HEADER
Definition: MWAWPageSpan.hxx:48
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MacWrtProStructuresInternal::Graphic::m_box
MWAWBox2f m_box
the bdbox
Definition: MacWrtProStructures.cxx:338
MacWrtProStructuresInternal::Section::StartType
StartType
Definition: MacWrtProStructures.cxx:562
MacWrtProStructuresInternal::Graphic::Graphic
Graphic(int vers)
the constructor
Definition: MacWrtProStructures.cxx:64
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
MacWrtProStructures::flushExtra
void flushExtra()
flush not send zones
Definition: MacWrtProStructures.cxx:2774
MWAWListener::ColumnBreak
@ ColumnBreak
Definition: MWAWListener.hxx:58
MacWrtProStructuresInternal::Graphic::contains
bool contains(MWAWBox2f const &box) const
Definition: MacWrtProStructures.cxx:300
MacWrtProParser::getGraphicIdCalledByToken
std::vector< int > const & getGraphicIdCalledByToken() const
return the list of graphicid called by token.
Definition: MacWrtProParser.cxx:371
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:211
MWAWBorder::isEmpty
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:356
MacWrtProStructuresInternal::Graphic::m_borderCellList
MWAWBorder m_borderCellList[4]
the cell borders
Definition: MacWrtProStructures.cxx:367
MacWrtProStructures::updatePageSpan
void updatePageSpan(int page, bool hasTitlePage, MWAWPageSpan &pageSpan)
update the page span
Definition: MacWrtProStructures.cxx:770
MacWrtProStructuresInternal::Graphic::m_send
bool m_send
true if we have send the data
Definition: MacWrtProStructures.cxx:394
MWAWPosition::setRelativePosition
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:237
MacWrtProStructuresInternal::Font::m_token
int m_token
the token type(checkme)
Definition: MacWrtProStructures.cxx:460
MacWrtProStructuresInternal::Section::m_start
StartType m_start
the way to start the new section
Definition: MacWrtProStructures.cxx:635
MacWrtProStructuresInternal::Section
Internal: the section of a MacWrtProStructures.
Definition: MacWrtProStructures.cxx:561
MacWrtProStructuresInternal::State::m_fontsList
std::vector< Font > m_fontsList
the list of fonts
Definition: MacWrtProStructures.cxx:706
MacWrtProStructures::getPattern
bool getPattern(int patId, float &patternPercent) const
try to return the pattern corresponding to patId
Definition: MacWrtProStructures.cxx:880
MWAWPosition::setPage
void setPage(int pg) const
sets the page
Definition: MWAWPosition.hxx:205
MWAWHeaderFooter::EVEN
@ EVEN
Definition: MWAWPageSpan.hxx:50
MacWrtProStructuresInternal::State::State
State()
constructor
Definition: MacWrtProStructures.cxx:652
MWAWFont::boldBit
@ boldBit
Definition: MWAWFont.hxx:190
MacWrtProStructures::m_mainParser
MacWrtProParser & m_mainParser
the main parser
Definition: MacWrtProStructures.hxx:265
MWAWStream.hxx
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::BottomBit
@ BottomBit
Definition: libmwaw_internal.hxx:178
MWAWTabStop::CENTER
@ CENTER
Definition: MWAWParagraph.hxx:48
MacWrtProStructuresListenerState::numSection
int numSection() const
returns the actual section
Definition: MacWrtProStructures.hxx:92
MWAWEntry.hxx
MacWrtProStructuresListenerState::~MacWrtProStructuresListenerState
~MacWrtProStructuresListenerState()
the destructor
Definition: MacWrtProStructures.cxx:2859
MacWrtProStructuresInternal::Graphic::TEXT
@ TEXT
Definition: MacWrtProStructures.cxx:62
MacWrtProStructuresInternal::Page::m_extra
std::string m_extra
extra data
Definition: MacWrtProStructures.cxx:420
MacWrtProStructures::readGraphicII
bool readGraphicII(std::shared_ptr< MWAWStream > const &stream, int id, bool mainGraphic, MacWrtProStructuresInternal::Graphic &graphic)
try to read a graphic structure: II
Definition: MacWrtProStructures.cxx:1949
MWAWPosition::YCenter
@ YCenter
Definition: MWAWPosition.hxx:57
MWAWFontConverter.hxx
MacWrtProStructuresInternal::State::m_sectionsList
std::vector< Section > m_sectionsList
the list of section
Definition: MacWrtProStructures.cxx:712
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:526
MacWrtProStructures::readParagraphs
bool readParagraphs(std::shared_ptr< MWAWStream > &stream)
try to read a list of paragraph
Definition: MacWrtProStructures.cxx:1444
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
MacWrtProStructuresInternal::Graphic::m_lastFlag
int m_lastFlag
the last flag
Definition: MacWrtProStructures.cxx:357
MWAWGraphicStyle::setBackgroundColor
void setBackgroundColor(MWAWColor const &col, float opacity=1)
set the background color
Definition: MWAWGraphicStyle.hxx:447
MacWrtProStructuresInternal::Graphic::Type
Type
Definition: MacWrtProStructures.cxx:62
MacWrtProStructuresListenerState::m_numTab
int m_numTab
Definition: MacWrtProStructures.hxx:119
MacWrtProStructures::readSections
bool readSections(std::shared_ptr< MWAWStream > &stream, std::vector< MacWrtProStructuresInternal::Section > &sections)
try to read the section info ?
Definition: MacWrtProStructures.cxx:2437
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:85
MWAWPosition::WDynamic
@ WDynamic
Definition: MWAWPosition.hxx:53
MacWrtProStructuresInternal::Graphic::UNKNOWN
@ UNKNOWN
Definition: MacWrtProStructures.cxx:62
MacWrtProStructuresInternal::Font
Internal: the fonts.
Definition: MacWrtProStructures.cxx:428
MacWrtProStructuresInternal::Page::Page
Page()
the constructor
Definition: MacWrtProStructures.cxx:400
MWAWFont::Line::Simple
@ Simple
Definition: MWAWFont.hxx:49
MacWrtProStructuresInternal::Section::m_textLength
long m_textLength
the number of character in the sections
Definition: MacWrtProStructures.cxx:643
MWAWHeaderFooter::m_subDocument
MWAWSubDocumentPtr m_subDocument
the document data
Definition: MWAWPageSpan.hxx:92
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:495
MacWrtProStructuresInternal::Graphic::getPosition
MWAWPosition getPosition() const
Definition: MacWrtProStructures.cxx:276
MWAWCell::setBackgroundColor
void setBackgroundColor(MWAWColor color)
sets the background color
Definition: MWAWCell.hxx:332
MacWrtProStructuresInternal::Graphic::m_isHeader
bool m_isHeader
filled for header/footer
Definition: MacWrtProStructures.cxx:379
MacWrtProStructuresInternal::Graphic::m_headerFooterFlag
int m_headerFooterFlag
the header footer flag
Definition: MacWrtProStructures.cxx:348
MacWrtProStructuresListenerState::m_version
int m_version
Definition: MacWrtProStructures.hxx:113
MacWrtProStructuresInternal::Paragraph::Paragraph
Paragraph(Paragraph const &)=default
MacWrtProStructuresInternal::Graphic::m_col
int m_col
number of columns, filled for table
Definition: MacWrtProStructures.cxx:385
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:2885
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
MacWrtProParser::convertDateToDebugString
static std::string convertDateToDebugString(unsigned date)
convert a date in a string (for debugging)
Definition: MacWrtProParser.cxx:1765
MacWrtProStructuresInternal::State::m_tablesMap
std::map< int, std::shared_ptr< Table > > m_tablesMap
a map graphic id -> table
Definition: MacWrtProStructures.cxx:716
MacWrtProParser::parseDataZone
bool parseDataZone(int blockId, int type)
parse a data zone
Definition: MacWrtProParser.cxx:953
MWAWTabStop::DECIMAL
@ 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:376
MacWrtProStructuresInternal::Graphic::NOTE
@ NOTE
Definition: MacWrtProStructures.cxx:62
MWAWFont::embossBit
@ embossBit
Definition: MWAWFont.hxx:190
MacWrtProStructuresInternal::Font::m_flags
int m_flags
some unknown flag
Definition: MacWrtProStructures.cxx:458
MacWrtProStructuresListenerState::send
bool send(int graphicId)
try to send a graphic which corresponds to graphicid
Definition: MacWrtProStructures.cxx:2869
MacWrtProParser::sendEmptyFrameZone
bool sendEmptyFrameZone(MWAWPosition const &pos, MWAWGraphicStyle const &style)
try to send an empty zone (can exist in MacWrtPro1.5)
Definition: MacWrtProParser.cxx:1319
MWAWHeaderFooter
a class which stores the header/footer data
Definition: MWAWPageSpan.hxx:45
MacWrtProStructuresInternal::Graphic::m_column
int m_column
the number of columns
Definition: MacWrtProStructures.cxx:351
MWAWFont::uppercaseBit
@ uppercaseBit
Definition: MWAWFont.hxx:192
MacWrtProStructuresInternal::Table::~Table
~Table() final
destructor
Definition: MacWrtProStructures.cxx:555
MWAWCell.hxx
Defines MWAWCell (cell content and format)
MacWrtProStructuresListenerState::m_structures
std::shared_ptr< MacWrtProStructures > m_structures
Definition: MacWrtProStructures.hxx:127
MacWrtProStructures::~MacWrtProStructures
virtual ~MacWrtProStructures()
destructor
Definition: MacWrtProStructures.cxx:742
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
MWAWParagraph::NoBreakBit
@ NoBreakBit
Definition: MWAWParagraph.hxx:88
MacWrtProStructuresInternal::Graphic::m_attachment
bool m_attachment
true if this is an attachment 1.0 or 1.5
Definition: MacWrtProStructures.cxx:332
MacWrtProStructuresInternal::Graphic::hasBorders
bool hasBorders() const
Definition: MacWrtProStructures.cxx:265
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
MacWrtProStructuresInternal::Cell::Cell
Cell(MacWrtProStructures &parser, Graphic *graphic)
constructor
Definition: MacWrtProStructures.cxx:497
MWAWParagraph::AtLeast
@ AtLeast
Definition: MWAWParagraph.hxx:94
MacWrtProStructures::m_state
std::shared_ptr< MacWrtProStructuresInternal::State > m_state
the state
Definition: MacWrtProStructures.hxx:268
MWAWFont::m_extra
std::string m_extra
extra data
Definition: MWAWFont.hxx:573
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:708
MacWrtProStructures::m_asciiName
std::string m_asciiName
the debug file name
Definition: MacWrtProStructures.hxx:271
MacWrtProStructuresInternal::Graphic
Internal: the graphic structure.
Definition: MacWrtProStructures.cxx:61
MWAWParagraph::JustificationCenter
@ JustificationCenter
Definition: MWAWParagraph.hxx:90
MWAWFont::shadowBit
@ shadowBit
Definition: MWAWFont.hxx:191
MWAWParagraph.hxx
MacWrtProStructures::readStructB
bool readStructB(std::shared_ptr< MWAWStream > &stream)
try to read a zone which follow the fonts zone(checkme)
Definition: MacWrtProStructures.cxx:2633
MacWrtProParser::findNumHardBreaks
int findNumHardBreaks(int blockId)
compute the number of hard page break
Definition: MacWrtProParser.cxx:1331
MacWrtProParser::sendTextBoxZone
bool sendTextBoxZone(int blockId, MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
send a textbox zone
Definition: MacWrtProParser.cxx:1376
libmwaw::Bottom
@ Bottom
Definition: libmwaw_internal.hxx:176
MacWrtProStructuresListenerState::m_actTab
int m_actTab
Definition: MacWrtProStructures.hxx:117
MacWrtProStructures::buildTableStructures
void buildTableStructures()
look for tables structures and if so, prepare data
Definition: MacWrtProStructures.cxx:1186
MWAWPosition.hxx
MacWrtProStructuresInternal::State
Internal: the state of a MacWrtProStructures.
Definition: MacWrtProStructures.cxx:650
MacWrtProStructuresInternal::Table::get
Cell * get(int id)
return a cell corresponding to id
Definition: MacWrtProStructures.cxx:545
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
MacWrtProStructuresListenerState::m_numCols
int m_numCols
Definition: MacWrtProStructures.hxx:123
MacWrtProStructuresInternal::Section::numColumns
int numColumns() const
return the number of columns
Definition: MacWrtProStructures.cxx:593
MWAWBorder
a border
Definition: libmwaw_internal.hxx:333
MWAWSection::m_columns
std::vector< Column > m_columns
the different column
Definition: MWAWSection.hxx:108
MacWrtProStructures::readFontsDef
bool readFontsDef(std::shared_ptr< MWAWStream > &stream)
try to read the list of fonts
Definition: MacWrtProStructures.cxx:1309
MacWrtProStructuresInternal::Section::S_Page
@ S_Page
Definition: MacWrtProStructures.cxx:562
MacWrtProStructures::send
bool send(int graphicId, bool mainZone=false)
try to send a graphic which corresponds to graphicid
Definition: MacWrtProStructures.cxx:2688
MacWrtProStructuresInternal::Font::Font
Font()
the constructor
Definition: MacWrtProStructures.cxx:430
MWAWPosition::m_wrapping
Wrapping m_wrapping
Wrapping.
Definition: MWAWPosition.hxx:278
MWAWGraphicStyle::setBorders
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWGraphicStyle.cxx:232
MacWrtProStructures::readPagesListII
bool readPagesListII(std::shared_ptr< MWAWStream > const &stream, int numPages)
try to parse the list of page: II
Definition: MacWrtProStructures.cxx:1874
MWAWTable
a class used to recreate the table structure using cell informations, ....
Definition: MWAWTable.hxx:52
MacWrtProStructuresInternal::State::m_graphicsSendSet
std::set< MWAWVec2i > m_graphicsSendSet
a list of graphic use to avoid potential loop in bad file
Definition: MacWrtProStructures.cxx:724
libmwaw::RightBit
@ RightBit
Definition: libmwaw_internal.hxx:178
MacWrtProStructures::readSelection
bool readSelection(std::shared_ptr< MWAWStream > &stream)
try to read a 16 bytes the zone which follow the char styles zone ( the selection?...
Definition: MacWrtProStructures.cxx:2561
MWAWVec2< float >
MWAWFont::size
float size() const
returns the font size
Definition: MWAWFont.hxx:270
MacWrtProStructuresInternal::Paragraph::Paragraph
Paragraph()
Constructor.
Definition: MacWrtProStructures.cxx:469
MWAWHeaderFooter::ODD
@ ODD
Definition: MWAWPageSpan.hxx:50
MWAWTabStop::m_alignment
Alignment m_alignment
the alignment ( left, center, ...)
Definition: MWAWParagraph.hxx:76
MWAWSection
a class which stores section properties
Definition: MWAWSection.hxx:46
MWAWDebug.hxx
MacWrtProStructuresInternal::Cell::sendContent
bool sendContent(MWAWListenerPtr listener, MWAWTable &) final
send the content
Definition: MacWrtProStructures.cxx:516
MacWrtProStructuresInternal::Paragraph::operator=
Paragraph & operator=(Paragraph const &)=default
MacWrtProStructuresListenerState::m_isMainZone
bool m_isMainZone
Definition: MacWrtProStructures.hxx:111
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::Graphic::m_colSeparator
float m_colSeparator
the columns separator
Definition: MacWrtProStructures.cxx:353
MacWrtProStructuresInternal::Table::Table
Table()
constructor
Definition: MacWrtProStructures.cxx:539
MacWrtProStructuresInternal::Graphic::isText
bool isText() const
returns true is this is a text zone (or a not)
Definition: MacWrtProStructures.cxx:247
MacWrtProStructuresListenerState::m_actPage
int m_actPage
Definition: MacWrtProStructures.hxx:115
MacWrtProStructures::readParagraph
bool readParagraph(std::shared_ptr< MWAWStream > &stream, MacWrtProStructuresInternal::Paragraph &para)
try to read a paragraph
Definition: MacWrtProStructures.cxx:1494
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
MacWrtProStructuresInternal::Graphic::isTable
bool isTable() const
returns true is this is a table zone
Definition: MacWrtProStructures.cxx:252
MacWrtProStructuresInternal::Font::operator<<
friend std::ostream & operator<<(std::ostream &o, Font const &font)
operator<<
Definition: MacWrtProStructures.cxx:438
MacWrtProStructuresInternal::Graphic::m_type
int m_type
the type
Definition: MacWrtProStructures.cxx:320
MacWrtProStructuresInternal::Page
Internal: a page.
Definition: MacWrtProStructures.cxx:398
MacWrtProParser::sendPictureZone
bool sendPictureZone(int blockId, MWAWPosition const &pictPos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
try to send a picture
Definition: MacWrtProParser.cxx:1601
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
MacWrtProStructuresListenerState::isSent
bool isSent(int graphicId)
returns true if the graphic is already sent ( or does not exists)
Definition: MacWrtProStructures.cxx:2863
MacWrtProStructuresInternal::Graphic::m_page
int m_page
the page (if absolute)
Definition: MacWrtProStructures.cxx:335
MacWrtProStructuresInternal::Graphic::hasSameBorders
bool hasSameBorders() const
Definition: MacWrtProStructures.cxx:256
MacWrtProStructuresInternal::Page::m_graphicsList
std::vector< std::shared_ptr< Graphic > > m_graphicsList
the graphic list
Definition: MacWrtProStructures.cxx:418
MacWrtProStructures::MacWrtProStructures
MacWrtProStructures(MacWrtProParser &mainParser)
constructor
Definition: MacWrtProStructures.cxx:733
MacWrtProStructuresInternal
Internal: the structures of a MacWrtProStructures.
Definition: MacWrtProStructures.cxx:59
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:637
MWAWHeaderFooter::FOOTER
@ FOOTER
Definition: MWAWPageSpan.hxx:48
MWAWPosition::Char
@ Char
Definition: MWAWPosition.hxx:51
MacWrtProStructuresInternal::State::m_footersMap
std::map< int, int > m_footersMap
a map page -> footer id
Definition: MacWrtProStructures.cxx:722
MacWrtProStructuresListenerState::getPageBreaksPos
std::vector< int > getPageBreaksPos() const
return a list of page break position ( as some page break are soft )
Definition: MacWrtProStructures.cxx:2916
MacWrtProStructuresListenerState::m_newPageDone
bool m_newPageDone
Definition: MacWrtProStructures.hxx:125
MacWrtProParser::sendTextZone
bool sendTextZone(int blockId, bool mainZone=false)
send a text box
Definition: MacWrtProParser.cxx:1365
MacWrtProStructures::readGraphicsList
bool readGraphicsList(std::shared_ptr< MWAWStream > &stream, int nuumPages)
try to read the list of graphic entries: 1.0 1.5
Definition: MacWrtProStructures.cxx:2076
libmwaw::Top
@ Top
Definition: libmwaw_internal.hxx:176
MacWrtProStructuresInternal::Section::S_PageRight
@ S_PageRight
Definition: MacWrtProStructures.cxx:562
MacWrtProStructuresInternal::Section::operator<<
friend std::ostream & operator<<(std::ostream &o, Section const &sec)
operator<<
Definition: MacWrtProStructures.cxx:599
MacWrtProStructuresInternal::Graphic::m_borderWList
double m_borderWList[4]
the borders width
Definition: MacWrtProStructures.cxx:364
MWAWHeader.hxx
Defines MWAWHeader (document's type, version, kind)
MacWrtProParserInternal::SubDocument
Internal: the subdocument of a MacWrtProParser.
Definition: MacWrtProParser.cxx:255
MWAWFont::setSize
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:275
MWAWHeaderFooter::ALL
@ ALL
Definition: MWAWPageSpan.hxx:50
MacWrtProStructures::readFontsName
bool readFontsName(std::shared_ptr< MWAWStream > &stream)
try to read the fonts zone
Definition: MacWrtProStructures.cxx:1243
MacWrtProStructuresListenerState::sendChar
void sendChar(char c)
send a character
Definition: MacWrtProStructures.cxx:2939
MacWrtProStructuresInternal::Paragraph::operator=
Paragraph & operator=(Paragraph &&)=default
MacWrtProStructuresInternal::State::m_headersMap
std::map< int, int > m_headersMap
a map page -> header id
Definition: MacWrtProStructures.cxx:720
MWAWBorder::Double
@ Double
Definition: libmwaw_internal.hxx:337
libmwaw::LeftBit
@ LeftBit
Definition: libmwaw_internal.hxx:178
MacWrtProStructuresInternal::Section::S_Line
@ S_Line
Definition: MacWrtProStructures.cxx:562
MacWrtProStructuresInternal::Section::m_extra
std::string m_extra
extra data
Definition: MacWrtProStructures.cxx:645
MacWrtProStructuresInternal::Graphic::m_textboxCellType
int m_textboxCellType
filled for textbox : 0: unknown/textbox, 1: cell, 2: textbox(opened)
Definition: MacWrtProStructures.cxx:388
MacWrtProStructuresInternal::Section::getSection
MWAWSection getSection() const
returns a MWAWSection
Definition: MacWrtProStructures.cxx:575
MWAWFont::italicBit
@ italicBit
Definition: MWAWFont.hxx:190
MacWrtProStructuresInternal::Graphic::m_version
int m_version
the version
Definition: MacWrtProStructures.cxx:317
MacWrtProStructuresListenerState::sendParagraph
bool sendParagraph(int id)
try to send a paragraph
Definition: MacWrtProStructures.cxx:3028
MacWrtProStructuresInternal::Font::m_font
MWAWFont m_font
the font
Definition: MacWrtProStructures.cxx:456
MacWrtProStructuresInternal::Section::Section
Section()
constructor
Definition: MacWrtProStructures.cxx:565
MacWrtProStructures::readString
static bool readString(MWAWInputStreamPtr input, std::string &res)
try to read a string
Definition: MacWrtProStructures.cxx:2600
MacWrtProStructures::version
int version() const
returns the file version.
Definition: MacWrtProStructures.cxx:751
MacWrtProStructuresInternal::Graphic::m_textPos
int m_textPos
filled for pagebreak pos
Definition: MacWrtProStructures.cxx:341
MWAWTextListener.hxx
Defines MWAWTextListener: the libmwaw word processor listener.
MacWrtProStructuresListenerState::m_section
int m_section
Definition: MacWrtProStructures.hxx:121
MacWrtProStructuresInternal::Table
Definition: MacWrtProStructures.cxx:537
MacWrtProStructures::readStyles
bool readStyles(std::shared_ptr< MWAWStream > &stream)
try to read the paragraph styles zone which begins at address 0x200
Definition: MacWrtProStructures.cxx:1738
MacWrtProStructuresInternal::Graphic::isGraphic
bool isGraphic() const
returns true is this is a graphic zone
Definition: MacWrtProStructures.cxx:242
MacWrtProStructuresInternal::Font::m_values
int m_values[5]
unknown values
Definition: MacWrtProStructures.cxx:462
libmwaw::Right
@ Right
Definition: libmwaw_internal.hxx:176
MacWrtProStructuresInternal::State::m_numPages
int m_numPages
the number of pages
Definition: MacWrtProStructures.cxx:700
MacWrtProStructures::sendMainZone
bool sendMainZone()
send the main zone
Definition: MacWrtProStructures.cxx:1091
MWAWPosition::Page
@ Page
Definition: MWAWPosition.hxx:51
MWAWParagraph::JustificationFull
@ JustificationFull
Definition: MWAWParagraph.hxx:90
MWAWSection.hxx
MWAWParagraph::JustificationRight
@ JustificationRight
Definition: MWAWParagraph.hxx:91
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:557
MacWrtProStructuresInternal::Graphic::operator<<
friend std::ostream & operator<<(std::ostream &o, Graphic const &bl)
operator<<
Definition: MacWrtProStructures.cxx:96
libmwaw::TopBit
@ TopBit
Definition: libmwaw_internal.hxx:178
MWAWBox2::min
MWAWVec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:1039
MacWrtProStructures
the main class to read the structures part of MacWrite Pro file
Definition: MacWrtProStructures.hxx:136
MWAWCell::setBorders
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWCell.cxx:382
MacWrtProStructuresInternal::Graphic::m_contentType
Type m_contentType
the type 1.0 or 1.5
Definition: MacWrtProStructures.cxx:323
MacWrtProStructuresListenerState::sendSection
void sendSection(int numSection)
try to send the i^th section
Definition: MacWrtProStructures.cxx:3043
MWAWBorder::m_extra
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:395
MWAWFont::Script::super
static Script super()
return a yposition which correspond to a basic superscript
Definition: MWAWFont.hxx:130
MWAWPosition::YTop
@ 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::readFont
bool readFont(std::shared_ptr< MWAWStream > &stream, MacWrtProStructuresInternal::Font &font)
try to read a font
Definition: MacWrtProStructures.cxx:1356
MacWrtProStructuresInternal::Cell::~Cell
~Cell() final
destructor
Definition: MacWrtProStructures.cxx:531
libmwaw::Left
@ Left
Definition: libmwaw_internal.hxx:176
MWAWBox2::size
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1067
MacWrtProStructuresInternal::Graphic::m_row
int m_row
number of row, filled for table
Definition: MacWrtProStructures.cxx:382
MacWrtProStructuresInternal::Graphic::m_fileBlock
int m_fileBlock
the file block id
Definition: MacWrtProStructures.cxx:326
MacWrtProStructuresInternal::Graphic::m_baseline
float m_baseline
the baseline ( in point 0=bottom aligned)
Definition: MacWrtProStructures.cxx:370
MacWrtProStructures::readCharStyles
bool readCharStyles(std::shared_ptr< MWAWStream > &stream)
try to read the character styles zone
Definition: MacWrtProStructures.cxx:1650
MacWrtProStructuresInternal::State::m_version
int m_version
the file version
Definition: MacWrtProStructures.cxx:697
MWAWPosition::WRunThrough
@ WRunThrough
Definition: MWAWPosition.hxx:53
MacWrtProStructures::readGraphic
std::shared_ptr< MacWrtProStructuresInternal::Graphic > readGraphic(std::shared_ptr< MWAWStream > &stream)
try to read a graphic entry: 1.0, 1.5
Definition: MacWrtProStructures.cxx:2162
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:106
MWAWFont::Line::Double
@ Double
Definition: MWAWFont.hxx:51
MWAWPosition::XLeft
@ XLeft
Definition: MWAWPosition.hxx:55
MWAWPosition::YBottom
@ YBottom
Definition: MWAWPosition.hxx:57
MacWrtProStructuresInternal::Page::operator<<
friend std::ostream & operator<<(std::ostream &o, Page const &bl)
operator<<
Definition: MacWrtProStructures.cxx:408
MWAWInputStream.hxx
MacWrtProStructuresInternal::Section::S_PageLeft
@ S_PageLeft
Definition: MacWrtProStructures.cxx:562
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:289
MacWrtProStructuresInternal::State::m_idGraphicMap
std::map< int, std::shared_ptr< Graphic > > m_idGraphicMap
a map graphic id -> graphic
Definition: MacWrtProStructures.cxx:718
MWAWListenerPtr
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:553
MWAWFont.hxx
MacWrtProStructuresInternal::Graphic::m_surfaceColor
MWAWColor m_surfaceColor
the background color
Definition: MacWrtProStructures.cxx:373
MacWrtProStructuresInternal::Paragraph
Internal: class to store the paragraph properties.
Definition: MacWrtProStructures.cxx:467
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:3014
MacWrtProStructuresInternal::Graphic::m_lineBorder
MWAWBorder m_lineBorder
the line border
Definition: MacWrtProStructures.cxx:376
MacWrtProStructures::createZones
bool createZones(std::shared_ptr< MWAWStream > &stream, int numPages)
finds the different objects zones
Definition: MacWrtProStructures.cxx:921
MWAWTabStop::RIGHT
@ RIGHT
Definition: MWAWParagraph.hxx:48
MWAWBox2< float >
MacWrtProStructuresInternal::Section::m_headerIds
int m_headerIds[2]
the header graphic ids
Definition: MacWrtProStructures.cxx:639
MacWrtProParserInternal
Internal: the structures of a MacWrtProParser.
Definition: MacWrtProParser.cxx:62
MacWrtProStructuresInternal::Page::m_send
bool m_send
true if we have send the data
Definition: MacWrtProStructures.cxx:423
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
MacWrtProStructuresInternal::Paragraph::m_value
int m_value
a unknown value
Definition: MacWrtProStructures.cxx:486
MWAWCell
a structure used to define a cell and its format
Definition: MWAWCell.hxx:53
MWAWFont::setLanguage
void setLanguage(std::string const &lang)
set the language ( in the for en_US, en_GB, en, ...)
Definition: MWAWFont.hxx:500
MWAWBox2::max
MWAWVec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:1044
MacWrtProStructuresInternal::State::m_graphicsList
std::vector< std::shared_ptr< Graphic > > m_graphicsList
the list of graphic
Definition: MacWrtProStructures.cxx:714
MacWrtProStructures::buildPageStructures
void buildPageStructures()
look for pages structures
Definition: MacWrtProStructures.cxx:1121
MWAWBorder::m_color
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:393
MacWrtProStructuresListenerState::insertSoftPageBreak
void insertSoftPageBreak()
insert a page break ( if we are not on a new page )
Definition: MacWrtProStructures.cxx:2879
MacWrtProParser
the main class to read a MacWrite II and MacWrite Pro file
Definition: MacWrtProParser.hxx:68
libmwaw::DebugStream
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
MWAWParagraph::NoBreakWithNextBit
@ NoBreakWithNextBit
Definition: MWAWParagraph.hxx:88
MacWrtProStructuresInternal::Graphic::m_id
int m_id
the graphic id
Definition: MacWrtProStructures.cxx:329
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 graphic ids
Definition: MacWrtProStructures.cxx:641
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:99
MacWrtProStructures::createZonesII
bool createZonesII(std::shared_ptr< MWAWStream > &stream, int numPages)
finds the different objects zones in a MacWriteII file
Definition: MacWrtProStructures.cxx:1024
MacWrtProStructuresInternal::Paragraph::~Paragraph
~Paragraph() final
destructor
Definition: MacWrtProStructures.cxx:489
MacWrtProStructures::numPages
int numPages() const
returns the number of pages
Definition: MacWrtProStructures.cxx:763
MacWrtProStructuresInternal::Graphic::GRAPHIC
@ GRAPHIC
Definition: MacWrtProStructures.cxx:62
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:325
MacWrtProStructuresInternal::Graphic::fillFrame
void fillFrame(MWAWGraphicStyle &style) const
update the style to include frame style
Definition: MacWrtProStructures.cxx:225
MWAWFont::lowercaseBit
@ lowercaseBit
Definition: MWAWFont.hxx:193
MacWrtProStructuresInternal::Graphic::getRelativeYPos
MWAWPosition::YPos getRelativeYPos() const
Definition: MacWrtProStructures.cxx:293
MacWrtProStructures.hxx
MacWrtProStructuresInternal::Graphic::m_textboxType
int m_textboxType
the header footer type
Definition: MacWrtProStructures.cxx:346
MacWrtProStructures::init
void init()
inits all internal variables
Definition: MacWrtProStructures.cxx:746

Generated on Fri Sep 18 2020 18:14:52 for libmwaw by doxygen 1.8.20