Go to the documentation of this file.
22 #ifndef WKS4_SPREADSHEET_H
23 #define WKS4_SPREADSHEET_H
28 #include <librevenge-stream/librevenge-stream.h>
131 std::vector<WKSContentListener::FormulaInstruction> &formula, std::string &error);
147 std::shared_ptr<WKS4SpreadsheetInternal::State>
m_state;
Definition: WKSContentListener.h:59
float getRowHeight(int row) const
returns the row size in point
Definition: WKS4Spreadsheet.cpp:302
bool readMsWorksDOSPageBreak()
reads a page break (in a dos file)
Definition: WKS4Spreadsheet.cpp:1372
static WPSColor white()
return the white color
Definition: libwps_internal.h:311
Type m_type
the spreadsheet type
Definition: WKS4Spreadsheet.cpp:402
void pushNewSheet(std::shared_ptr< Spreadsheet > sheet)
create a new sheet and stack id
Definition: WKS4Spreadsheet.cpp:473
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: WKS4Spreadsheet.cpp:536
bool readFormula(long endPos, Vec2i const &pos, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &error)
Definition: WKS4Spreadsheet.cpp:1910
librevenge::RVNGString getSheetName(int id) const
returns the name of the id's spreadsheet
Definition: WKS4Spreadsheet.cpp:553
static std::string str()
Definition: WPSDebug.h:200
void resetInput(RVNGInputStreamPtr const &input)
reset the main input
Definition: WKS4Spreadsheet.cpp:524
Definition: WKSContentListener.h:59
Definition: WKSContentListener.h:102
bool readCellFormulaResult()
reads the result of a text formula
Definition: WKS4Spreadsheet.cpp:1745
#define WPS_BOLD_BIT
Definition: libwps_internal.h:506
const char * m_name
Definition: WKS4Spreadsheet.cpp:1856
static void addPos(long)
Definition: WPSDebug.h:220
Definition: WKSContentListener.h:59
the state of WKS4Spreadsheet
Definition: WKS4Spreadsheet.cpp:426
long end() const
returns the end offset
Definition: WPSEntry.h:76
bool readReportClose()
reads the report's end zone 18:54
Definition: WKS4Spreadsheet.cpp:2312
the style manager
Definition: WKS4Spreadsheet.cpp:133
void setColumnWidth(int col, int w=-1)
set the columns size
Definition: WKS4Spreadsheet.cpp:293
Style(libwps_tools_win::Font::Type type)
construtor
Definition: WKS4Spreadsheet.cpp:53
Type
the spreadsheet type
Definition: WKS4Spreadsheet.cpp:259
StyleManager m_styleManager
the style manager
Definition: WKS4Spreadsheet.cpp:499
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: WKS4Spreadsheet.h:58
Cell & getCell(Vec2i const &pos)
return a cell corresponding to a spreadsheet, create one if needed
Definition: WKS4Spreadsheet.cpp:274
void setRowHeight(int row, int h)
set the rows size
Definition: WKS4Spreadsheet.cpp:325
#define WPS_UNDERLINE_BIT
Definition: libwps_internal.h:508
int getNumSpreadsheets() const
returns the number of spreadsheet
Definition: WKS4Spreadsheet.cpp:548
std::vector< WPSColumnFormat > getWidths(float defSize=72) const
return the columns format
Definition: WKS4Spreadsheet.cpp:366
Definition: WKS4Spreadsheet.cpp:259
Definition: WKSContentListener.h:59
Definition: libwps_internal.h:401
Definition: WKSContentListener.h:59
double m_longValue
value ( if type==F_Long )
Definition: WKSContentListener.h:81
a class used to store a style of a cell in WKS4Spreadsheet
Definition: WKS4Spreadsheet.cpp:50
bool readHiddenColumns()
reads the list of hidden columns zone ( unused )
Definition: WKS4Spreadsheet.cpp:648
Definition: WKSContentListener.h:59
a cellule of a WKS4 spreadsheet
Definition: WKS4Spreadsheet.cpp:186
int m_unknFlags[10]
some flag
Definition: WKS4Spreadsheet.cpp:79
int m_width
the border width
Definition: libwps_internal.h:450
int m_heightDefault
the default row size in point
Definition: WKS4Spreadsheet.cpp:415
double m_doubleValue
value ( if type==F_Double )
Definition: WKSContentListener.h:83
std::shared_ptr< WKSContentListener > m_listener
Definition: WKS4Spreadsheet.h:143
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition: WKS4.cpp:287
WKS4Spreadsheet(WKS4Parser &parser)
constructor
Definition: WKS4Spreadsheet.cpp:510
define the font properties
Definition: WPSFont.h:36
static WPSColor barycenter(float alpha, WPSColor const &colA, float beta, WPSColor const &colB)
return alpha*colA+beta*colB
Definition: libwps_internal.cpp:386
bool valid(bool checkId=false) const
returns true if the zone length is positive
Definition: WPSEntry.h:87
#define WPS_ITALICS_BIT
Definition: libwps_internal.h:502
Definition: WKS4Spreadsheet.cpp:45
WPSFont m_fileFont
the font
Definition: WKS4Spreadsheet.cpp:75
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
void setPosition(Vec2i posi)
set the cell positions : 0,0 -> A1, 0,1 -> A2
Definition: WPSCell.h:340
int m_numCols
the number of columns
Definition: WKS4Spreadsheet.cpp:406
std::map< Vec2i, int > m_rowHeightMap
the map Vec2i(min row, max row) to size in TWIP (?)
Definition: WKS4Spreadsheet.cpp:413
int m_arity
Definition: WKS4Spreadsheet.cpp:1857
What m_type
the type
Definition: WKSContentListener.h:77
std::vector< std::shared_ptr< Spreadsheet > > m_spreadsheetList
the list of spreadsheet ( first: main spreadsheet, other report spreadsheet )
Definition: WKS4Spreadsheet.cpp:502
Vec2i m_position[2]
cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:85
int version() const
return the file version
Definition: WKS4Spreadsheet.cpp:529
std::shared_ptr< WPSListener > WPSListenerPtr
shared pointer to WPSListener
Definition: libwps_internal.h:105
void sendCellContent(WKS4SpreadsheetInternal::Cell const &cell)
send the cell data
Definition: WKS4Spreadsheet.cpp:2396
long m_eof
the last file position
Definition: WKS4Spreadsheet.cpp:495
WPSColor m_color
the border color
Definition: libwps_internal.h:456
bool operator==(Style const &st) const
operator==
Definition: WKS4Spreadsheet.cpp:116
Spreadsheet & getActualSheet()
returns the actual sheet
Definition: WKS4Spreadsheet.cpp:468
std::vector< int > m_rowPageBreaksList
the list of row page break
Definition: WKS4Spreadsheet.cpp:421
std::string m_extra
extra data
Definition: WKS4Spreadsheet.cpp:81
bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
returns the font corresponding to an id
Definition: WKS4.cpp:305
int add(Style const &st, bool dosFile)
add a new style and returns its id
Definition: WKS4Spreadsheet.cpp:139
std::shared_ptr< WKS4SpreadsheetInternal::State > m_state
the internal state
Definition: WKS4Spreadsheet.h:147
Definition: WKSContentListener.h:102
std::stack< std::shared_ptr< Spreadsheet > > m_spreadsheetStack
the stack of spreadsheet id
Definition: WKS4Spreadsheet.cpp:504
bool readMsWorksStyle()
reads a style
Definition: WKS4Spreadsheet.cpp:798
Definition: libwps_internal.h:401
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
bool empty() const
returns true if the spreedsheet is empty
Definition: WKS4Spreadsheet.cpp:397
std::vector< WPSEntry > m_extraTextEntryList
As very long text is splitted in zone 0xf and then in zone 0x36, the list of zone36 text entries....
Definition: WKS4Spreadsheet.cpp:218
bool send(WPSListenerPtr &) final
call when a cell must be send
Definition: WKS4Spreadsheet.cpp:221
#define WPS_FALLTHROUGH
fall through attributes
Definition: libwps_internal.h:82
void setBegin(long off)
sets the begin offset
Definition: WPSEntry.h:55
bool readMsWorksPageBreak()
reads a page break
Definition: WKS4Spreadsheet.cpp:768
std::shared_ptr< Spreadsheet > getSheet(Spreadsheet::Type type, int id)
returns the ith real spreadsheet
Definition: WKS4Spreadsheet.cpp:450
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:114
int size() const
returns the number of style
Definition: WKS4Spreadsheet.cpp:163
bool sendContent(WPSListenerPtr &) final
call when the content of a cell must be send
Definition: WKS4Spreadsheet.cpp:203
small class use to define a formula instruction
Definition: WKSContentListener.h:57
static const Functions s_listFunctions[]
Definition: WKS4Spreadsheet.cpp:1860
Definition: libwps_internal.h:397
bool readMsWorksDOSCellExtraProperty()
reads the actual cell addendum properties ( contains at least the color)
Definition: WKS4Spreadsheet.cpp:1298
libwps::DebugFile & m_asciiFile
the ascii file
Definition: WKS4Spreadsheet.h:149
bool readMsWorksRowSize()
reads the row size ( in ???)
Definition: WKS4Spreadsheet.cpp:731
libwps_tools_win::Font::Type m_fontType
font encoding type
Definition: WKS4Spreadsheet.cpp:77
Definition: libwps_internal.h:401
~WKS4Spreadsheet()
destructor
Definition: WKS4Spreadsheet.cpp:520
#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
std::ostream & operator<<(std::ostream &o, Style const &style)
operator<<
Definition: WKS4Spreadsheet.cpp:89
static void addNote(char const *)
Definition: WPSDebug.h:221
long begin() const
returns the begin offset
Definition: WPSEntry.h:71
State()
constructor
Definition: WKS4Spreadsheet.cpp:429
bool readMsWorksColumnSize()
reads the column size ( in ???)
Definition: WKS4Spreadsheet.cpp:692
int8_t read8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:59
int getMaximalSheet(Spreadsheet::Type type=Spreadsheet::T_Spreadsheet) const
returns the maximal spreadsheet
Definition: WKS4Spreadsheet.cpp:439
Style m_style
the border style
Definition: libwps_internal.h:446
int m_id
the spreadsheet id
Definition: WKS4Spreadsheet.cpp:404
bool readCString(librevenge::RVNGString &string, long maxSize)
try to read a basic C string, knowing the maximum size
Definition: WKS4.cpp:1388
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
WKS4Parser & m_mainParser
the listener (if set)
Definition: WKS4Spreadsheet.h:145
WPSEntry m_textEntry
the cell string
Definition: WKSContentListener.h:153
bool readCell()
reads a cell content data
Definition: WKS4Spreadsheet.cpp:1405
std::vector< int > m_widthCols
the column size in TWIP (?)
Definition: WKS4Spreadsheet.cpp:411
a structure used to defined the cell position, and a format
Definition: WPSCell.h:290
Definition: WPSDebug.h:191
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
Definition: WKS4Spreadsheet.cpp:259
a border list
Definition: libwps_internal.h:394
the spreadsheet of a WPS4Spreadsheet
Definition: WKS4Spreadsheet.cpp:255
bool readReportOpen()
reads the report's header zone 17:54
Definition: WKS4Spreadsheet.cpp:2244
bool readSheetSize()
reads sheet size
Definition: WKS4Spreadsheet.cpp:564
std::string m_content
the content ( if type == F_Operator or type = F_Function or type==F_Text)
Definition: WKSContentListener.h:79
void setEnd(long e)
sets the end offset
Definition: WPSEntry.h:65
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
bool readFilterClose()
reads the filter's end zone 11:54
Definition: WKS4Spreadsheet.cpp:2210
WKS4Spreadsheet & operator=(WKS4Spreadsheet const &orig)=delete
Definition: libwps_internal.h:399
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
libwps::DebugFile & ascii()
returns the debug file
Definition: WKS4Spreadsheet.h:137
Definition: libwps_internal.h:401
Type m_type
the border repetition
Definition: libwps_internal.h:448
bool readFilterOpen()
reads the filter's header zone 10:54
Definition: WKS4Spreadsheet.cpp:2184
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
Definition: WKS4Spreadsheet.cpp:259
int m_numRows
the number of rows
Definition: WKS4Spreadsheet.cpp:408
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
Cell()
constructor
Definition: WKS4Spreadsheet.cpp:190
StyleManager()
Definition: WKS4Spreadsheet.cpp:136
std::map< Vec2i, Cell > m_positionToCellMap
a map cell to not empty cells
Definition: WKS4Spreadsheet.cpp:417
Vec2b m_positionRelative[2]
relative cell position ( if type==F_Cell or F_CellList )
Definition: WKSContentListener.h:87
This class parses Microsoft Works spreadsheet file.
Definition: WKS4Spreadsheet.h:48
Definition: WKSContentListener.h:102
the class to store a color
Definition: libwps_internal.h:280
bool readMsWorksDOSCellProperty()
reads actualCell properties
Definition: WKS4Spreadsheet.cpp:1042
WKSContentListener::CellContent m_content
the content
Definition: WKS4Spreadsheet.cpp:214
int m_styleId
the style
Definition: WKS4Spreadsheet.cpp:210
bool readColumnSize()
reads the column size ( in ??? )
Definition: WKS4Spreadsheet.cpp:602
Cell * getLastCell()
returns the last cell
Definition: WKS4Spreadsheet.cpp:286
Definition: WKSContentListener.h:102
float getRowHeight(int row, int &numRepeated) const
returns the height of a row in point and updated repeated row
Definition: WKS4Spreadsheet.cpp:313
Vec2i m_lastCellPos
the last cell position
Definition: WKS4Spreadsheet.cpp:419
Vec2< bool > Vec2b
Vec2 of bool.
Definition: libwps_internal.h:700
Definition: libwps_internal.h:397
friend std::ostream & operator<<(std::ostream &o, Cell const &cell)
operator<<
Definition: WKS4Spreadsheet.cpp:228
small class use to define a sheet cell content
Definition: WKSContentListener.h:99
int version() const
return the file version
Definition: WKS4.cpp:256
This class parses Microsoft Works spreadsheet or a database file.
Definition: WKS4.h:48
RVNGInputStreamPtr m_input
the input
Definition: WKS4Spreadsheet.h:142
std::vector< Style > m_stylesList
the styles
Definition: WKS4Spreadsheet.cpp:182
Definition: WPSDebug.h:207
Style & operator=(Style const &)=default
bool get(int id, Style &style) const
returns the style with id
Definition: WKS4Spreadsheet.cpp:152
Definition: WKSContentListener.h:59
bool readMsWorksDOSFieldProperty()
reads a field property
Definition: WKS4Spreadsheet.cpp:1211
bool getColor(int id, WPSColor &color) const
returns the color corresponding to an id
Definition: WKS4.cpp:300
Definition: WKSContentListener.h:102
void compressRowHeights()
try to compress the list of row height
Definition: WKS4Spreadsheet.cpp:331
~Style() final
destructor
Definition: WKS4Spreadsheet.cpp:84
Definition: WKS4Spreadsheet.cpp:1854
librevenge::RVNGString getSheetName(int id) const
returns the ith spreadsheet
Definition: WKS4Spreadsheet.cpp:461
int m_version
the file version
Definition: WKS4Spreadsheet.cpp:497
static WPSColor black()
return the back color
Definition: libwps_internal.h:306
void sendSpreadsheet(int sId)
send the sId'th spreadsheet
Definition: WKS4Spreadsheet.cpp:2346
bool popSheet()
try to pop the actual sheet
Definition: WKS4Spreadsheet.cpp:484
WPSCellFormat::HorizontalAlignment m_hAlignement
the horizontal align (in dos file)
Definition: WKS4Spreadsheet.cpp:212
void print(int id, std::ostream &o) const
print a style
Definition: WKS4Spreadsheet.cpp:168
Spreadsheet(Type type=T_Spreadsheet, int id=0)
a constructor
Definition: WKS4Spreadsheet.cpp:262
Generated on Mon Jan 20 2020 20:05:54 for libwps by
doxygen 1.8.16