WPS8Text.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) 2006, 2007 Andrew Ziem
11  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
12  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
13  *
14  * For minor contributions see the git repository.
15  *
16  * Alternatively, the contents of this file may be used under the terms
17  * of the GNU Lesser General Public License Version 2.1 or later
18  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19  * applicable instead of those above.
20  */
21 
22 #ifndef WPS8_TEXT_H
23 #define WPS8_TEXT_H
24 
25 #include <vector>
26 
27 #include "libwps_internal.h"
28 
29 #include "WPSDebug.h"
30 
31 #include "WPSTextParser.h"
32 
33 namespace WPS8Struct
34 {
35 struct FileData;
36 }
37 
38 namespace WPS8TextInternal
39 {
40 struct State;
41 class SubDocument;
42 }
43 
44 class WPS8Parser;
45 class WPS8TextStyle;
46 
47 class WPS8Text : public WPSTextParser
48 {
50  friend class WPS8Parser;
51  friend class WPS8TextStyle;
52 public:
53  explicit WPS8Text(WPS8Parser &parser);
54  ~WPS8Text() override;
55 
57  void setListener(WPSContentListenerPtr &listen);
58 
60  int numPages() const;
61 
63  void flushExtra();
64 
66  bool readStructures();
67 
69  int getNumTextZones() const;
70 
76  int getTextZoneType(int typeId) const;
77 
79  WPSEntry getHeaderEntry() const;
80 
82  WPSEntry getFooterEntry() const;
83 
85  WPSEntry getTextEntry() const;
86 
88  WPSEntry getEntry(int strsId) const;
89 
91  void readText(WPSEntry const &entry);
92 
94  void readTextInCell(int strsId, int cellId);
95 
96 protected:
99  {
100  return reinterpret_cast<WPS8Parser &>(m_mainParser);
101  }
103  WPS8Parser const &mainParser() const
104  {
105  return reinterpret_cast<WPS8Parser const &>(m_mainParser);
106  }
107 
108  //
109  // interface with WPS8TextStyle
110  //
112  bool readFont(long endPos, int &id, std::string &mess);
113 
115  bool readParagraph(long endPos, int &id, std::string &mess);
116 
117  //
118  // String+text functions
119  //
121  bool readString(RVNGInputStreamPtr input, long page_size,
122  librevenge::RVNGString &res);
124  long readUTF16LE(RVNGInputStreamPtr input, long endPos, uint16_t firstC);
125 
129  bool readNotes(WPSEntry const &entry);
130 
135 
136  //----------------------------------------
137  // PLC parsing, setting
138  //----------------------------------------
139 
147  typedef bool (WPS8Text::* DataParser)
148  (long bot, long eot, int id, WPS8Struct::FileData const &data,
149  std::string &mess);
154  typedef bool (WPS8Text::* EndDataParser)
155  (long endPos, std::vector<long> const &textPtrs);
163  bool readPLC(WPSEntry const &entry,
164  std::vector<long> &textPtrs, std::vector<long> &listValues,
166  EndDataParser endParser = nullptr);
168  bool defDataParser
169  (long, long, int, WPS8Struct::FileData const &data, std::string &mess);
171  bool textZonesDataParser(long bot, long eot, int nId,
172  WPS8Struct::FileData const &data,
173  std::string &mess);
174  // object
176  bool objectDataParser(long bot, long eot, int id,
177  WPS8Struct::FileData const &data, std::string &mess);
178  // field type
180  bool tokenEndDataParser(long endPage, std::vector<long> const &textPtrs);
183  bool bmktEndDataParser(long endPage, std::vector<long> const &textPtrs);
184 
185 protected:
189  std::shared_ptr<WPS8TextStyle> m_styleParser;
191  mutable std::shared_ptr<WPS8TextInternal::State> m_state;
192 protected:
193 };
194 
195 
196 #endif /* WPS8_TEXT_H */
197 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPSTextSubDocument.h
WPS8TextInternal::SubDocument::m_entry
WPSEntry m_entry
Definition: WPS8Text.cpp:488
WPS8PLCInternal::PLC::T_STRUCT
@ T_STRUCT
Definition: WPS8Text.cpp:1945
WPS8TextInternal::Bookmark::operator<<
friend std::ostream & operator<<(std::ostream &o, Bookmark const &tok)
operator <<
Definition: WPS8Text.cpp:98
WPS_N_ELEMENTS
#define WPS_N_ELEMENTS(m)
Definition: libwps_internal.h:124
WPS8TextInternal::Notes::m_corr
const Notes * m_corr
a pointer to the corresponding notes
Definition: WPS8Text.cpp:147
WPSParagraph.h
WPS8TextInternal::BMKT
@ BMKT
Definition: WPS8Text.cpp:77
WPS8TextInternal::State::m_objectTypes
std::map< int, int > m_objectTypes
the object type
Definition: WPS8Text.cpp:434
WPSEntry::hasName
bool hasName(std::string const &nam) const
checks if the entry name is equal to name
Definition: WPSEntry.h:150
WPS8TextInternal::DataPLC::m_value
long m_value
a potential value
Definition: WPS8Text.cpp:329
WPS8Text::getTextEntry
WPSEntry getTextEntry() const
returns the main zone entry (if such entry exists, if not returns an invalid entry)
Definition: WPS8Text.cpp:635
WPSField
a field
Definition: libwps_internal.h:462
WPS8TextInternal::Object::Image
@ Image
Definition: WPS8Text.cpp:199
WPS8PLCInternal::PLC::Position
Position
the way to define the text positions
Definition: WPS8Text.cpp:1938
WPS8Parser::sendTable
bool sendTable(Vec2f const &size, int objectId)
sends a table as a character with given size ( via its WPS8Table )
Definition: WPS8.cpp:494
WPS8Text::createNotesCorrespondance
void createNotesCorrespondance()
creates the notes association : text and notes positions
Definition: WPS8Text.cpp:1280
WPSTextParser::getInput
RVNGInputStreamPtr & getInput()
returns the actual input
Definition: WPSTextParser.h:49
WPS8Text::tokenEndDataParser
bool tokenEndDataParser(long endPage, std::vector< long > const &textPtrs)
reads a field type : TOKN zone
Definition: WPS8Text.cpp:1668
WPSTextParser::DataFOD::m_type
Type m_type
the type of the attribute
Definition: WPSTextParser.h:84
libwps::DebugStream::str
static std::string str()
Definition: WPSDebug.h:200
WPSField::PageNumber
@ PageNumber
Definition: libwps_internal.h:465
WPSTextParser.h
WPS8TextInternal::Notes::Compare
internal struct used to create sorted map
Definition: WPS8Text.cpp:154
WPS8Text::textZonesDataParser
bool textZonesDataParser(long bot, long eot, int nId, WPS8Struct::FileData const &data, std::string &mess)
the text zones parser: STRS
Definition: WPS8Text.cpp:1386
libwps::DebugFile::addPos
static void addPos(long)
Definition: WPSDebug.h:220
WPS8Text::objectDataParser
bool objectDataParser(long bot, long eot, int id, WPS8Struct::FileData const &data, std::string &mess)
reads a EOBJ properties: an object id and its size, ...
Definition: WPS8Text.cpp:1596
WPS8TextInternal::Notes::m_positions
std::vector< long > m_positions
the positions of the data in the file
Definition: WPS8Text.cpp:149
WPSEntry::end
long end() const
returns the end offset
Definition: WPSEntry.h:76
WPS8TextInternal::BTE
@ BTE
Definition: WPS8Text.cpp:77
WPS8TextInternal::DataPLC::m_name
std::string m_name
the entry name
Definition: WPS8Text.cpp:325
WPSTextParser::DataFOD
structure which retrieves data information which correspond to a text position
Definition: WPSTextParser.h:66
WPS8TextInternal::Object::Table
@ Table
Definition: WPS8Text.cpp:199
WPS8TextInternal::Notes::m_note
bool m_note
a flag to know if this is the note content
Definition: WPS8Text.cpp:145
WPS8Text::getEntry
WPSEntry getEntry(int strsId) const
returns ith zone entry (if such entry exists, if not returns an invalid entry)
Definition: WPS8Text.cpp:593
WPSTextParser::m_mainParser
WPSParser & m_mainParser
pointer to the main zone parser;
Definition: WPSTextParser.h:130
WPS8TextInternal::SubDocument::SubDocument
SubDocument(RVNGInputStreamPtr const &input, WPS8Text &pars, WPSEntry const &entry)
constructor for a note/endnote entry
Definition: WPS8Text.cpp:456
WPS8TextInternal::Bookmark::Bookmark
Bookmark()
constructor
Definition: WPS8Text.cpp:83
WPS8Text::getFooterEntry
WPSEntry getFooterEntry() const
returns the footer entry (if such entry exists, if not returns an invalid entry)
Definition: WPS8Text.cpp:617
WPS8TextStyle::FontData::format
std::string format() const
returns a format to used with strftime
Definition: WPS8TextStyle.cpp:1353
WPS8Struct::FileData::m_recursData
std::vector< FileData > m_recursData
the list of children
Definition: WPS8Struct.h:145
WPSField::PageNumberNext
@ PageNumberNext
Definition: libwps_internal.h:465
WPSField::Title
@ Title
Definition: libwps_internal.h:465
WPS8TextInternal::Notes::m_zoneCorr
int m_zoneCorr
the id of the zone which called/used this data
Definition: WPS8Text.cpp:141
WPS8PLCInternal::PLC::T_COMPLEX
@ T_COMPLEX
Definition: WPS8Text.cpp:1945
WPSContentListenerPtr
std::shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:107
WPS8Parser::sendObject
bool sendObject(Vec2f const &size, int objectId, bool ole)
sends an object as a character with given size (via its WPS8Graph )
Definition: WPS8.cpp:485
WPS8TextInternal::Notes::Compare::operator()
bool operator()(Notes const *n1, Notes const *n2) const
comparaison function
Definition: WPS8Text.cpp:157
WPS8Text::readNotes
bool readNotes(WPSEntry const &entry)
the footnote ( FTN or EDN )
Definition: WPS8Text.cpp:1148
WPS8Struct::readBlockData
bool readBlockData(RVNGInputStreamPtr input, long endPos, FileData &dt, std::string &error)
tries to read a block zone as a list of Data
Definition: WPS8Struct.cpp:168
WPS8PLCInternal::KnownPLC
a map of known plc
Definition: WPS8Text.cpp:49
WPS8TextInternal::State
Internal: the state of a WPS4Text.
Definition: WPS8Text.cpp:343
WPSTextParser::DataFOD::m_pos
long m_pos
the offset position of the text modified by this attribute
Definition: WPSTextParser.h:86
WPS8Text::readText
void readText(WPSEntry const &entry)
reads a text section and sends it to a listener
Definition: WPS8Text.cpp:671
WPSTextParser::m_textPositions
WPSEntry m_textPositions
an entry which corresponds to the complete text zone
Definition: WPSTextParser.h:132
WPS8Text::readString
bool readString(RVNGInputStreamPtr input, long page_size, librevenge::RVNGString &res)
reads a string
Definition: WPS8Text.cpp:1127
WPS8TextInternal::State::m_notesList
std::vector< Notes > m_notesList
the list of notes
Definition: WPS8Text.cpp:417
WPS8TextStyle::FontData::F_None
@ F_None
Definition: WPS8TextStyle.h:128
WPS8TextInternal::Token::m_error
std::string m_error
a string used to store the parsing errors
Definition: WPS8Text.cpp:272
WPS8TextInternal::Token::m_text
librevenge::RVNGString m_text
the field value
Definition: WPS8Text.cpp:270
WPS8TextInternal::SubDocument::SubDocument
SubDocument(RVNGInputStreamPtr const &input, librevenge::RVNGString const &text)
constructor for a comment entry
Definition: WPS8Text.cpp:462
WPS8Text::numPages
int numPages() const
returns the number of pages
Definition: WPS8Text.cpp:565
WPS8TextInternal::Object
Internal: class to store an object definition.
Definition: WPS8Text.cpp:196
WPS8Text::getTextZoneType
int getTextZoneType(int typeId) const
returns the type of a text zone
Definition: WPS8Text.cpp:644
WPSList.h
WPS8PLCInternal::PLC::m_contentType
Type m_contentType
the type of the content
Definition: WPS8Text.cpp:1958
WPS8TextInternal::TOKEN
@ TOKEN
Definition: WPS8Text.cpp:77
WPS8TextInternal::Bookmark::m_id
int m_id
an index
Definition: WPS8Text.cpp:91
WPS8Text::bmktEndDataParser
bool bmktEndDataParser(long endPage, std::vector< long > const &textPtrs)
reads a field type : BMKT zone
Definition: WPS8Text.cpp:1447
WPS8Text::defDataParser
bool defDataParser(long, long, int, WPS8Struct::FileData const &data, std::string &mess)
default parser
Definition: WPS8Text.cpp:1360
WPS8TextInternal::Object::m_unknown
long m_unknown
unknown data
Definition: WPS8Text.cpp:218
WPS8Text::readUTF16LE
long readUTF16LE(RVNGInputStreamPtr input, long endPos, uint16_t firstC)
reads a utf16 character,
Definition: WPS8Text.cpp:1094
WPS8TextInternal::STRS
@ STRS
Definition: WPS8Text.cpp:77
WPSContentListener
Definition: WPSContentListener.h:44
WPS8TextInternal::Notes::m_type
WPSContentListener::NoteType m_type
the note type : footnote or endnote
Definition: WPS8Text.cpp:143
WPS8TextInternal::Notes
Internal: class to store the note position.
Definition: WPS8Text.cpp:105
WPSEntry::valid
bool valid(bool checkId=false) const
returns true if the zone length is positive
Definition: WPSEntry.h:87
WPSField::Type
Type
Defines some basic type for field.
Definition: libwps_internal.h:465
WPS8PLCInternal::PLC::m_type
PLCType m_type
PLC type.
Definition: WPS8Text.cpp:1954
WPS8TextInternal::Object::Type
Type
the object type
Definition: WPS8Text.cpp:199
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
WPS8TextInternal::State::State
State()
constructor
Definition: WPS8Text.cpp:346
WPSEntry::name
const std::string & name() const
name of the entry
Definition: WPSEntry.h:145
WPS8Text::~WPS8Text
~WPS8Text() override
Definition: WPS8Text.cpp:552
WPS8PLCInternal::PLC::PLCType
enum WPS8TextInternal::PLCType PLCType
the PLC types
Definition: WPS8Text.cpp:1929
WPS8TextStyle::FontData::F_Date
@ F_Date
Definition: WPS8TextStyle.h:128
WPS8TextInternal
Definition: WPS8Text.cpp:66
WPS8TextInternal::Object::Unknown
@ Unknown
Definition: WPS8Text.cpp:199
WPSEntry::type
const std::string & type() const
returns the type of the entry
Definition: WPSEntry.h:129
WPSEntry::setId
void setId(int i)
sets the id
Definition: WPSEntry.h:161
WPS8PLCInternal::PLC::P_ABS
@ P_ABS
Definition: WPS8Text.cpp:1938
WPS8Struct::FileData::id
int id() const
returns the identificator
Definition: WPS8Struct.h:132
WPS8PLCInternal::PLC::T_CST
@ T_CST
Definition: WPS8Text.cpp:1945
WPS8PLCInternal::PLC::P_UNKNOWN
@ P_UNKNOWN
Definition: WPS8Text.cpp:1938
WPS8Struct.h
WPS8PLCInternal::PLC::Type
Type
the type of the content
Definition: WPS8Text.cpp:1945
WPS8TextInternal::State::m_textZones
std::vector< WPSEntry > m_textZones
the list of different text zones
Definition: WPS8Text.cpp:411
WPS8Text::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: WPS8Text.cpp:937
libwps::ParseException
Definition: libwps_internal.h:151
Vec2< float >
WPS8TextInternal::Bookmark::m_error
std::string m_error
a string used to store the parsing errors
Definition: WPS8Text.cpp:95
WPS8TextInternal::Object::operator<<
friend std::ostream & operator<<(std::ostream &o, Object const &obj)
operator <<
Definition: WPS8Text.cpp:224
WPS8TextStyle::FontData::m_type
int m_type
the main type: footnote, ...
Definition: WPS8TextStyle.h:127
WPS8TextStyle::FontData::F_PageNumber
@ F_PageNumber
Definition: WPS8TextStyle.h:128
WPS8PLCInternal::KnownPLC::KnownPLC
KnownPLC()
constructor
Definition: WPS8Text.cpp:1961
WPS8TextStyle::FontData::T_Field
@ T_Field
Definition: WPS8TextStyle.h:125
WPS_DEBUG_MSG
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
WPS8TextInternal::Bookmark
Internal: class to store a field definition (BKMT)
Definition: WPS8Text.cpp:80
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
WPS8Text::EndDataParser
bool(WPS8Text::* EndDataParser)(long endPos, std::vector< long > const &textPtrs)
definition of the last part of plc data parser (low level)
Definition: WPS8Text.h:155
WPS8TextInternal::State::setParsed
void setParsed(WPSEntry const &entry, bool fl)
tests if a text zone is simillar to entry, if yes, updates is parsed field
Definition: WPS8Text.cpp:375
WPS8Struct::FileData::readArrayBlock
bool readArrayBlock() const
forces reading the data as a list of block
Definition: WPS8Struct.cpp:33
WPSEntry::setBegin
void setBegin(long off)
sets the begin offset
Definition: WPSEntry.h:55
WPSContentListener.h
WPS8TextStyle::FontData::T_None
@ T_None
Definition: WPS8TextStyle.h:125
WPSTextParser::DataFOD::ATTR_TEXT
@ ATTR_TEXT
Definition: WPSTextParser.h:74
WPS8Struct
namespace used to read the structures stored in a WPS8 files
Definition: WPS8Struct.cpp:30
WPS8TextStyle::FontData::F_Time
@ F_Time
Definition: WPS8TextStyle.h:128
WPS8TextInternal::Notes::getCorrespondanceEntry
WPSEntry getCorrespondanceEntry(long offset) const
Definition: WPS8Text.cpp:121
libwps::DOC_COMMENT_ANNOTATION
@ DOC_COMMENT_ANNOTATION
Definition: libwps_internal.h:248
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
libwps::SubDocumentType
SubDocumentType
Definition: libwps_internal.h:248
WPSEntry::setType
void setType(std::string const &tp)
sets the type of the entry: BTEP,FDPP, BTEC, FDPC, PLC , TEXT, ...
Definition: WPSEntry.h:124
WPSField::Date
@ Date
Definition: libwps_internal.h:465
WPS8TextInternal::TCD
@ TCD
Definition: WPS8Text.cpp:77
WPS8TextStyle::FontData::T_Footnote
@ T_Footnote
Definition: WPS8TextStyle.h:125
WPSTextParser::m_FODList
std::vector< DataFOD > m_FODList
the list of a FOD
Definition: WPSTextParser.h:134
WPS8TextInternal::State::m_tokenMap
std::map< long, Token > m_tokenMap
a map text offset->token
Definition: WPS8Text.cpp:428
WPSTextParser::DataFOD::ATTR_UNKN
@ ATTR_UNKN
Definition: WPSTextParser.h:74
WPSField::None
@ None
Definition: libwps_internal.h:465
WPSEntry.h
libwps::DebugFile::addNote
static void addNote(char const *)
Definition: WPSDebug.h:221
WPSEntry::begin
long begin() const
returns the begin offset
Definition: WPSEntry.h:71
WPS8Struct::FileData
A recursif structure which seems generally used to store complex memory structures in a file.
Definition: WPS8Struct.h:63
WPS8TextInternal::Object::Object
Object()
constructor
Definition: WPS8Text.cpp:202
WPS8PLCInternal
Internal and low level: the structures of a WPS8Text used to parse PLC.
Definition: WPS8Text.cpp:43
WPS8TextInternal::DataPLC::m_type
PLCType m_type
the plc type
Definition: WPS8Text.cpp:327
WPS8TextInternal::operator<<
std::ostream & operator<<(std::ostream &o, Bookmark const &bmk)
operator<< for a Bookmark
Definition: WPS8Text.cpp:98
WPS8Text.h
WPS8Text::getNumTextZones
int getNumTextZones() const
returns the number of different text zones
Definition: WPS8Text.cpp:640
WPS8Parser::newPage
void newPage(int number)
adds a new page
Definition: WPS8.cpp:433
libwps::read8
int8_t read8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:59
WPSSubDocumentPtr
std::shared_ptr< WPSSubDocument > WPSSubDocumentPtr
shared pointer to WPSSubDocument
Definition: libwps_internal.h:111
WPS8PLCInternal::PLC::T_UNKNOWN
@ T_UNKNOWN
Definition: WPS8Text.cpp:1945
WPS8Text::getHeaderEntry
WPSEntry getHeaderEntry() const
returns the header entry (if such entry exists, if not returns an invalid entry)
Definition: WPS8Text.cpp:599
WPS8Parser
This class parses Works version 2000 through 8.
Definition: WPS8.h:49
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
WPS8Text
Definition: WPS8Text.h:47
WPSEntry::id
int id() const
returns the entry id
Definition: WPSEntry.h:156
WPS8TextInternal::SubDocument
Internal: the subdocument of a WPS8Text.
Definition: WPS8Text.cpp:452
WPSTextParser::DataFOD::ATTR_PLC
@ ATTR_PLC
Definition: WPSTextParser.h:74
WPS8TextInternal::SubDocument::operator==
bool operator==(WPSSubDocumentPtr const &doc) const final
operator==
Definition: WPS8Text.cpp:472
WPSEntry::length
long length() const
returns the length of the zone
Definition: WPSEntry.h:81
WPS8TextInternal::Object::m_type
int m_type
the type (normally a Type, ...)
Definition: WPS8Text.cpp:212
libwps::DOC_NOTE
@ DOC_NOTE
Definition: libwps_internal.h:248
WPS8TextInternal::Notes::operator<<
friend std::ostream & operator<<(std::ostream &o, Notes const &note)
operator <<
Definition: WPS8Text.cpp:172
WPS8TextInternal::SubDocument::~SubDocument
~SubDocument() final
destructor
Definition: WPS8Text.cpp:469
WPSTextParser::getNameEntryMap
std::multimap< std::string, WPSEntry > & getNameEntryMap()
returns the map type->entry
Definition: WPSTextParser.cpp:58
WPS8TextInternal::DataPLC::DataPLC
DataPLC()
constructor
Definition: WPS8Text.cpp:317
WPS8PLCInternal::KnownPLC::~KnownPLC
~KnownPLC()
destructor
Definition: WPS8Text.cpp:1966
libwps::DebugStream
Definition: WPSDebug.h:191
libwps::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
WPSTextParser::DataFOD::m_id
int m_id
an identificator (which must be unique by category)
Definition: WPSTextParser.h:90
WPS8TextInternal::State::m_notesMap
std::map< long, Notes * > m_notesMap
a map text offset->notes
Definition: WPS8Text.cpp:420
WPS8TextInternal::Token::operator<<
friend std::ostream & operator<<(std::ostream &o, Token const &tok)
operator <<
Definition: WPS8Text.cpp:275
WPSTextParser::ascii
libwps::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: WPSTextParser.h:113
WPS8TextInternal::State::m_objectMap
std::map< long, Object > m_objectMap
a map text offset->object
Definition: WPS8Text.cpp:425
WPS8TextInternal::Token
Internal: class to store a field definition (TOKN)
Definition: WPS8Text.cpp:251
WPS8TextInternal::PLCType
PLCType
different types
Definition: WPS8Text.cpp:77
WPS8PLCInternal::PLC::PLC
PLC(PLCType w=WPS8TextInternal::Unknown, Position p=P_UNKNOWN, Type t=T_UNKNOWN)
constructor
Definition: WPS8Text.cpp:1948
WPS8TextInternal::DataPLC::operator<<
friend std::ostream & operator<<(std::ostream &o, DataPLC const &plc)
operator<<
Definition: WPS8Text.cpp:334
WPSField::Link
@ Link
Definition: libwps_internal.h:465
WPS8Text::WPS8Text
WPS8Text(WPS8Parser &parser)
Definition: WPS8Text.cpp:542
WPS8PLCInternal::KnownPLC::createMapping
void createMapping()
creates the map of known PLC
Definition: WPS8Text.cpp:1977
WPSField::PageCount
@ PageCount
Definition: libwps_internal.h:465
WPS8PLCInternal::PLC::P_MINCR
@ P_MINCR
Definition: WPS8Text.cpp:1938
WPS8Parser::numColumns
int numColumns() const
returns the number of columns
Definition: WPS8.cpp:360
WPS8Text::readPLC
bool readPLC(WPSEntry const &entry, std::vector< long > &textPtrs, std::vector< long > &listValues, DataParser parser=&WPS8Text::defDataParser, EndDataParser endParser=nullptr)
reads a PLC (Pointer List Composant ?) in zone entry
Definition: WPS8Text.cpp:1990
WPS8TextStyle::FontData::T_Object
@ T_Object
Definition: WPS8TextStyle.h:125
WPSEntry::setEnd
void setEnd(long e)
sets the end offset
Definition: WPSEntry.h:65
WPSField::Time
@ Time
Definition: libwps_internal.h:465
libwps::readU16
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
libwps_tools_win::Language::name
std::string name(long id)
returns the name given Windows© id
Definition: libwps_tools_win.cpp:7332
WPS8TextInternal::State::getTCDZone
WPSEntry getTCDZone(int strsId, int cellId) const
try to return a entry for a cell in table zones
Definition: WPS8Text.cpp:385
WPSEntry::hasType
bool hasType(std::string const &tp) const
returns true if the type entry == type
Definition: WPSEntry.h:134
WPS8TextInternal::State::m_knownPLC
WPS8PLCInternal::KnownPLC m_knownPLC
the known plc
Definition: WPS8Text.cpp:438
WPS8PLCInternal::PLC
Internal and low level: the PLC different types and their structures.
Definition: WPS8Text.cpp:1926
WPS8TextInternal::Unknown
@ Unknown
Definition: WPS8Text.cpp:77
WPS8TextInternal::State::initTypeMaps
void initTypeMaps()
initializes the type map
Definition: WPS8Text.cpp:441
WPS8Text::m_state
std::shared_ptr< WPS8TextInternal::State > m_state
the internal state
Definition: WPS8Text.h:191
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
WPS8PLCInternal::PLC::m_pos
Position m_pos
the way to define the text positions
Definition: WPS8Text.cpp:1956
WPSTextSubDocument
Basic class used to store a sub document.
Definition: WPSTextSubDocument.h:35
WPS8TextInternal::State::m_plcList
std::vector< DataPLC > m_plcList
a list of all plcs
Definition: WPS8Text.cpp:436
WPS8Text::mainParser
const WPS8Parser & mainParser() const
return the main parser
Definition: WPS8Text.h:103
WPS8TextInternal::State::m_object
Object m_object
actual object
Definition: WPS8Text.cpp:423
WPSSubDocument::m_input
RVNGInputStreamPtr m_input
Definition: WPSSubDocument.h:65
WPS8PLCInternal::PLC::P_ZREL
@ P_ZREL
Definition: WPS8Text.cpp:1938
WPS8TextInternal::Token::Token
Token()
constructor
Definition: WPS8Text.cpp:254
WPS8.h
WPSDebug.h
libwps::DebugFile::addDelimiter
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
WPS8Text::readFont
bool readFont(long endPos, int &id, std::string &mess)
reads a font properties
Definition: WPS8Text.cpp:580
WPS8Text::readStructures
bool readStructures()
finds all entries which correspond to the text data, parses them and stores data
Definition: WPS8Text.cpp:952
WPS8TextStyle::FontData::T_Endnote
@ T_Endnote
Definition: WPS8TextStyle.h:125
WPS8TextInternal::State::m_tcdMap
std::map< int, std::vector< long > > m_tcdMap
a map strsId -> last positions of cells
Definition: WPS8Text.cpp:431
WPS8TextInternal::Token::m_textLength
int m_textLength
the length of the text corresponding to the token
Definition: WPS8Text.cpp:266
WPS8Text::mainParser
WPS8Parser & mainParser()
return the main parser
Definition: WPS8Text.h:98
WPSContentListener::NoteType
NoteType
defines the footnote type
Definition: WPSContentListener.h:99
WPS8TextStyle::FontData::m_fieldType
int m_fieldType
the field type: pagenumber, data, time, ...
Definition: WPS8TextStyle.h:130
libwps::read16
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
WPSTextParser
class used to defined the ancestor of parser which manages the text data
Definition: WPSTextParser.h:39
WPSField::Database
@ Database
Definition: libwps_internal.h:465
WPS8TextInternal::Token::m_unknown
int m_unknown
an unknown value
Definition: WPS8Text.cpp:268
WPS8PLCInternal::PLC::P_MREL
@ P_MREL
Definition: WPS8Text.cpp:1938
WPS8TextInternal::Notes::operator=
Notes & operator=(Notes const &)=default
copy operator
libwps_internal.h
WPSContentListener::ENDNOTE
@ ENDNOTE
Definition: WPSContentListener.h:99
WPS8TextInternal::Bookmark::m_text
librevenge::RVNGString m_text
the field value
Definition: WPS8Text.cpp:93
WPS8TextInternal::Object::m_error
std::string m_error
a string used to store the parsing errors
Definition: WPS8Text.cpp:220
WPS8TextInternal::Token::m_type
WPSField::Type m_type
the field type
Definition: WPS8Text.cpp:264
WPS8Text::WPS8TextStyle
friend class WPS8TextStyle
Definition: WPS8Text.h:51
WPS8Text::setListener
void setListener(WPSContentListenerPtr &listen)
sets the listener
Definition: WPS8Text.cpp:557
WPS8TextInternal::SubDocument::operator=
SubDocument & operator=(SubDocument const &)=delete
WPS8TextInternal::Notes::m_zoneNote
int m_zoneNote
the id of the zone which corresponds to the data
Definition: WPS8Text.cpp:139
WPS_COLUMN_BREAK
#define WPS_COLUMN_BREAK
Definition: libwps_internal.h:521
WPS8TextInternal::DataPLC
Internal: class to store the PLC: Pointer List Content ?
Definition: WPS8Text.cpp:314
WPSEntry::setParsed
void setParsed(bool ok=true) const
sets the flag m_parsed to true or false
Definition: WPSEntry.h:118
WPS8TextInternal::DataPLC::m_error
std::string m_error
a string used to store the parsing errors
Definition: WPS8Text.cpp:331
WPS8PLCInternal::KnownPLC::m_knowns
std::map< std::string, PLC > m_knowns
map name -> known PLC
Definition: WPS8Text.cpp:62
WPS8Text::readParagraph
bool readParagraph(long endPos, int &id, std::string &mess)
the paragraph
Definition: WPS8Text.cpp:585
WPS8Text::DataParser
bool(WPS8Text::* DataParser)(long bot, long eot, int id, WPS8Struct::FileData const &data, std::string &mess)
definition of the plc data parser (low level)
Definition: WPS8Text.h:148
WPS8TextInternal::Object::m_size
Vec2f m_size
the size of the object in a page
Definition: WPS8Text.cpp:216
WPS8Text::m_styleParser
std::shared_ptr< WPS8TextStyle > m_styleParser
the graph parser
Definition: WPS8Text.h:189
WPSTextParser::DataFOD::ATTR_PARAG
@ ATTR_PARAG
Definition: WPSTextParser.h:74
WPS8PLCInternal::PLC::P_ZINCR
@ P_ZINCR
Definition: WPS8Text.cpp:1938
WPS8TextInternal::Notes::Notes
Notes()
constructor
Definition: WPS8Text.cpp:108
WPS8TextInternal::State::getTextZones
WPSEntry getTextZones(int id) const
returns the entry corresponding to a type id
Definition: WPS8Text.cpp:365
WPS8TextInternal::SubDocument::m_text
librevenge::RVNGString m_text
Definition: WPS8Text.cpp:489
WPS8Struct::FileData::type
int type() const
returns the data type (low level)
Definition: WPS8Struct.h:126
WPS8TextInternal::State::m_bookmarkMap
std::map< long, Bookmark > m_bookmarkMap
a map text offset->bookmark
Definition: WPS8Text.cpp:414
WPS8TextInternal::Object::m_id
int m_id
an identificator
Definition: WPS8Text.cpp:214
WPS8Struct::FileData::isRead
bool isRead() const
returns true if the data are read
Definition: WPS8Struct.h:120
WPS8PLCInternal::KnownPLC::get
PLC get(std::string const &name)
returns the PLC corresponding to a name
Definition: WPS8Text.cpp:1970
WPS8Text::readTextInCell
void readTextInCell(int strsId, int cellId)
reads a cell section and sends it to a listener
Definition: WPS8Text.cpp:654
WPS8TextInternal::SubDocument::m_textParser
WPS8Text * m_textParser
Definition: WPS8Text.cpp:487
WPS8TextStyle.h
WPSContentListener::FOOTNOTE
@ FOOTNOTE
Definition: WPSContentListener.h:99
WPS8TextStyle
Definition: WPS8TextStyle.h:40
WPS8TextInternal::SubDocument::parse
void parse(WPSContentListenerPtr &listener, libwps::SubDocumentType type) final
the parser function
Definition: WPS8Text.cpp:495
WPS8Text::m_listener
WPSContentListenerPtr m_listener
the listener
Definition: WPS8Text.h:187
WPS8TextStyle::FontData
Definition: WPS8TextStyle.h:114
WPS8TextInternal::OBJECT
@ OBJECT
Definition: WPS8Text.cpp:77

Generated on Wed Jan 29 2020 00:00:00 for libwps by doxygen 1.8.17