Go to the documentation of this file.
22 #ifndef QUATTRO_SPREADSHEET_H
23 #define QUATTRO_SPREADSHEET_H
29 #include <librevenge-stream/librevenge-stream.h>
81 void sendSpreadsheet(
int sheetId, std::vector<Vec2i>
const &listGraphicCells);
98 bool readCell(std::shared_ptr<WPSStream>
const &stream);
100 bool readSheetSize(std::shared_ptr<WPSStream>
const &stream);
106 bool readRowSize(std::shared_ptr<WPSStream>
const &stream);
113 bool readSheetName(std::shared_ptr<WPSStream>
const &stream);
115 bool readCellStyle(std::shared_ptr<WPSStream>
const &stream);
118 bool readViewInfo(std::shared_ptr<WPSStream>
const &stream);
127 Vec2i const &pos=
Vec2i(0,0),
int sheetId=0)
const;
136 std::shared_ptr<QuattroSpreadsheetInternal::State>
m_state;
@ F_Text
Definition: WKSContentListener.h:59
static WPSColor white()
return the white color
Definition: libwps_internal.h:311
void compressRowHeights()
try to compress the list of row height
Definition: QuattroSpreadsheet.cpp:388
int m_actSheet
the actual sheet
Definition: QuattroSpreadsheet.cpp:522
bool empty() const
returns true if the spreedsheet is empty
Definition: QuattroSpreadsheet.cpp:293
bool readCellStyle(std::shared_ptr< WPSStream > const &stream)
reads a cell attribute: zone 0xce
Definition: QuattroSpreadsheet.cpp:810
Definition: QuattroSpreadsheet.cpp:50
int m_id
the spreadsheet id
Definition: QuattroSpreadsheet.cpp:457
librevenge::RVNGString m_fileName
the file name (external reference)
Definition: WKSContentListener.h:96
static std::string str()
Definition: WPSDebug.h:200
~QuattroSpreadsheet()
destructor
Definition: QuattroSpreadsheet.cpp:547
@ C_FORMULA
Definition: WKSContentListener.h:102
void setColumnWidth(int col, int w=-1)
set the columns size
Definition: QuattroSpreadsheet.cpp:298
static void addPos(long)
Definition: WPSDebug.h:220
@ F_Cell
Definition: WKSContentListener.h:59
long end() const
returns the end offset
Definition: WPSEntry.h:76
Vec2f getPosition(Vec2i const &cell) const
returns the cell position
Definition: QuattroSpreadsheet.cpp:422
bool send(WPSListenerPtr &) final
call when a cell must be send
Definition: QuattroSpreadsheet.cpp:245
void updateCellWithUserFormat(QuattroSpreadsheetInternal::Cell &cell, librevenge::RVNGString const &format)
try to update the cell's format using the user format
Definition: QuattroSpreadsheet.cpp:1675
std::shared_ptr< WKSContentListener > m_listener
Definition: QuattroSpreadsheet.h:132
float getRowHeight(int row) const
returns the row size in point
Definition: QuattroSpreadsheet.cpp:368
std::string m_extra
extra data
Definition: QuattroSpreadsheet.cpp:82
bool readSheetName(std::shared_ptr< WPSStream > const &stream)
reads sheet name: zone cc
Definition: QuattroSpreadsheet.cpp:1330
int m_numCols
the number of columns
Definition: QuattroSpreadsheet.cpp:459
void updateFormat()
update the cell format using file format
Definition: QuattroSpreadsheet.cpp:136
libwps_tools_win::Font::Type m_fontType
font encoding type
Definition: QuattroSpreadsheet.cpp:231
bool readViewInfo(std::shared_ptr< WPSStream > const &stream)
reads a view info: zone 197/198
Definition: QuattroSpreadsheet.cpp:1371
Definition: libwps_internal.cpp:39
void addUserFormat(int id, librevenge::RVNGString const &name)
add a user format's correspondance between an id and a name
Definition: QuattroSpreadsheet.cpp:607
bool m_alignAcrossColumn
flag to know if we must align across column
Definition: QuattroSpreadsheet.cpp:80
@ BottomBit
Definition: libwps_internal.h:401
int m_sheetId[2]
the sheet id
Definition: WKSContentListener.h:94
static int strncasecmp(char const *s1, char const *s2, size_t n)
Definition: QuattroSpreadsheet.cpp:1658
void sendCellContent(QuattroSpreadsheetInternal::Cell const &cell, int sheetId)
send the cell data
Definition: QuattroSpreadsheet.cpp:1900
std::vector< WPSColumnFormat > getWidths() const
return the columns format
Definition: QuattroSpreadsheet.cpp:307
std::vector< int > m_widthCols
the column size in TWIP
Definition: QuattroSpreadsheet.cpp:466
bool readBeginEndSheet(std::shared_ptr< WPSStream > const &stream, int &sheetId)
read the begin/end of a sheet zone: zone ca and cb
Definition: QuattroSpreadsheet.cpp:1283
the spreadsheet of a Quattro Spreadsheet
Definition: QuattroSpreadsheet.cpp:262
void cleanState()
clean internal state
Definition: QuattroSpreadsheet.cpp:551
int m_width
the border width
Definition: libwps_internal.h:450
QuattroSpreadsheet(QuattroSpreadsheet const &orig)=delete
bool operator==(Style const &st) const
operator==
Definition: QuattroSpreadsheet.cpp:101
QuattroSpreadsheet & operator=(QuattroSpreadsheet const &orig)=delete
QuattroFormulaManager m_formulaManager
the formula manager
Definition: QuattroSpreadsheet.cpp:526
void sendSpreadsheet(int sheetId, std::vector< Vec2i > const &listGraphicCells)
send the sheetId'th spreadsheet
Definition: QuattroSpreadsheet.cpp:1586
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: QuattroSpreadsheet.cpp:1495
define the font properties
Definition: WPSFont.h:37
static WPSColor barycenter(float alpha, WPSColor const &colA, float beta, WPSColor const &colB)
return alpha*colA+beta*colB
Definition: libwps_internal.cpp:386
QuattroSpreadsheet(QuattroParser &parser)
constructor
Definition: QuattroSpreadsheet.cpp:539
bool valid(bool checkId=false) const
returns true if the zone length is positive
Definition: WPSEntry.h:87
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:702
void setPosition(Vec2i posi)
set the cell positions : 0,0 -> A1, 0,1 -> A2
Definition: WPSCell.h:340
bool getExternalFileName(int fId, librevenge::RVNGString &fName) const
returns the name of the fId file
Definition: Quattro.cpp:495
WKSContentListener::CellContent m_content
the content
Definition: QuattroSpreadsheet.cpp:239
What m_type
the type
Definition: WKSContentListener.h:77
Vec2i m_position[2]
cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:85
Cell(libwps_tools_win::Font::Type type)
constructor
Definition: QuattroSpreadsheet.cpp:114
std::shared_ptr< WPSListener > WPSListenerPtr
shared pointer to WPSListener
Definition: libwps_internal.h:105
Cell & getCell(Vec2i const &pos, libwps_tools_win::Font::Type type)
return a cell corresponding to a spreadsheet, create one if needed
Definition: QuattroSpreadsheet.cpp:277
WPSColor m_color
the border color
Definition: libwps_internal.h:456
bool m_hasGraphic
a flag to know a cell has some graphic
Definition: QuattroSpreadsheet.cpp:241
WPSVec3i m_maxDimension
the maximum col, row, sheet
Definition: QuattroSpreadsheet.cpp:520
bool getColor(int id, WPSColor &color) const
returns the color corresponding to an id
Definition: Quattro.cpp:576
bool m_alignAcrossColumn
flag to know if we must align across column
Definition: QuattroSpreadsheet.cpp:237
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:704
std::ostream & operator<<(std::ostream &o, Style const &style)
operator<<
Definition: QuattroSpreadsheet.cpp:90
void addDLLIdName(int id, librevenge::RVNGString const &name, bool func1)
add a dll's correspondance between an id and a name
Definition: QuattroSpreadsheet.cpp:602
small class which defines a vector with 2 elements
Definition: libwps_internal.h:535
a class used to store a style of a cell in QuattroSpreadsheet
Definition: QuattroSpreadsheet.cpp:53
@ TopBit
Definition: libwps_internal.h:401
int m_version
the file version
Definition: QuattroSpreadsheet.cpp:518
bool readSheetSize(std::shared_ptr< WPSStream > const &stream)
reads sheet size: zone 06
Definition: QuattroSpreadsheet.cpp:1046
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
This class parses Quattro Pro spreadsheet file.
Definition: QuattroSpreadsheet.h:52
bool sendContent(WPSListenerPtr &) final
call when the content of a cell must be send
Definition: QuattroSpreadsheet.cpp:130
WPSColor m_color
the font color
Definition: WPSFont.h:89
#define WPS_FALLTHROUGH
fall through attributes
Definition: libwps_internal.h:82
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: QuattroSpreadsheet.h:61
bool readColumnSize(std::shared_ptr< WPSStream > const &stream)
reads the column size: zone d8,d9
Definition: QuattroSpreadsheet.cpp:1127
Style(libwps_tools_win::Font::Type type)
construtor
Definition: QuattroSpreadsheet.cpp:55
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
int m_fileFormat
the file format
Definition: QuattroSpreadsheet.cpp:233
bool sendPageGraphics(int sheetId) const
send the page graphic corresponding to a sheet
Definition: Quattro.cpp:556
std::map< int, librevenge::RVNGString > m_idToSheetNameMap
the map id to sheet's name
Definition: QuattroSpreadsheet.cpp:531
small class use to define a formula instruction
Definition: WKSContentListener.h:58
bool readCString(std::shared_ptr< WPSStream > stream, librevenge::RVNGString &string, long maxSize)
try to read a basic C string, knowing the maximum size
Definition: Quattro.cpp:1699
int version() const
return the file version
Definition: Quattro.cpp:485
std::vector< Style > m_stylesList
the list of styles
Definition: QuattroSpreadsheet.cpp:524
float m_heightDefault
the default row size in point
Definition: QuattroSpreadsheet.cpp:464
@ RightBit
Definition: libwps_internal.h:401
uint32_t m_attributes
the font attributes defined as a set of bits
Definition: WPSFont.h:85
bool readColumnRowDefaultSize(std::shared_ptr< WPSStream > const &stream)
reads the sheet column/row default size: zone d2-d5
Definition: QuattroSpreadsheet.cpp:1087
#define WPS_HIDDEN_BIT
Definition: libwps_internal.h:516
static void addNote(char const *)
Definition: WPSDebug.h:221
long begin() const
returns the begin offset
Definition: WPSEntry.h:71
int8_t read8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:59
int m_styleId
the style id
Definition: QuattroSpreadsheet.cpp:235
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: Quattro.cpp:507
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
WPSEntry m_textEntry
the cell string
Definition: WKSContentListener.h:153
void setRowHeights(int minRow, int maxRow, int h)
set the rows size in TWIP
Definition: QuattroSpreadsheet.cpp:350
Spreadsheet(int id, libwps_tools_win::Font::Type fontType)
a constructor
Definition: QuattroSpreadsheet.cpp:265
bool readRowRangeSize(std::shared_ptr< WPSStream > const &stream)
reads the row size: zone 105,106
Definition: QuattroSpreadsheet.cpp:1230
std::shared_ptr< Spreadsheet > getSheet(int id, libwps_tools_win::Font::Type fontType)
returns the ith real spreadsheet
Definition: QuattroSpreadsheet.cpp:491
int version() const
return the file version
Definition: QuattroSpreadsheet.cpp:560
void updateState()
update the state (need to be called before sending data)
Definition: QuattroSpreadsheet.cpp:556
a structure used to defined the cell position, and a format
Definition: WPSCell.h:291
Definition: WPSDebug.h:192
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
std::map< Vec2i, Cell > m_positionToCellMap
a map cell to not empty cells
Definition: QuattroSpreadsheet.cpp:470
a border list
Definition: libwps_internal.h:395
bool sendGraphics(int sheetId, Vec2i const &cell) const
send the graphic corresponding to a cell
Definition: Quattro.cpp:561
int m_fileFormat
the file format
Definition: QuattroSpreadsheet.cpp:78
float m_widthDefault
the default width size in point
Definition: QuattroSpreadsheet.cpp:468
This class parses Quattro Pro spreadsheet: .wb1, ..., .wb3.
Definition: Quattro.h:54
a cellule of a Quattro spreadsheet
Definition: QuattroSpreadsheet.cpp:111
WPSVec3< int > WPSVec3i
WPSVec3 of int.
Definition: libwps_internal.h:1067
float getRowHeight(int row, int &numRepeated) const
returns the height of a row in point and updated repeated row
Definition: QuattroSpreadsheet.cpp:376
QuattroFormulaManager::CellReferenceFunction getReadCellReferenceFunction()
returns the function to read a cell's reference
Definition: QuattroSpreadsheet.cpp:567
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition: Quattro.cpp:490
librevenge::RVNGString getSheetName(int id) const
returns the ith spreadsheet
Definition: QuattroSpreadsheet.cpp:508
@ Double
Definition: libwps_internal.h:399
int getNumSpreadsheets() const
returns the number of spreadsheet
Definition: QuattroSpreadsheet.cpp:577
Vec2i & position()
position accessor
Definition: WPSCell.h:330
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
std::shared_ptr< WPSStream > m_stream
the text stream(used to send text's zone)
Definition: QuattroSpreadsheet.cpp:243
@ LeftBit
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
std::map< int, librevenge::RVNGString > m_idToUserFormatMap
map id to user format string
Definition: QuattroSpreadsheet.cpp:533
bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
returns the font corresponding to an id
Definition: Quattro.cpp:581
~Style() final
destructor
Definition: QuattroSpreadsheet.cpp:85
std::map< int, std::shared_ptr< Spreadsheet > > m_spreadsheetMap
the map of spreadsheet
Definition: QuattroSpreadsheet.cpp:529
std::map< Vec2i, int > m_rowHeightMap
the map Vec2i(min row, max row) to size in TWIP
Definition: QuattroSpreadsheet.cpp:462
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
Vec2b m_positionRelative[2]
relative cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:87
@ C_TEXT
Definition: WKSContentListener.h:102
the class to store a color
Definition: libwps_internal.h:281
QuattroParser & m_mainParser
the listener (if set)
Definition: QuattroSpreadsheet.h:134
Style(Style const &)=default
Vec2f getPosition(int sheetId, Vec2i const &cell) const
returns the beginning position of a cell
Definition: QuattroSpreadsheet.cpp:591
@ C_NONE
Definition: WKSContentListener.h:102
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libwps_internal.h:700
small class use to define a sheet cell content
Definition: WKSContentListener.h:100
State(QuattroFormulaManager::CellReferenceFunction const &readCellReference)
constructor
Definition: QuattroSpreadsheet.cpp:479
libwps_tools_win::Font::Type m_fontType
font encoding type
Definition: QuattroSpreadsheet.cpp:76
friend std::ostream & operator<<(std::ostream &o, Cell const &cell)
operator<<
Definition: QuattroSpreadsheet.cpp:252
Definition: WPSDebug.h:208
void setRowHeight(int row, int h)
set the rows size in TWIP
Definition: QuattroSpreadsheet.cpp:338
librevenge::RVNGString getSheetName(int id) const
returns the name of the id's spreadsheet
Definition: QuattroSpreadsheet.cpp:586
the state of QuattroSpreadsheet
Definition: QuattroSpreadsheet.cpp:477
@ F_CellList
Definition: WKSContentListener.h:59
@ C_NUMBER
Definition: WKSContentListener.h:102
static WPSColor black()
return the back color
Definition: libwps_internal.h:306
Cell m_dummyCell
a dummy cell
Definition: QuattroSpreadsheet.cpp:472
bool readRowSize(std::shared_ptr< WPSStream > const &stream)
reads the row size: zone d6,d7
Definition: QuattroSpreadsheet.cpp:1181
std::shared_ptr< QuattroSpreadsheetInternal::State > m_state
the internal state
Definition: QuattroSpreadsheet.h:136
bool readCell(std::shared_ptr< WPSStream > const &stream)
reads a cell content data: zone 0xc-0x10 or 33
Definition: QuattroSpreadsheet.cpp:628
Generated on Tue Nov 14 2023 08:14:50 for libwps by
doxygen 1.8.20