Go to the documentation of this file.
22 #ifndef QUATTRO9_SPREADSHEET_H
23 #define QUATTRO9_SPREADSHEET_H
29 #include <librevenge-stream/librevenge-stream.h>
95 std::vector<Quattro9ParserInternal::TextEntry>
const &entries);
109 bool readBeginSheet(std::shared_ptr<WPSStream>
const &stream,
int &sheetId);
111 bool readEndSheet(std::shared_ptr<WPSStream>
const &stream);
113 bool readPageBreak(std::shared_ptr<WPSStream>
const &stream);
125 bool readEndColumn(std::shared_ptr<WPSStream>
const &stream);
127 bool readCellList(std::shared_ptr<WPSStream>
const &stream);
136 Vec2i const &pos=
Vec2i(0,0),
int sheetId=0)
const;
146 std::shared_ptr<Quattro9SpreadsheetInternal::State>
m_state;
Definition: WKSContentListener.h:59
bool readBeginSheet(std::shared_ptr< WPSStream > const &stream, int &sheetId)
read the begin sheet zone: zone 601
Definition: Quattro9Spreadsheet.cpp:1260
static WPSColor white()
return the white color
Definition: libwps_internal.h:311
std::vector< int > m_flagList
a list of flag (for formula)
Definition: Quattro9Spreadsheet.cpp:375
void update()
update the spreadsheet: check for merged cell, ...
Definition: Quattro9Spreadsheet.cpp:460
librevenge::RVNGString m_fileName
the file name (external reference)
Definition: WKSContentListener.h:96
std::vector< FormulaInstruction > m_formula
the formula list of instruction
Definition: WKSContentListener.h:155
void setColRowSize(int which, int pos, int w)
set the col/row size in TWIP
Definition: Quattro9Spreadsheet.cpp:585
static std::string str()
Definition: WPSDebug.h:200
Quattro9Spreadsheet & operator=(Quattro9Spreadsheet const &orig)=delete
Definition: WKSContentListener.h:102
static void addPos(long)
Definition: WPSDebug.h:220
int m_type
the cell type
Definition: Quattro9Spreadsheet.cpp:363
Definition: WKSContentListener.h:59
std::shared_ptr< WKSContentListener > m_listener
Definition: Quattro9Spreadsheet.h:142
int m_fileFormat
the file format
Definition: Quattro9Spreadsheet.cpp:76
void setLength(long l)
sets the zone size
Definition: WPSEntry.h:60
Vec2f getPosition(int sheetId, Vec2i const &cell) const
returns the beginning position of a cell
Definition: Quattro9Spreadsheet.cpp:836
Column & getColumn(int col)
returns a ref to column data (or to invalidColumn if called with bad column)
Definition: Quattro9Spreadsheet.cpp:661
void addDocumentStrings(std::shared_ptr< WPSStream > const &stream, std::vector< Quattro9ParserInternal::TextEntry > const &entries)
set the document strings list
Definition: Quattro9Spreadsheet.cpp:872
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition: Quattro9.cpp:422
This class parses Quattro9 Pro spreadsheet file.
Definition: Quattro9Spreadsheet.h:56
Vec2f getPosition(Vec2i const &cell) const
returns the cell position
Definition: Quattro9Spreadsheet.cpp:625
const CellData * getCell(Vec2i const &pos) const
returns the cell corresponding to a position (if it exist)
Definition: Quattro9Spreadsheet.cpp:715
bool readBeginColumn(std::shared_ptr< WPSStream > const &stream)
read the begin column zone: zone a01
Definition: Quattro9Spreadsheet.cpp:1543
librevenge::RVNGString getString(std::shared_ptr< WPSStream > const &stream, libwps_tools_win::Font::Type type=libwps_tools_win::Font::WIN3_WEUROPE) const
returns the string
Definition: Quattro9.cpp:280
Quattro9Parser & m_mainParser
the listener (if set)
Definition: Quattro9Spreadsheet.h:144
Definition: libwps_internal.h:401
int m_sheetId[2]
the sheet id
Definition: WKSContentListener.h:94
CellData()
constructor
Definition: Quattro9Spreadsheet.cpp:236
bool readCellStyles(std::shared_ptr< WPSStream > const &stream)
reads a cell attribute: zone a
Definition: Quattro9Spreadsheet.cpp:892
std::map< int, std::pair< std::shared_ptr< WPSStream >, Quattro9ParserInternal::TextEntry > > m_rowToCellResMap
a map row to cell result
Definition: Quattro9Spreadsheet.cpp:443
int m_width
the border width
Definition: libwps_internal.h:450
librevenge::RVNGString getSheetName(int id) const
returns the name of the id's spreadsheet
Definition: Quattro9Spreadsheet.cpp:847
void sendCellContent(Quattro9SpreadsheetInternal::CellData const *cell, Vec2i pos, int sheetId, int numRepeated)
send the cell data
Definition: Quattro9Spreadsheet.cpp:2046
bool operator==(Style const &st) const
operator==
Definition: Quattro9Spreadsheet.cpp:99
bool readColRowDimensions(std::shared_ptr< WPSStream > const &stream)
read a col/row dimensions: zone 635, 636
Definition: Quattro9Spreadsheet.cpp:1431
void sendSpreadsheet(int sheetId)
send the sheetId'th spreadsheet
Definition: Quattro9Spreadsheet.cpp:2012
bool isWhite() const
return true if the color is white
Definition: libwps_internal.h:350
This class parses Quattro Pro WP spreadsheet: .qpw.
Definition: Quattro9.h:89
define the font properties
Definition: WPSFont.h:36
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:702
std::vector< WPSBox2i > m_mergedCellList
the merge cells
Definition: Quattro9Spreadsheet.cpp:729
void setPosition(Vec2i posi)
set the cell positions : 0,0 -> A1, 0,1 -> A2
Definition: WPSCell.h:340
std::vector< Style > m_stylesList
the list of styles
Definition: Quattro9Spreadsheet.cpp:777
std::map< int, librevenge::RVNGString > m_idToUserFormatMap
map id to user format string
Definition: Quattro9Spreadsheet.cpp:783
Column m_invalidColumn
a extra column used to return an invalid column
Definition: Quattro9Spreadsheet.cpp:734
int getFlag(int row) const
returns the flag value corresponding to a row
Definition: Quattro9Spreadsheet.cpp:289
What m_type
the type
Definition: WKSContentListener.h:77
std::map< int, Column > m_colToColumnMap
a map col to column data
Definition: Quattro9Spreadsheet.cpp:731
Vec2i m_position[2]
cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:85
std::shared_ptr< WPSListener > WPSListenerPtr
shared pointer to WPSListener
Definition: libwps_internal.h:105
bool readColRowDefault(std::shared_ptr< WPSStream > const &stream)
read a col/row default dimension: zone 631, 632
Definition: Quattro9Spreadsheet.cpp:1357
WPSColor m_color
the border color
Definition: libwps_internal.h:456
Quattro9Spreadsheet(Quattro9Parser &parser)
constructor
Definition: Quattro9Spreadsheet.cpp:789
WPSColor m_colors[2]
the two indexed colors
Definition: WPSGraphicStyle.h:189
const CellData * getCell(int row) const
returns the cell corresponding to a row (if it exist)
Definition: Quattro9Spreadsheet.cpp:432
the state of Quattro9Spreadsheet
Definition: Quattro9Spreadsheet.cpp:738
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:704
bool getAverageColor(WPSColor &col) const
return the average color
Definition: WPSGraphicStyle.cpp:61
void setColRowSizes(int which, int minPos, int maxPos, int w)
set the col/row size in TWIP
Definition: Quattro9Spreadsheet.cpp:602
~Style() final
destructor
Definition: Quattro9Spreadsheet.cpp:83
bool readPageBreak(std::shared_ptr< WPSStream > const &stream)
read the page break zone: zone 617
Definition: Quattro9Spreadsheet.cpp:1509
Column()
constructor
Definition: Quattro9Spreadsheet.cpp:382
bool readEndSheet(std::shared_ptr< WPSStream > const &stream)
read the end sheet zone: zone 602
Definition: Quattro9Spreadsheet.cpp:1340
the spreadsheet of a Quattro Spreadsheet
Definition: Quattro9Spreadsheet.cpp:447
std::shared_ptr< Quattro9SpreadsheetInternal::State > m_state
the internal state
Definition: Quattro9Spreadsheet.h:146
std::string m_extra
extra data
Definition: Quattro9Spreadsheet.cpp:80
bool getExternalFileName(int fId, librevenge::RVNGString &fName) const
returns the name of the fId file
Definition: Quattro9.cpp:427
Definition: libwps_internal.h:401
bool readCellResult(std::shared_ptr< WPSStream > const &stream)
reads a cell result zone: zone c02
Definition: Quattro9Spreadsheet.cpp:1831
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:76
int version() const
return the file version
Definition: Quattro9Spreadsheet.cpp:810
WPSColor m_color
the font color
Definition: WPSFont.h:89
double getDouble(int row) const
returns the double value corresponding to a row
Definition: Quattro9Spreadsheet.cpp:252
void setBegin(long off)
sets the begin offset
Definition: WPSEntry.h:55
std::ostream & operator<<(std::ostream &o, Style const &style)
operator<<
Definition: Quattro9Spreadsheet.cpp:88
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:114
librevenge::RVNGString m_sheetName[2]
the sheet name
Definition: WKSContentListener.h:89
void updateListOfRows(std::set< int > &rows) const
update a list of row (needed to know what row must be sent)
Definition: Quattro9Spreadsheet.cpp:415
void add(int row, std::shared_ptr< WPSStream > const &stream, Quattro9ParserInternal::TextEntry const &entry)
add a cell result
Definition: Quattro9Spreadsheet.cpp:405
Definition: Quattro9.h:42
bool m_alignAcrossColumn
flag to know if we must align across column
Definition: Quattro9Spreadsheet.cpp:78
bool readMergedCells(std::shared_ptr< WPSStream > const &stream)
read the merged cell: zone 61d
Definition: Quattro9Spreadsheet.cpp:1470
small class use to define a formula instruction
Definition: WKSContentListener.h:57
Definition: libwps_internal.h:397
Internal: a list of cell and result of Quattro9SpreadsheetInternal.
Definition: Quattro9Spreadsheet.cpp:379
int getInt(int row) const
returns the int value corresponding to a row
Definition: Quattro9Spreadsheet.cpp:326
Definition: libwps_internal.h:401
std::map< int, std::shared_ptr< Spreadsheet > > m_spreadsheetMap
the map of spreadsheet
Definition: Quattro9Spreadsheet.cpp:779
#define WPS_HIDDEN_BIT
Definition: libwps_internal.h:516
bool readDouble4(RVNGInputStreamPtr &input, double &res, bool &isNaN)
read a double store with 4 bytes: mantisse 2.5 bytes, exponent 1.5 bytes
Definition: libwps_internal.cpp:90
static void addNote(char const *)
Definition: WPSDebug.h:221
std::vector< double > m_doubleList
the list of double values
Definition: Quattro9Spreadsheet.cpp:373
std::pair< std::shared_ptr< WPSStream >, std::vector< WPSEntry > > m_documentFormulas
the document formulas
Definition: Quattro9Spreadsheet.cpp:769
QuattroFormulaManager::CellReferenceFunction getReadCellReferenceFunction()
returns the function to read a cell's reference
Definition: Quattro9Spreadsheet.cpp:817
Internal: namespace to define internal class of Quattro9Parser.
Definition: Quattro9.cpp:57
State(QuattroFormulaManager::CellReferenceFunction const &readCellReference)
constructor
Definition: Quattro9Spreadsheet.cpp:741
void cleanState()
clean internal state
Definition: Quattro9Spreadsheet.cpp:801
std::shared_ptr< Spreadsheet > m_actualSpreadsheet
the actual sheet
Definition: Quattro9Spreadsheet.cpp:773
Cell()
constructor
Definition: Quattro9Spreadsheet.cpp:112
int m_version
the file version
Definition: Quattro9Spreadsheet.cpp:765
QuattroFormulaManager m_formulaManager
the formula manager
Definition: Quattro9Spreadsheet.cpp:771
bool readFilePositions(std::shared_ptr< WPSStream > const &stream, long(&filePos)[2])
read a zone which contains two files position (prev and next): zone 2,402,602,a02
Definition: Quattro9.cpp:1690
std::vector< int > m_intList
the list of int values
Definition: Quattro9Spreadsheet.cpp:371
bool send(WPSListenerPtr &) final
call when a cell must be send
Definition: Quattro9Spreadsheet.cpp:225
librevenge::RVNGString getSheetName(int id) const
returns the ith spreadsheet
Definition: Quattro9Spreadsheet.cpp:755
Style m_style
the border style
Definition: libwps_internal.h:446
int m_actualColumn
the actual column
Definition: Quattro9Spreadsheet.cpp:775
bool getPattern(int id, WPSGraphicStyle::Pattern &pattern) const
returns the pattern corresponding to a pattern id between 0 and 24
Definition: Quattro9.cpp:496
bool getField(int fId, librevenge::RVNGString &text, QuattroFormulaInternal::CellReference &ref, librevenge::RVNGString const &fileName) const
returns the text and cell of a field instruction
Definition: Quattro9.cpp:444
bool readDouble8(RVNGInputStreamPtr &input, double &res, bool &isNaN)
read a double store with 8 bytes: mantisse 6.5 bytes, exponent 1.5 bytes
Definition: libwps_internal.cpp:173
Definition: libwps_internal.h:397
bool getColor(int id, WPSColor &color) const
returns the color corresponding to an id
Definition: Quattro9.cpp:491
std::map< int, librevenge::RVNGString > m_idToSheetNameMap
the map id to sheet's name
Definition: Quattro9Spreadsheet.cpp:781
a cellule of a Quattro spreadsheet
Definition: Quattro9Spreadsheet.cpp:108
std::string getDebugString(std::shared_ptr< WPSStream > const &stream) const
internal: returns a debug string
Definition: Quattro9.cpp:313
ContentType m_contentType
the content type ( by default unknown )
Definition: WKSContentListener.h:147
bool readColRowDimension(std::shared_ptr< WPSStream > const &stream)
read a col/row dimension: zone 633, 634
Definition: Quattro9Spreadsheet.cpp:1393
int m_id
the spreadsheet id
Definition: Quattro9Spreadsheet.cpp:722
a structure used to defined the cell position, and a format
Definition: WPSCell.h:290
Definition: WPSDebug.h:191
Vec2i m_defaultSizes
the default col/row size in TWIP
Definition: Quattro9Spreadsheet.cpp:725
bool readDocumentFormulas(std::shared_ptr< WPSStream > const &stream)
reads the document formulas: zone 408
Definition: Quattro9Spreadsheet.cpp:1191
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
a border list
Definition: libwps_internal.h:394
WPSRowFormat getRowHeight(int row) const
returns the row size in point
Definition: Quattro9Spreadsheet.cpp:545
~Quattro9Spreadsheet()
destructor
Definition: Quattro9Spreadsheet.cpp:797
Vec2i m_rows
the min/max row
Definition: Quattro9Spreadsheet.cpp:365
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: Quattro9Spreadsheet.h:66
std::map< Vec2i, int > m_sizesMap[2]
the map Vec2i(min, max) to col/row size in TWIP
Definition: Quattro9Spreadsheet.cpp:727
bool readEndColumn(std::shared_ptr< WPSStream > const &stream)
read the end column zone: zone a02
Definition: Quattro9Spreadsheet.cpp:1582
bool readPString(std::shared_ptr< WPSStream > const &stream, long endPos, Quattro9ParserInternal::TextEntry &entry)
try to read a string: length[2bytes], unknow[bytes] followed by the string
Definition: Quattro9.cpp:1258
void addUserFormat(int id, librevenge::RVNGString const &name)
add a user format's correspondance between an id and a name
Definition: Quattro9Spreadsheet.cpp:857
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
Definition: libwps_internal.h:399
a class used to store a style of a cell in Quattro9Spreadsheet
Definition: Quattro9Spreadsheet.cpp:53
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
bool sendContent(WPSListenerPtr &) final
call when the content of a cell must be send
Definition: Quattro9Spreadsheet.cpp:219
a class used to store the cell(s) content of a Quattro Spreadsheet
Definition: Quattro9Spreadsheet.cpp:233
Definition: libwps_internal.h:401
Type m_type
the border repetition
Definition: libwps_internal.h:448
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
void addDLLIdName(int id, librevenge::RVNGString const &name, bool func1)
add a dll's correspondance between an id and a name
Definition: Quattro9Spreadsheet.cpp:852
std::map< Vec2i, CellData > m_rowsToCellMap
a map rows to cell data
Definition: Quattro9Spreadsheet.cpp:441
bool readCell(std::shared_ptr< WPSStream > const &stream, Vec2i actPos, WKSContentListener::FormulaInstruction &instr, int sheetId, librevenge::RVNGString const &fName) const
Definition: Quattro9Spreadsheet.cpp:1881
Spreadsheet(int id)
a constructor
Definition: Quattro9Spreadsheet.cpp:451
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
Style()
construtor
Definition: Quattro9Spreadsheet.cpp:56
Vec2b m_positionRelative[2]
relative cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:87
a basic pattern used in a WPSGraphicStyle:
Definition: WPSGraphicStyle.h:88
Definition: WKSContentListener.h:102
the class to store a color
Definition: libwps_internal.h:280
int version() const
return the file version
Definition: Quattro9.cpp:417
void updateState()
update the state (need to be called before sending data)
Definition: Quattro9Spreadsheet.cpp:806
bool sendPageGraphics(int sheetId) const
send the page graphic corresponding to a sheet
Definition: Quattro9.cpp:501
std::vector< Vec2i > getListCellsInARow(int row) const
returns the list of columns in which a row cell exists
Definition: Quattro9Spreadsheet.cpp:692
Vec2i m_span
the column row/span
Definition: Quattro9Spreadsheet.cpp:367
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libwps_internal.h:700
void setValue(double value)
sets the double value
Definition: WKSContentListener.h:126
Definition: libwps_internal.h:397
small class use to define a sheet cell content
Definition: WKSContentListener.h:99
std::pair< std::shared_ptr< WPSStream >, std::vector< Quattro9ParserInternal::TextEntry > > m_documentStrings
the document strings
Definition: Quattro9Spreadsheet.cpp:767
bool readCellList(std::shared_ptr< WPSStream > const &stream)
reads a cell list zone: zone c01
Definition: Quattro9Spreadsheet.cpp:1597
Definition: WPSDebug.h:207
Definition: WKSContentListener.h:59
std::set< int > getListSendRow() const
returns the list of rows which need to be opened, ...
Definition: Quattro9Spreadsheet.cpp:674
std::vector< WPSColumnFormat > getWidths() const
return the columns format
Definition: Quattro9Spreadsheet.cpp:553
void add(Vec2i limits, CellData const &cell)
add a cell/list of cells data
Definition: Quattro9Spreadsheet.cpp:388
int m_style
the style id
Definition: Quattro9Spreadsheet.cpp:369
Definition: WKSContentListener.h:102
static WPSColor black()
return the back color
Definition: libwps_internal.h:306
void updateFormat(int fileFormat)
update the cell format using file format
Definition: Quattro9Spreadsheet.cpp:116
bool isBlack() const
return true if the color is black
Definition: libwps_internal.h:345
librevenge::RVNGString m_name
font name
Definition: WPSFont.h:81
bool getFont(int id, WPSFont &font) const
returns the font corresponding to an id
Definition: Quattro9.cpp:509
bool readCellReference(std::shared_ptr< WPSStream > const &stream, long endPos, QuattroFormulaInternal::CellReference &ref, Vec2i const &pos=Vec2i(0, 0), int sheetId=0) const
try to read a cell reference
Definition: Quattro9Spreadsheet.cpp:1920
bool empty() const
returns true if the cell contains no data (and is not a merged cell)
Definition: Quattro9Spreadsheet.cpp:247
Definition: Quattro9Spreadsheet.cpp:50
int getNumSpreadsheets() const
returns the number of spreadsheet
Definition: Quattro9Spreadsheet.cpp:827
void setNumSpannedCells(Vec2i numSpanned)
sets the number of spanned cells : Vec2i(1,1) means 1 cellule
Definition: WPSCell.h:351
Generated on Sat Oct 6 2018 17:10:15 for libwps by
doxygen 1.8.16