WPS4Text.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3  * Version: MPL 2.0 / LGPLv2.1+
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Major Contributor(s):
10  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
11  * Copyright (C) 2006, 2007 Andrew Ziem
12  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
14  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
15  *
16  * For minor contributions see the git repository.
17  *
18  * Alternatively, the contents of this file may be used under the terms
19  * of the GNU Lesser General Public License Version 2.1 or later
20  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
21  * applicable instead of those above.
22  *
23  * For further information visit http://libwps.sourceforge.net
24  */
25 
26 #ifndef WPS4_TEXT_H
27 #define WPS4_TEXT_H
28 
29 #include <vector>
30 
31 #include "libwps_internal.h"
32 #include "libwps_tools_win.h"
33 
34 #include "WPSEntry.h"
35 #include "WPSDebug.h"
36 #include "WPSTextParser.h"
37 
38 class WPS4Parser;
39 namespace WPS4TextInternal
40 {
41 struct Font;
42 struct State;
43 }
44 
64 class WPS4Text : public WPSTextParser
65 {
66  friend class WPS4Parser;
67 
68 public:
70  WPS4Text(WPS4Parser &parser, RVNGInputStreamPtr &input);
71 
73  ~WPS4Text() override;
74 
77  {
78  m_listener = listen;
79  }
80 
82  int numPages() const;
83 
85  void flushExtra();
86 
90  void sendObjects(int page);
91 protected:
94  {
95  return reinterpret_cast<WPS4Parser &>(m_mainParser);
96  }
98  WPS4Parser const &mainParser() const
99  {
100  return reinterpret_cast<WPS4Parser const &>(m_mainParser);
101  }
102 
105 
107  WPSEntry getHeaderEntry() const;
108 
110  WPSEntry getFooterEntry() const;
111 
113  WPSEntry getMainTextEntry() const;
114 
116  bool readText(WPSEntry const &entry);
117 
119  bool readEntries();
121  bool readStructures();
122 
123 protected:
124  //----------------------------------------
125  // FDP parsing
126  //----------------------------------------
127 
130  bool findFDPStructures(int which);
133  bool findFDPStructuresByHand(int which);
134 
135  //----------------------------------------
136  // PLC parsing, setting
137  //----------------------------------------
138 
146  typedef bool (WPS4Text::* DataParser)
147  (long bot, long eot, int id, long endPos, std::string &mess);
148 
155  bool readPLC(WPSEntry const &zone,
156  std::vector<long> &textPtrs, std::vector<long> &listValues,
157  DataParser parser = nullptr);
158 
160  bool defDataParser(long bot, long eot, int id, long endPos, std::string &mess);
161 
163  bool readFontNames(WPSEntry const &entry);
164 
166  bool readFont(long endPos, int &id, std::string &mess);
167 
169  bool readParagraph(long endPos, int &id, std::string &mess);
170 
172  bool readDosLink(WPSEntry const &entry);
173 
175  bool objectDataParser(long bot, long eot, int id,
176  long endPos, std::string &mess);
177 
179  bool readFootNotes(WPSEntry const &ftnD, WPSEntry const &ftnP);
180 
182  bool footNotesDataParser(long bot, long eot, int id, long endPos, std::string &mess);
183 
185  bool bkmkDataParser(long bot, long eot, int id, long endPos, std::string &mess);
186 
188  bool dttmDataParser(long bot, long eot, int id, long endPos, std::string &mess);
189 
190 protected:
193 
195  mutable std::shared_ptr<WPS4TextInternal::State> m_state;
196 };
197 #endif
198 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPS4PLCInternal::KnownPLC
a map of known plc
Definition: WPS4Text.cpp:67
WPS4Parser::createNote
void createNote(WPSEntry const &entry, librevenge::RVNGString const &label)
creates a document for a footnote entry with label and then send the data
Definition: WPS4.cpp:366
WPS4TextInternal::FontName::m_type
libwps_tools_win::Font::Type m_type
font encoding type
Definition: WPS4Text.cpp:107
WPSParagraph.h
WPS4TextInternal::Z_Unknown
@ Z_Unknown
Definition: WPS4Text.cpp:89
WPSPosition::WNone
@ WNone
Definition: WPSPosition.h:45
WPS4TextInternal::Note::operator=
Note & operator=(Note const &)=default
WPS4TextInternal::Font::operator<<
friend std::ostream & operator<<(std::ostream &o, Font const &ft)
operator<<
Definition: WPS4Text.cpp:193
WPSFont::m_extra
std::string m_extra
public field use to add a message when the font is printed
Definition: WPSFont.h:96
WPS4TextInternal::DateTime::m_type
int m_type
the type
Definition: WPS4Text.cpp:356
WPS4TextInternal::DataPLC::m_value
long m_value
a potential value
Definition: WPS4Text.cpp:451
WPSField
a field
Definition: libwps_internal.h:463
WPSParagraph::m_justify
libwps::Justification m_justify
the justification
Definition: WPSParagraph.h:116
WPS4Text::getMainTextEntry
WPSEntry getMainTextEntry() const
returns the main text entry (if such entry exists, if not returns an invalid entry)
Definition: WPS4Text.cpp:607
WPS4PLCInternal::PLC::operator=
PLC & operator=(PLC const &orig)=default
WPS_STRIKEOUT_BIT
#define WPS_STRIKEOUT_BIT
Definition: libwps_internal.h:507
WPS4TextInternal::FontName::operator<<
friend std::ostream & operator<<(std::ostream &o, FontName const &ft)
operator<<
Definition: WPS4Text.cpp:110
WPS4Parser::setSizeFile
void setSizeFile(long sz)
sets the file size ( filled by WPS4Text )
Definition: WPS4.cpp:242
WPSTextParser::DataFOD::m_type
Type m_type
the type of the attribute
Definition: WPSTextParser.h:84
WPSParagraph::m_listLevelIndex
int m_listLevelIndex
the actual level index
Definition: WPSParagraph.h:121
libwps::DebugStream::str
static std::string str()
Definition: WPSDebug.h:200
WPSField::PageNumber
@ PageNumber
Definition: libwps_internal.h:465
WPSTextParser.h
WPS_BOLD_BIT
#define WPS_BOLD_BIT
Definition: libwps_internal.h:506
WPSBorder::Simple
@ Simple
Definition: libwps_internal.h:397
libwps::DebugFile::addPos
static void addPos(long)
Definition: WPSDebug.h:220
WPSPosition::XCenter
@ XCenter
Definition: WPSPosition.h:47
WPSEntry::end
long end() const
returns the end offset
Definition: WPSEntry.h:78
WPS4Text::findFDPStructures
bool findFDPStructures(int which)
finds the FDPC/FDPP structure using the BTEC/BTEP entries
Definition: WPS4Text.cpp:1257
WPS4Parser::getColor
bool getColor(int id, WPSColor &color) const
color
Definition: WPS4.cpp:206
WPS4Text::objectDataParser
bool objectDataParser(long bot, long eot, int id, long endPos, std::string &mess)
reads a object properties ( position in text, size and definition in file)
Definition: WPS4Text.cpp:2303
WPSTextParser::DataFOD
structure which retrieves data information which correspond to a text position
Definition: WPSTextParser.h:67
WPS4Text::setListener
void setListener(WPSContentListenerPtr &listen)
sets the listener
Definition: WPS4Text.h:76
WPSEntry::setLength
void setLength(long l)
sets the zone size
Definition: WPSEntry.h:62
WPSParagraph::m_margins
double m_margins[3]
the margins
Definition: WPSParagraph.h:101
libwps_tools_win::Font::Type
Type
enum Type
Definition: libwps_tools_win.h:46
WPSTextParser::m_mainParser
WPSParser & m_mainParser
pointer to the main zone parser;
Definition: WPSTextParser.h:130
WPS_SUBSCRIPT_BIT
#define WPS_SUBSCRIPT_BIT
Definition: libwps_internal.h:500
WPS4Text::~WPS4Text
~WPS4Text() override
destructor
Definition: WPS4Text.cpp:540
WPS4TextInternal::Z_Note
@ Z_Note
Definition: WPS4Text.cpp:89
WPS4PLCInternal::PLC::P_ABS
@ P_ABS
Definition: WPS4Text.cpp:2449
WPS4Parser::numColumns
int numColumns() const
returns the number of columns
Definition: WPS4.cpp:189
WPS_UNDERLINE_BIT
#define WPS_UNDERLINE_BIT
Definition: libwps_internal.h:508
WPSField::Title
@ Title
Definition: libwps_internal.h:465
WPS4Text::dttmDataParser
bool dttmDataParser(long bot, long eot, int id, long endPos, std::string &mess)
reads a date time property
Definition: WPS4Text.cpp:2390
WPS4PLCInternal::PLC::T_UNKNOWN
@ T_UNKNOWN
Definition: WPS4Text.cpp:2454
WPSTabStop::CENTER
@ CENTER
Definition: WPSParagraph.h:39
WPSContentListenerPtr
std::shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:107
WPS4Text::readEntries
bool readEntries()
finds all text entries (TEXT, SHdr, SFtr, BTEC, BTEP, FTNp, FTNp, BKMK, FONT, CHRT)
Definition: WPS4Text.cpp:1024
WPSBorder::Single
@ Single
Definition: libwps_internal.h:399
libwps::BULLET
@ BULLET
Definition: libwps_internal.h:246
WPS4Text::footNotesDataParser
bool footNotesDataParser(long bot, long eot, int id, long endPos, std::string &mess)
reads a book mark property ( string)
Definition: WPS4Text.cpp:2229
WPSTextParser::DataFOD::m_pos
long m_pos
the offset position of the text modified by this attribute
Definition: WPSTextParser.h:86
WPSBorder::BottomBit
@ BottomBit
Definition: libwps_internal.h:401
WPS4Parser::newPage
void newPage(int number)
adds a new page
Definition: WPS4.cpp:307
WPS_SUPERSCRIPT_BIT
#define WPS_SUPERSCRIPT_BIT
Definition: libwps_internal.h:499
WPSTextParser::m_textPositions
WPSEntry m_textPositions
an entry which corresponds to the complete text zone
Definition: WPSTextParser.h:132
WPS4TextInternal::Note::Note
Note(Note const &)=default
WPS4TextInternal::Z_Header
@ Z_Header
Definition: WPS4Text.cpp:89
WPS4TextInternal::FontName::getDosName
static librevenge::RVNGString getDosName(int id)
returns the default dos name corresponding to id th font
Definition: WPS4Text.cpp:120
WPS4TextInternal::OBJECT
@ OBJECT
Definition: WPS4Text.cpp:433
WPS4Text
The class which parses text zones in a pc MS Works document v1-4.
Definition: WPS4Text.h:65
WPSPosition::m_wrapping
Wrapping m_wrapping
Wrapping.
Definition: WPSPosition.h:249
WPSBorder::m_width
int m_width
the border width
Definition: libwps_internal.h:450
WPS4PLCInternal::PLC::m_textChar
unsigned char m_textChar
the character which appears in the text when this PLC is found
Definition: WPS4Text.cpp:2472
WPS4Text::getDefaultFont
WPS4TextInternal::Font getDefaultFont() const
returns the default font to use for the document
Definition: WPS4Text.cpp:612
WPS4TextInternal::State::m_dateTimeMap
std::map< long, DateTime > m_dateTimeMap
map: date field in text -> date time format
Definition: WPS4Text.cpp:517
libwps_tools_win::Font::unicodeString
static librevenge::RVNGString unicodeString(const unsigned char *p, unsigned long size, Type type, bool skipUnknown=true)
converts a list of character in unicode
Definition: libwps_tools_win.cpp:7283
WPS4TextInternal::DataPLC::m_name
std::string m_name
the entry field name
Definition: WPS4Text.cpp:447
WPS4TextInternal::Note::operator<<
friend std::ostream & operator<<(std::ostream &o, Note const &note)
operator <<
Definition: WPS4Text.cpp:227
WPSTabStop::Alignment
Alignment
Definition: WPSParagraph.h:39
WPS4TextInternal::Font::m_backColor
WPSColor m_backColor
background color index
Definition: WPS4Text.cpp:181
WPSColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libwps_internal.h:350
WPS4TextInternal::Z_Footer
@ Z_Footer
Definition: WPS4Text.cpp:89
WPSTextParser::getNameEntryMap
std::multimap< std::string, WPSEntry > & getNameEntryMap()
returns the map type->entry
Definition: WPSTextParser.cpp:58
WPS4TextInternal::DateTime
Internal: class to store a date/time format.
Definition: WPS4Text.cpp:345
WPSFont
define the font properties
Definition: WPSFont.h:37
WPS4TextInternal::State
Internal: the state of a WPS4Text.
Definition: WPS4Text.cpp:466
WPS4Text::readFootNotes
bool readFootNotes(WPSEntry const &ftnD, WPSEntry const &ftnP)
reads the footnotes positions and definitions ( zones FTNd and FTNp)
Definition: WPS4Text.cpp:2145
WPS4PLCInternal::PLC::PLCType
enum WPS4TextInternal::PLCType PLCType
the PLC types
Definition: WPS4Text.cpp:2444
WPSEntry::valid
bool valid(bool checkId=false) const
returns true if the zone length is positive
Definition: WPSEntry.h:89
WPS_ITALICS_BIT
#define WPS_ITALICS_BIT
Definition: libwps_internal.h:502
WPS4Text::readDosLink
bool readDosLink(WPSEntry const &entry)
reads the ZZDLink ( a list of filename )
Definition: WPS4Text.cpp:1624
WPS4TextInternal::FontName::FontName
FontName(libwps_tools_win::Font::Type type)
constructor with file's version to define the default encoding *‍/
Definition: WPS4Text.cpp:94
WPS4Text::readFont
bool readFont(long endPos, int &id, std::string &mess)
reads a font properties
Definition: WPS4Text.cpp:1482
WPSTabStop::RIGHT
@ RIGHT
Definition: WPSParagraph.h:39
WPSParagraph::m_listLevel
ListLevel m_listLevel
the actual level
Definition: WPSParagraph.h:123
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:39
WPS4PLCInternal::PLC::PLC
PLC(PLCType w=WPS4TextInternal::Unknown, Position p=P_UNKNOWN, Type t=T_UNKNOWN, unsigned char tChar='\0', int f=1)
constructor
Definition: WPS4Text.cpp:2457
WPS4PLCInternal::KnownPLC::createMapping
void createMapping()
creates the map of known PLC
Definition: WPS4Text.cpp:2494
WPS4TextInternal::Note::isNumeric
bool isNumeric() const
Definition: WPS4Text.cpp:222
WPSPosition::CharBaseLine
@ CharBaseLine
Definition: WPSPosition.h:43
WPS4TextInternal::Font::Font
Font(libwps_tools_win::Font::Type type)
constructor with file's version to define the default encoding *‍/
Definition: WPS4Text.cpp:151
WPS4TextInternal::State::m_objectMap
std::map< long, Object > m_objectMap
map: object in text -> object
Definition: WPS4Text.cpp:515
WPS4PLCInternal::PLC::Type
Type
the type of the content
Definition: WPS4Text.cpp:2454
WPS4TextInternal::PLCType
PLCType
different types
Definition: WPS4Text.cpp:433
WPS4Parser::getDefaultFontType
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition: WPS4.cpp:194
WPS4TextInternal::State::m_footnoteMap
std::map< long, Note const * > m_footnoteMap
map: footnote in text -> footnote entry
Definition: WPS4Text.cpp:503
WPS4TextInternal::Font::~Font
~Font() final
destructor
Definition: WPS4Text.cpp:188
WPS4Text::mainParser
WPS4Parser & mainParser()
return the main parser
Definition: WPS4Text.h:93
WPSParagraph::setInterline
void setInterline(double value, librevenge::RVNGUnit unit, LineSpacingType type=Fixed)
set the interline
Definition: WPSParagraph.h:87
WPS4Text::m_listener
WPSContentListenerPtr m_listener
the listener
Definition: WPS4Text.h:192
WPSBorder::m_color
WPSColor m_color
the border color
Definition: libwps_internal.h:456
WPSEntry::setId
void setId(int i)
sets the id
Definition: WPSEntry.h:163
WPS4TextInternal::DateTime::m_extra
std::string m_extra
a string used to store the parsing errors
Definition: WPS4Text.cpp:358
WPSTextParser::version
int version() const
returns the file version
Definition: WPSTextParser.cpp:51
WPSList::Level::m_type
libwps::NumberingType m_type
the type of the level
Definition: WPSList.h:98
WPSParagraph::m_borderStyle
WPSBorder m_borderStyle
the border style
Definition: WPSParagraph.h:131
WPS4TextInternal::State::m_paragraphList
std::vector< WPSParagraph > m_paragraphList
the list of all paragraph properties
Definition: WPS4Text.cpp:493
Vec2f
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:704
WPSPosition::setRelativePosition
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: WPSPosition.h:214
WPS4Parser::createDocument
void createDocument(WPSEntry const &entry, libwps::SubDocumentType type)
creates a document for a comment entry and then send the data
Definition: WPS4.cpp:353
WPSTabStop::LEFT
@ LEFT
Definition: WPSParagraph.h:39
WPS4TextInternal::State::m_main
WPSEntry m_main
the main text zone entry
Definition: WPS4Text.cpp:509
WPS4PLCInternal::PLC::m_type
PLCType m_type
PLC type.
Definition: WPS4Text.cpp:2464
WPS4PLCInternal::PLC::P_REL
@ P_REL
Definition: WPS4Text.cpp:2449
WPS4TextInternal::Note::m_label
librevenge::RVNGString m_label
the label if not numeric
Definition: WPS4Text.cpp:237
libwps::ParseException
Definition: libwps_internal.h:152
WPS4Text::bkmkDataParser
bool bkmkDataParser(long bot, long eot, int id, long endPos, std::string &mess)
reads a book mark property ( string)
Definition: WPS4Text.cpp:2267
Vec2< float >
WPS4TextInternal::State::m_knownPLC
WPS4PLCInternal::KnownPLC m_knownPLC
the known plc
Definition: WPS4Text.cpp:521
WPSBorder::TopBit
@ TopBit
Definition: libwps_internal.h:401
WPS_DEBUG_MSG
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
libwps::readU32
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:76
WPSTextParser::mergeSortedFODLists
std::vector< DataFOD > mergeSortedFODLists(std::vector< DataFOD > const &lst1, std::vector< DataFOD > const &lst2) const
function which takes two sorted list of attribute (by text position).
Definition: WPSTextParser.cpp:253
WPSFont::m_color
WPSColor m_color
the font color
Definition: WPSFont.h:91
WPS_FALLTHROUGH
#define WPS_FALLTHROUGH
fall through attributes
Definition: libwps_internal.h:82
WPSParagraph
class to store the paragraph properties
Definition: WPSParagraph.h:58
WPSEntry::setBegin
void setBegin(long off)
sets the begin offset
Definition: WPSEntry.h:57
WPS4Text::sendObjects
void sendObjects(int page)
send all the objects with page anchor corresponding given page
Definition: WPS4Text.cpp:567
WPS4TextInternal::Note::~Note
~Note() final
destructor
Definition: WPS4Text.cpp:242
WPSContentListener.h
WPS4TextInternal::Object::m_page
int m_page
the page
Definition: WPS4Text.cpp:263
WPSTextParser::DataFOD::ATTR_TEXT
@ ATTR_TEXT
Definition: WPSTextParser.h:74
Vec2::x
T x() const
first element
Definition: libwps_internal.h:542
WPS4TextInternal::Object::m_pos
WPSEntry m_pos
an entry which indicates where the object is defined in the file
Definition: WPS4Text.cpp:269
libwps_tools_win::Font::getTypeName
static librevenge::RVNGString getTypeName(Type type)
return the type name
Definition: libwps_tools_win.cpp:259
WPS4TextInternal::State::m_fontList
std::vector< Font > m_fontList
the list of all font properties
Definition: WPS4Text.cpp:491
WPS4TextInternal::Object::operator<<
friend std::ostream & operator<<(std::ostream &o, Object const &obj)
operator <<
Definition: WPS4Text.cpp:276
WPS4PLCInternal::PLC::P_UNKNOWN
@ P_UNKNOWN
Definition: WPS4Text.cpp:2449
libwps::DOC_COMMENT_ANNOTATION
@ DOC_COMMENT_ANNOTATION
Definition: libwps_internal.h:248
WPSTabStop::DECIMAL
@ DECIMAL
Definition: WPSParagraph.h:39
libwps_tools_win::Font::UNKNOWN
@ UNKNOWN
Definition: libwps_tools_win.h:63
libwps::appendUnicode
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string ( with correct encoding ).
Definition: libwps_internal.cpp:836
libwps::read32
int32_t read32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:85
WPS4TextInternal
Definition: WPS4Text.cpp:87
WPS4PLCInternal::KnownPLC::m_knowns
std::map< std::string, PLC > m_knowns
map name -> known PLC
Definition: WPS4Text.cpp:79
WPSEntry::setType
void setType(std::string const &tp)
sets the type of the entry: BTEP,FDPP, BTEC, FDPC, PLC , TEXT, ...
Definition: WPSEntry.h:126
WPSField::Date
@ Date
Definition: libwps_internal.h:465
WPSBorder::Dot
@ Dot
Definition: libwps_internal.h:397
WPSFont.h
WPSTextParser::m_FODList
std::vector< DataFOD > m_FODList
the list of a FOD
Definition: WPSTextParser.h:134
WPS4TextInternal::Font::Font
Font(Font const &)=default
WPSTextParser::DataFOD::ATTR_UNKN
@ ATTR_UNKN
Definition: WPSTextParser.h:74
WPS4TextInternal::Note::Note
Note()
constructor
Definition: WPS4Text.cpp:214
WPSBorder::RightBit
@ RightBit
Definition: libwps_internal.h:401
WPSEntry.h
WPS4TextInternal::DateTime::format
std::string format() const
returns a format to used with strftime
Definition: WPS4Text.cpp:361
WPSFont::m_attributes
uint32_t m_attributes
the font attributes defined as a set of bits
Definition: WPSFont.h:87
WPS4TextInternal::Note
Internal: class to store an note type.
Definition: WPS4Text.cpp:212
WPS4TextInternal::Object::m_origin
Vec2f m_origin
the origin
Definition: WPS4Text.cpp:265
libwps::DebugFile::addNote
static void addNote(char const *)
Definition: WPSDebug.h:221
WPS4Text::mainParser
WPS4Parser const & mainParser() const
return the main parser
Definition: WPS4Text.h:98
WPSEntry::begin
long begin() const
returns the begin offset
Definition: WPSEntry.h:73
WPS4TextInternal::Z_DLink
@ Z_DLink
Definition: WPS4Text.cpp:89
WPSPosition::Paragraph
@ Paragraph
Definition: WPSPosition.h:43
WPS4TextInternal::Font::m_type
libwps_tools_win::Font::Type m_type
the font encoding type
Definition: WPS4Text.cpp:179
WPS4TextInternal::FTNp
@ FTNp
Definition: WPS4Text.cpp:433
WPS4TextInternal::DataPLC::operator<<
friend std::ostream & operator<<(std::ostream &o, DataPLC const &plc)
operator<<
Definition: WPS4Text.cpp:456
WPS4PLCInternal::PLC::m_cstFactor
int m_cstFactor
some data are stored divided by some unit
Definition: WPS4Text.cpp:2474
WPSEntry::type
std::string const & type() const
returns the type of the entry
Definition: WPSEntry.h:131
WPSParagraph::m_extra
std::string m_extra
a string to store some errors
Definition: WPSParagraph.h:134
libwps::read8
int8_t read8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:59
WPSFont::m_size
double m_size
font size
Definition: WPSFont.h:85
WPSBorder::m_style
Style m_style
the border style
Definition: libwps_internal.h:446
WPS4PLCInternal::KnownPLC::~KnownPLC
~KnownPLC()
destructor
Definition: WPS4Text.cpp:2483
WPS4TextInternal::State::m_bookmarkMap
std::map< long, WPSEntry > m_bookmarkMap
map: bookmark in text -> bookmark
Definition: WPS4Text.cpp:505
WPS4Text::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: WPS4Text.cpp:620
WPS4PLCInternal::PLC
Internal and low level: the PLC different types and their structures.
Definition: WPS4Text.cpp:2442
WPSField::m_DTFormat
std::string m_DTFormat
the date/time format using strftime format if defined (see strftime)
Definition: libwps_internal.h:486
WPSTextParser::m_input
RVNGInputStreamPtr m_input
the main input
Definition: WPSTextParser.h:128
WPSBorder::Dash
@ Dash
Definition: libwps_internal.h:397
WPS4TextInternal::Object
Internal: class to store an object definition.
Definition: WPS4Text.cpp:247
WPS4TextInternal::State::m_FDPCs
std::vector< WPSEntry > m_FDPCs
the list of FDPC entries (ie list to find the font properties lists )
Definition: WPS4Text.cpp:496
WPSEntry::id
int id() const
returns the entry id
Definition: WPSEntry.h:158
WPSParagraph::m_border
int m_border
list of bits to indicated a border 1: LeftBorderBit, 2: RightBorderBit, ...
Definition: WPSParagraph.h:129
WPSTextParser::DataFOD::ATTR_PLC
@ ATTR_PLC
Definition: WPSTextParser.h:74
WPS4Text::DataParser
bool(WPS4Text::* DataParser)(long bot, long eot, int id, long endPos, std::string &mess)
definition of the plc data parser (low level)
Definition: WPS4Text.h:147
WPSEntry::length
long length() const
returns the length of the zone
Definition: WPSEntry.h:83
WPS4TextInternal::Object::m_extra
std::string m_extra
a string used to store the parsing errors
Definition: WPS4Text.cpp:273
WPS4TextInternal::State::m_footer
WPSEntry m_footer
the footer text entry
Definition: WPS4Text.cpp:510
libwps::DebugStream
Definition: WPSDebug.h:192
WPS4TextInternal::State::m_plcList
std::vector< DataPLC > m_plcList
a list of all PLCs
Definition: WPS4Text.cpp:519
WPSTextParser::readFDP
bool readFDP(WPSEntry const &entry, std::vector< DataFOD > &fods, FDPParser parser)
parses a FDPP or a FDPC entry (which contains a list of ATTR_TEXT/ATTR_PARAG with their definition ) ...
Definition: WPSTextParser.cpp:71
libwps::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
WPS4TextInternal::Z_Bookmark
@ Z_Bookmark
Definition: WPS4Text.cpp:89
WPS4Text::readFontNames
bool readFontNames(WPSEntry const &entry)
reads the font names
Definition: WPS4Text.cpp:1408
WPSTextParser::ascii
libwps::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: WPSTextParser.h:113
WPS4Text::numPages
int numPages() const
returns the number of pages
Definition: WPS4Text.cpp:545
WPS4TextInternal::State::m_header
WPSEntry m_header
the header text entry
Definition: WPS4Text.cpp:510
WPS4TextInternal::BKMK
@ BKMK
Definition: WPS4Text.cpp:433
WPS4TextInternal::DataPLC
Internal: class to store the PLC: Pointer List Content ?
Definition: WPS4Text.cpp:437
WPS4.h
WPS4TextInternal::DataPLC::DataPLC
DataPLC()
constructor
Definition: WPS4Text.cpp:439
WPS4TextInternal::DateTime::operator<<
friend std::ostream & operator<<(std::ostream &o, DateTime const &dtime)
operator <<
Definition: WPS4Text.cpp:394
WPS4TextInternal::Z_Main
@ Z_Main
Definition: WPS4Text.cpp:89
WPS4Text::getHeaderEntry
WPSEntry getHeaderEntry() const
returns the header entry (if such entry exists, if not returns an invalid entry)
Definition: WPS4Text.cpp:583
libwps_tools_win.h
WPS4Parser::readObject
int readObject(RVNGInputStreamPtr input, WPSEntry const &entry)
tries to read a picture ( via its WPS4Graph )
Definition: WPS4.cpp:326
WPSPosition::Page
@ Page
Definition: WPSPosition.h:43
WPS4TextInternal::State::m_otherZones
std::vector< WPSEntry > m_otherZones
the entries which are not in main/header/footer text and in the footnotes
Definition: WPS4Text.cpp:513
WPSEntry::setEnd
void setEnd(long e)
sets the end offset
Definition: WPSEntry.h:67
WPS4TextInternal::FontName::m_name
librevenge::RVNGString m_name
font name
Definition: WPS4Text.cpp:105
WPS4Text::findFDPStructuresByHand
bool findFDPStructuresByHand(int which)
finds the FDPC/FDPP structure by searching after the text zone
Definition: WPS4Text.cpp:1293
WPS4TextInternal::BTE
@ BTE
Definition: WPS4Text.cpp:433
WPSField::Time
@ Time
Definition: libwps_internal.h:465
libwps::readU16
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
WPSList::Level::m_bullet
librevenge::RVNGString m_bullet
the bullet if we have an bullet level
Definition: WPSList.h:101
libwps_tools_win::Language::name
std::string name(long id)
returns the name given Windows id
Definition: libwps_tools_win.cpp:7332
WPS4TextInternal::State::m_footnoteList
std::vector< Note > m_footnoteList
the footnote entries
Definition: WPS4Text.cpp:501
WPS4Parser
This class parses Works version 2 through 4.
Definition: WPS4.h:49
WPSBorder::Double
@ Double
Definition: libwps_internal.h:399
WPS4PLCInternal::KnownPLC::KnownPLC
KnownPLC()
constructor
Definition: WPS4Text.cpp:2477
WPSPosition.h
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
WPS4PLCInternal
Internal and low level: the structures of a WPS4Text used to parse PLC.
Definition: WPS4Text.cpp:61
WPS4Text.h
WPSParagraph::m_spacings
double m_spacings[3]
the line spacing
Definition: WPSParagraph.h:107
WPSPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: WPSPosition.h:40
WPSBorder::LeftBit
@ LeftBit
Definition: libwps_internal.h:401
WPSBorder::m_type
Type m_type
the border repetition
Definition: libwps_internal.h:448
WPS4TextInternal::Object::Object
Object()
constructor
Definition: WPS4Text.cpp:249
WPSDebug.h
libwps::DebugFile::addDelimiter
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
WPS4TextInternal::ZoneType
ZoneType
a enum used to type a zone
Definition: WPS4Text.cpp:89
libwps_tools_win::Font::WIN3_WEUROPE
@ WIN3_WEUROPE
Definition: libwps_tools_win.h:52
WPS4TextInternal::State::m_fontNames
std::map< int, FontName > m_fontNames
the list of fonts names
Definition: WPS4Text.cpp:489
WPS4TextInternal::DataPLC::m_extra
std::string m_extra
a string used to store the parsing errors
Definition: WPS4Text.cpp:453
WPS4TextInternal::operator<<
std::ostream & operator<<(std::ostream &o, FontName const &ft)
operator<< for a font name
Definition: WPS4Text.cpp:110
WPS4TextInternal::Font
Internal: class to store font properties.
Definition: WPS4Text.cpp:149
WPS4Text::defDataParser
bool defDataParser(long bot, long eot, int id, long endPos, std::string &mess)
default plc reader
Definition: WPS4Text.cpp:1373
libwps::read16
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
libwps_tools_win::Font::DOS_850
@ DOS_850
Definition: libwps_tools_win.h:47
WPSTextParser
class used to defined the ancestor of parser which manages the text data
Definition: WPSTextParser.h:40
libwps::JustificationFull
@ JustificationFull
Definition: libwps_internal.h:249
WPSFont::getDefault
static WPSFont getDefault()
returns the default font ( Courier 12pt)
Definition: WPSFont.h:53
libwps_internal.h
WPSParagraph::m_breakStatus
int m_breakStatus
a list of bits: 0x1 (unbreakable), 0x2 (do not break after)
Definition: WPSParagraph.h:118
WPS4PLCInternal::PLC::T_CST
@ T_CST
Definition: WPS4Text.cpp:2454
libwps::NoBreakWithNextBit
@ NoBreakWithNextBit
Definition: libwps_internal.h:252
libwps::JustificationLeft
@ JustificationLeft
Definition: libwps_internal.h:249
WPS4TextInternal::Note::m_error
std::string m_error
a string used to store the parsing errors
Definition: WPS4Text.cpp:239
WPSColor
the class to store a color
Definition: libwps_internal.h:281
libwps::NoBreakBit
@ NoBreakBit
Definition: libwps_internal.h:252
WPS4TextInternal::Object::m_unknown
long m_unknown
unknown data
Definition: WPS4Text.cpp:271
WPS4Text::getFooterEntry
WPSEntry getFooterEntry() const
returns the footer entry (if such entry exists, if not returns an invalid entry)
Definition: WPS4Text.cpp:595
WPS4TextInternal::DTTM
@ DTTM
Definition: WPS4Text.cpp:433
WPS4TextInternal::State::m_dosLinkList
std::vector< DosLink > m_dosLinkList
the dos file links
Definition: WPS4Text.cpp:507
WPS4PLCInternal::PLC::T_COMPLEX
@ T_COMPLEX
Definition: WPS4Text.cpp:2454
WPS4Text::WPS4Text
WPS4Text(WPS4Parser &parser, RVNGInputStreamPtr &input)
contructor
Definition: WPS4Text.cpp:532
WPSList::Level::m_labelIndent
double m_labelIndent
the list indent
Definition: WPSList.h:93
libwps_tools_win::Font::getFontType
static Type getFontType(librevenge::RVNGString &name)
returns the type of the font using the fontName
Definition: libwps_tools_win.cpp:39
WPS4PLCInternal::PLC::PLC
PLC(PLC const &orig)=default
WPS4TextInternal::FontName
Internal: class to store a font name: name with encoding type.
Definition: WPS4Text.cpp:92
WPS4Text::readStructures
bool readStructures()
parsed all the text entries
Definition: WPS4Text.cpp:1143
WPS4PLCInternal::PLC::operator=
PLC & operator=(PLC &&orig)=default
WPSBorder::LargeDot
@ LargeDot
Definition: libwps_internal.h:397
WPS4TextInternal::State::State
State()
constructor
Definition: WPS4Text.cpp:468
WPS4TextInternal::DateTime::DateTime
DateTime()
constructor
Definition: WPS4Text.cpp:347
WPS4Parser::parseEntry
bool parseEntry(std::string const &name)
parses an entry
Definition: WPS4.cpp:509
libwps_tools_win
some Windows classes and tools
Definition: libwps_tools_win.cpp:32
libwps::JustificationCenter
@ JustificationCenter
Definition: libwps_internal.h:249
WPS4Text::readText
bool readText(WPSEntry const &entry)
reads a text section and sends it to a listener
Definition: WPS4Text.cpp:641
libwps::JustificationRight
@ JustificationRight
Definition: libwps_internal.h:250
WPS4TextInternal::Z_String
@ Z_String
Definition: WPS4Text.cpp:89
WPS4TextInternal::Object::m_id
int m_id
the object identificator
Definition: WPS4Text.cpp:261
WPSTextParser::DataFOD::ATTR_PARAG
@ ATTR_PARAG
Definition: WPSTextParser.h:74
WPS4Text::readParagraph
bool readParagraph(long endPos, int &id, std::string &mess)
reads a paragraph properties
Definition: WPS4Text.cpp:1712
WPS4TextInternal::Unknown
@ Unknown
Definition: WPS4Text.cpp:433
WPSTextParser::FDPParser
bool(WPSTextParser::* FDPParser)(long endPos, int &id, std::string &mess)
callback when a new attribute is found in an FDPP/FDPC entry
Definition: WPSTextParser.h:103
WPS4Text::m_state
std::shared_ptr< WPS4TextInternal::State > m_state
the internal state
Definition: WPS4Text.h:195
WPS4TextInternal::DataPLC::m_type
PLCType m_type
the plc type
Definition: WPS4Text.cpp:449
WPS4TextInternal::FTNd
@ FTNd
Definition: WPS4Text.cpp:433
WPS4PLCInternal::KnownPLC::get
PLC get(std::string const &name)
returns the PLC corresponding to a name
Definition: WPS4Text.cpp:2487
WPS4TextInternal::State::m_FDPPs
std::vector< WPSEntry > m_FDPPs
the list of FDPP entries (ie list to find the paragraph properties lists )
Definition: WPS4Text.cpp:498
Vec2::y
T y() const
second element
Definition: libwps_internal.h:547
WPS4PLCInternal::PLC::m_pos
Position m_pos
the way to define the text positions
Definition: WPS4Text.cpp:2466
WPS4Parser::createTextBox
void createTextBox(WPSEntry const &entry, WPSPosition const &pos, librevenge::RVNGPropertyList &extras)
creates a textbox and then send the data
Definition: WPS4.cpp:374
WPS4PLCInternal::PLC::m_contentType
Type m_contentType
the type of the content
Definition: WPS4Text.cpp:2468
WPS4Parser::sendObject
void sendObject(WPSPosition const &position, int id)
sends an object with given id ( via its WPS4Graph )
Definition: WPS4.cpp:334
WPS4TextInternal::Font::operator=
Font & operator=(Font const &)=default
WPS4TextInternal::Font::m_special
bool m_special
a flag to know if we have a special field (a note), ...
Definition: WPS4Text.cpp:183
WPSParagraph::m_tabs
std::vector< WPSTabStop > m_tabs
the tabulations
Definition: WPSParagraph.h:113
WPSFont::m_name
librevenge::RVNGString m_name
font name
Definition: WPSFont.h:83
WPS4TextInternal::Object::m_size
Vec2f m_size
the object size in the document
Definition: WPS4Text.cpp:267
WPS4Text::readPLC
bool readPLC(WPSEntry const &zone, std::vector< long > &textPtrs, std::vector< long > &listValues, DataParser parser=nullptr)
reads a PLC (Pointer List Composant ?) in zone entry
Definition: WPS4Text.cpp:2514
WPSPosition::WDynamic
@ WDynamic
Definition: WPSPosition.h:45
WPS4PLCInternal::PLC::PLC
PLC(PLC &&orig)=default
WPSPosition::setPage
void setPage(int pg) const
sets the page
Definition: WPSPosition.h:182
WPS4PLCInternal::PLC::Position
Position
the way to define the text positions
Definition: WPS4Text.cpp:2449
WPS4TextInternal::Font::m_dlinkId
int m_dlinkId
a id to retrieve a file name ( dos )
Definition: WPS4Text.cpp:185

Generated on Sat Apr 4 2020 02:16:56 for libwps by doxygen 1.8.18