20#ifndef SWINDER_EXCEL_H
21#define SWINDER_EXCEL_H
35enum { UnknownExcel = 0, Excel95, Excel97, Excel2000 };
47 EString(
const EString& );
49 EString& operator=(
const EString& );
55 void setUnicode(
bool u );
57 bool richText()
const;
59 void setRichText(
bool r );
63 void setStr(
const UString& str );
66 unsigned size()
const;
67 void setSize(
unsigned size );
70 static EString fromUnicodeString(
const void* p,
bool longString,
unsigned maxsize = 0 );
72 static EString fromSheetName(
const void* p,
unsigned maxsize = 0 );
77 static EString fromByteString(
const void* p,
bool longString,
unsigned maxsize = 0 );
147 FormulaToken(
unsigned id );
148 FormulaToken(
const FormulaToken& );
153 const char* idAsString()
const;
156 unsigned version()
const;
157 void setVersion(
unsigned version );
160 unsigned size()
const;
161 void setData(
unsigned size,
const unsigned char* data );
167 unsigned functionIndex()
const;
168 const char* functionName()
const;
169 unsigned functionParams()
const;
172 UString ref(
unsigned row,
unsigned col )
const;
175 UString area(
unsigned row,
unsigned col )
const;
178 unsigned externSheetRef()
const;
181 unsigned attr()
const;
184 unsigned nameIndex()
const;
187 unsigned refRow()
const;
188 unsigned refColumn()
const;
195typedef std::vector<FormulaToken> FormulaTokens;
197std::ostream& operator<<( std::ostream& s, FormulaToken token );
212 static const unsigned int id;
214 virtual unsigned int rtti(){
233 void setVersion(
unsigned v ){ ver = v; };
235 unsigned version(){
return ver; };
240 virtual void setData(
unsigned size,
const unsigned char* data );
256 virtual const char*
name(){
return "Unknown"; }
261 virtual void dump( std::ostream& out )
const;
266 unsigned stream_position;
303 virtual unsigned row()
const;
311 virtual unsigned column()
const;
318 virtual unsigned xfIndex()
const;
326 virtual void setRow(
unsigned r );
422 static const unsigned int id;
451 virtual void setData(
unsigned size,
const unsigned char* data );
453 virtual const char*
name(){
return "BACKUP"; }
455 virtual void dump( std::ostream& out )
const;
487 static const unsigned int id;
496 enum { UnknownType = 0, Workbook, Worksheet, Chart, VBModule, MacroSheet, Workspace };
508 virtual void setData(
unsigned size,
const unsigned char* data );
526 unsigned type()
const;
533 virtual const char*
name(){
return "BOF"; }
535 virtual void dump( std::ostream& out )
const;
556 static const unsigned int id;
567 virtual void setData(
unsigned size,
const unsigned char* data );
569 virtual const char*
name(){
return "BLANK"; }
571 virtual void dump( std::ostream& out )
const;
592 static const unsigned int id;
594 unsigned int rtti(){
return this->
id; }
611 virtual void setData(
unsigned size,
const unsigned char* data );
613 virtual const char*
name(){
return "BOOLERR"; }
615 virtual void dump( std::ostream& out )
const;
636 static const unsigned int id;
661 virtual void setData(
unsigned size,
const unsigned char* data );
663 virtual const char*
name(){
return "BOTTOMMARGIN"; }
665 virtual void dump( std::ostream& out )
const;
695 static const unsigned int id;
714 enum { Worksheet=0, Chart=2, VBModule=6 };
726 unsigned type()
const;
765 virtual void setData(
unsigned size,
const unsigned char* data );
767 virtual const char*
name(){
return "BOUNDSHEET"; }
769 virtual void dump( std::ostream& out )
const;
790 static const unsigned int id;
820 virtual void setData(
unsigned size,
const unsigned char* data );
822 virtual const char*
name(){
return "CALCMODE"; }
824 virtual void dump( std::ostream& out )
const;
845 static const unsigned int id;
882 unsigned width()
const;
937 virtual void setData(
unsigned size,
const unsigned char* data );
939 virtual const char*
name(){
return "COLINFO"; }
941 virtual void dump( std::ostream& out )
const;
966 static const unsigned int id;
998 virtual void setData(
unsigned size,
const unsigned char* data );
1000 virtual const char*
name(){
return "DATEMODE"; }
1002 virtual void dump( std::ostream& out )
const;
1023 static const unsigned int id;
1025 unsigned int rtti(){
1095 virtual const char*
name(){
return "DIMENSION"; }
1097 virtual void setData(
unsigned size,
const unsigned char* data );
1099 virtual void dump( std::ostream& out )
const;
1110class ExternNameRecord :
public Record
1114 static const unsigned int id;
1116 unsigned int rtti(){
1122 ~ExternNameRecord();
1126 unsigned sheetIndex()
const;
1128 void setSheetIndex(
unsigned sheetIndex );
1130 UString externName()
const;
1132 void setExternName(
const UString& name );
1134 virtual void setData(
unsigned size,
const unsigned char* data );
1138 virtual const char* name(){
return "EXTERNNAME"; }
1140 virtual void dump( std::ostream& out )
const;
1144 ExternNameRecord(
const ExternNameRecord& );
1145 ExternNameRecord& operator=(
const ExternNameRecord& );
1151class ExternSheetRecord :
public Record
1155 static const unsigned int id;
1157 unsigned int rtti(){
1161 ExternSheetRecord();
1163 ~ExternSheetRecord();
1165 unsigned count()
const;
1167 unsigned refIndex(
unsigned i)
const;
1168 unsigned firstSheet(
unsigned i)
const;
1169 unsigned lastSheet(
unsigned i)
const;
1171 UString refName()
const;
1173 virtual void setData(
unsigned size,
const unsigned char* data );
1175 virtual const char* name(){
return "EXTERNSHEET"; }
1177 virtual void dump( std::ostream& out )
const;
1181 ExternSheetRecord(
const ExternNameRecord& );
1182 ExternSheetRecord& operator=(
const ExternNameRecord& );
1202 static const unsigned int id;
1204 unsigned int rtti(){
1218 virtual void setData(
unsigned size,
const unsigned char* data );
1220 virtual const char*
name(){
return "EOF"; }
1222 virtual void dump( std::ostream& out )
const;
1230class FilepassRecord :
public Record
1234 static const unsigned int id;
1236 unsigned int rtti(){
1248 virtual ~FilepassRecord();
1250 virtual void setData(
unsigned size,
const unsigned char* data );
1252 virtual const char* name(){
return "FILEPASS"; }
1254 virtual void dump( std::ostream& out )
const;
1258 FilepassRecord(
const FilepassRecord& );
1259 FilepassRecord& operator=(
const FilepassRecord& );
1280 static const unsigned int id;
1282 unsigned int rtti(){
1315 SingleAccounting = 0x21,
1316 DoubleAccounting = 0x22 };
1318 unsigned height()
const;
1319 void setHeight(
unsigned h );
1336 unsigned fontFamily()
const;
1337 void setFontFamily(
unsigned f );
1340 unsigned characterSet()
const;
1341 void setCharacterSet(
unsigned s );
1435 virtual void setData(
unsigned size,
const unsigned char* data );
1437 virtual const char*
name(){
return "FONT"; }
1439 virtual void dump( std::ostream& out )
const;
1456 static const unsigned int id;
1458 unsigned int rtti(){
1482 virtual void setData(
unsigned size,
const unsigned char* data );
1484 virtual const char*
name(){
return "FOOTER"; }
1486 virtual void dump( std::ostream& out )
const;
1512 static const unsigned int id;
1514 unsigned int rtti(){
1544 unsigned index()
const;
1569 virtual const char*
name(){
return "FORMAT"; }
1571 virtual void setData(
unsigned size,
const unsigned char* data );
1573 virtual void dump( std::ostream& out )
const;
1590 static const unsigned int id;
1591 static const unsigned int idOld;
1593 unsigned int rtti(){
1617 FormulaTokens tokens()
const;
1619 virtual void setData(
unsigned size,
const unsigned char* data );
1621 virtual const char*
name(){
return "FORMULA"; }
1623 virtual void dump( std::ostream& out )
const;
1644 static const unsigned int id;
1646 unsigned int rtti(){
1670 virtual void setData(
unsigned size,
const unsigned char* data );
1672 virtual const char*
name(){
return "HEADER"; }
1674 virtual void dump( std::ostream& out )
const;
1699 static const unsigned int id;
1701 unsigned int rtti(){
1725 virtual void setData(
unsigned size,
const unsigned char* data );
1727 virtual const char*
name(){
return "LABEL"; }
1729 virtual void dump( std::ostream& out )
const;
1753 static const unsigned int id;
1755 unsigned int rtti(){
1775 virtual void setData(
unsigned size,
const unsigned char* data );
1777 virtual const char*
name(){
return "LABELSST"; }
1779 virtual void dump( std::ostream& out )
const;
1798 static const unsigned int id;
1800 unsigned int rtti(){
1824 virtual void setData(
unsigned size,
const unsigned char* data );
1826 virtual const char*
name(){
return "LEFTMARGIN"; }
1828 virtual void dump( std::ostream& out )
const;
1851 static const unsigned int id;
1853 unsigned int rtti(){
1870 unsigned count()
const;
1875 unsigned firstRow(
unsigned i )
const;
1880 unsigned lastRow(
unsigned i )
const;
1892 virtual void setData(
unsigned size,
const unsigned char* data );
1894 virtual const char*
name(){
return "MERGEDCELLS"; }
1896 virtual void dump( std::ostream& out )
const;
1918 static const unsigned int id;
1920 unsigned int rtti(){
1934 virtual void setData(
unsigned size,
const unsigned char* data );
1939 unsigned xfIndex(
unsigned i )
const;
1941 virtual const char*
name(){
return "MULBLANK"; }
1943 virtual void dump( std::ostream& out )
const;
1970 static const unsigned int id;
1972 unsigned int rtti(){
1986 virtual void setData(
unsigned size,
const unsigned char* data );
1991 unsigned xfIndex(
unsigned i )
const;
2014 double asFloat(
unsigned i )
const;
2016 unsigned encodedRK(
unsigned i )
const;
2018 virtual const char*
name(){
return "MULRK"; }
2020 virtual void dump( std::ostream& out )
const;
2037class NameRecord :
public Record
2041 static const unsigned int id;
2043 unsigned int rtti(){
2051 UString definedName()
const;
2053 void setDefinedName(
const UString& name );
2055 virtual void setData(
unsigned size,
const unsigned char* data );
2057 virtual const char* name(){
return "NAME"; }
2059 virtual void dump( std::ostream& out )
const;
2063 NameRecord(
const NameRecord& );
2064 NameRecord& operator=(
const NameRecord& );
2079 static const unsigned int id;
2081 unsigned int rtti(){
2095 virtual void setData(
unsigned size,
const unsigned char* data );
2111 virtual const char*
name(){
return "NUMBER"; }
2113 virtual void dump( std::ostream& out )
const;
2132 static const unsigned int id;
2134 unsigned int rtti(){
2156 unsigned count()
const;
2158 virtual void setData(
unsigned size,
const unsigned char* data );
2160 virtual const char*
name(){
return "PALETTE"; }
2162 virtual void dump( std::ostream& out )
const;
2183 static const unsigned int id;
2185 unsigned int rtti(){
2209 virtual void setData(
unsigned size,
const unsigned char* data );
2211 virtual const char*
name(){
return "RIGHTMARGIN"; }
2213 virtual void dump( std::ostream& out )
const;
2235 static const unsigned int id;
2237 unsigned int rtti(){
2251 virtual void setData(
unsigned size,
const unsigned char* data );
2297 unsigned encodedRK()
const;
2299 virtual const char*
name(){
return "RK"; }
2301 virtual void dump( std::ostream& out )
const;
2320 static const unsigned int id;
2322 unsigned int rtti(){
2341 unsigned row()
const;
2348 void setRow(
unsigned r );
2392 virtual void setData(
unsigned size,
const unsigned char* data );
2394 virtual const char*
name(){
return "ROW"; }
2396 virtual void dump( std::ostream& out )
const;
2422 static const unsigned int id;
2424 unsigned int rtti(){
2452 virtual void setData(
unsigned size,
const unsigned char* data );
2454 virtual const char*
name(){
return "RSTRING"; }
2456 virtual void dump( std::ostream& out )
const;
2479 static const unsigned int id;
2481 unsigned int rtti(){
2495 virtual void setData(
unsigned size,
const unsigned char* data );
2500 unsigned count()
const;
2509 virtual const char*
name(){
return "SST"; }
2511 virtual void dump( std::ostream& out )
const;
2535 static const unsigned int id;
2537 unsigned int rtti(){
return this->id; }
2549 virtual void setData(
unsigned size,
const unsigned char* data );
2561 virtual const char*
name(){
return "STRING"; }
2563 virtual void dump( std::ostream& out )
const;
2582 static const unsigned int id;
2593 unsigned int rtti(){
2617 virtual void setData(
unsigned size,
const unsigned char* data );
2619 virtual const char*
name(){
return "SUPBOOK"; }
2621 virtual void dump( std::ostream& out )
const;
2640 static const unsigned int id;
2642 unsigned int rtti(){
2666 virtual void setData(
unsigned size,
const unsigned char* data );
2668 virtual const char*
name(){
return "TOPMARGIN"; }
2670 virtual void dump( std::ostream& out )
const;
2691 static const unsigned int id;
2693 unsigned int rtti(){
2937 MediumDashDotted = 10,
2938 ThinDashDotDotted = 11,
2939 MediumDashDotDotted = 12,
2940 SlantedMediumDashDotted = 13
3167 virtual const char*
name(){
return "XF"; }
3169 virtual void setData(
unsigned size,
const unsigned char* data );
3171 virtual void dump( std::ostream& out )
const;
3178typedef std::vector<UString> UStringStack;
3185 virtual ~ExcelReader();
3186 bool load( Workbook* workbook,
const char* filename );
3189 virtual void handleRecord( Record* record );
3192 void handleBoundSheet( BoundSheetRecord* record );
3193 void handleBOF( BOFRecord* record );
3194 void handleBoolErr( BoolErrRecord* record );
3195 void handleBottomMargin( BottomMarginRecord* record );
3196 void handleBlank( BlankRecord* record );
3197 void handleCalcMode( CalcModeRecord* record );
3198 void handleColInfo( ColInfoRecord* record );
3199 void handleDateMode( DateModeRecord* record );
3200 void handleDimension( DimensionRecord* record );
3201 void handleExternName( ExternNameRecord* record );
3202 void handleExternSheet( ExternSheetRecord* record );
3203 void handleFilepass( FilepassRecord* record );
3204 void handleFormat( FormatRecord* record );
3205 void handleFormula( FormulaRecord* record );
3206 void handleFont( FontRecord* record );
3207 void handleFooter( FooterRecord* record );
3208 void handleHeader( HeaderRecord* record );
3209 void handleLabel( LabelRecord* record );
3210 void handleLabelSST( LabelSSTRecord* record );
3211 void handleLeftMargin( LeftMarginRecord* record );
3212 void handleMergedCells( MergedCellsRecord* record );
3213 void handleMulBlank( MulBlankRecord* record );
3214 void handleMulRK( MulRKRecord* record );
3215 void handleName( NameRecord* record );
3216 void handleNumber( NumberRecord* record );
3217 void handlePalette( PaletteRecord* record );
3218 void handleRightMargin( RightMarginRecord* record );
3219 void handleRString( RStringRecord* record );
3220 void handleRK( RKRecord* record );
3221 void handleRow( RowRecord* record );
3222 void handleSST( SSTRecord* record );
3223 void handleString( StringRecord* record );
3224 void handleSupbook( SupbookRecord* record );
3225 void handleTopMargin( TopMarginRecord* record );
3226 void handleXF( XFRecord* record );
3228 Color convertColor(
unsigned colorIndex );
3229 FormatFont convertFont(
unsigned fontIndex );
3230 Format convertFormat(
unsigned xfIndex );
3231 UString decodeFormula(
unsigned row,
unsigned col,
3232 const FormulaTokens& tokens,
bool openDocumentFormat=
false );
3234 void mergeTokens( UStringStack* stack,
int count,
char mergeChar );
3235 void mergeTokens( UStringStack* stack,
int count,
const char* mergeString );
3238 ExcelReader(
const ExcelReader& );
3239 ExcelReader& operator=(
const ExcelReader& );
Beginning of file/set of records.
static const unsigned int id
Static ID of the BOF record.
const char * typeAsString() const
Returns BOF type as string, something like "Worksheet".
virtual const char * name()
Returns the name of the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual ~BOFRecord()
Destroys the record.
unsigned type() const
Returns type of the BOF record, like Workbook, Chart, and so on.
BOFRecord()
Creates a new BOF record.
const char * versionAsString() const
Returns the version as string, something like "Excel97".
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
unsigned version() const
Returns the version, like Excel95, Excel97, and so on.
BackupRecord()
Creates a new Backup record.
~BackupRecord()
Destroy the record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
bool backup() const
Returns true if a backup is made when saving the file.
void setBackup(bool r)
If r is true, a backup will be made when saving the file.
virtual const char * name()
Returns the name of the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual const char * name()
Returns the name of the record.
BlankRecord()
Creates a new Blank record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
Boolean value or error code.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
BoolErrRecord()
Creates a new BoolErr record.
virtual const char * name()
Returns the name of the record.
static const unsigned int id
Static ID of the BoolErr record.
Value value() const
Returns value of the cell, could be either boolean or error.
virtual ~BoolErrRecord()
Destroys the BoolErr record.
~BottomMarginRecord()
Destroy the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
double bottomMargin() const
Gets the bottom margin (in inches).
virtual const char * name()
Returns the name of the record.
void setBottomMargin(double m)
Sets the new bottom margin (in inches).
BottomMarginRecord()
Creates a new BottomMargin record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
unsigned type() const
Returns the type of the BoundSheet.
void setBofPosition(unsigned pos)
Sets the position of the BOF record associated with this BoundSheet.
void setSheetName(const UString &name)
Sets the name of the sheet.
bool visible() const
Returns true if the sheet is visible.
virtual const char * name()
Returns the name of the record.
virtual ~BoundSheetRecord()
Destroys the BoundSheet record.
UString sheetName() const
Returns the name of the sheet.
BoundSheetRecord()
Creates a new BoundSheet record.
const char * typeAsString() const
Returns the type of the BoundSheet as string.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
void setVisible(bool visible)
Sets the visibility of the sheet.
void setType(unsigned type)
Sets the type of the BoundSheet.
unsigned bofPosition() const
Returns the position of the BOF record associated with this BoundSheet.
Automatic recalculation mode.
~CalcModeRecord()
Destroy the record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
virtual const char * name()
Returns the name of the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
void setAutoCalc(bool r)
If r is true, formulas calculation will be performed automatically.
bool autoCalc() const
Returns true if formulas calculation is performed automatically.
CalcModeRecord()
Creates a new CalcMode record.
Class CellInfo represents a base class for records which provide information about cells.
virtual void setXfIndex(unsigned i)
Sets the XF index for formatting of the cell.
virtual void setColumn(unsigned c)
Sets the column associated with the cell information.
virtual unsigned xfIndex() const
Returns the XF index for formatting of the cell.
virtual void setRow(unsigned r)
Sets the row associated with the cell information.
virtual unsigned row() const
Returns the row associated with the cell information.
virtual unsigned column() const
Returns the column associated with the cell information.
CellInfo()
Creates a new cell information.
virtual ~CellInfo()
Destroys the cell information.
Columns width and format.
unsigned outlineLevel() const
Returns the outline level of the columns.
unsigned xfIndex() const
Returns the XF index for the formatting of the column(s).
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual ~ColInfoRecord()
Destroys the record.
void setOutlineLevel(unsigned l)
Sets the outline level of the columns.
ColInfoRecord()
Creates a new ColInfo record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
void setXfIndex(unsigned i)
Sets the XF index for the formatting of the column(s).
void setHidden(bool h)
Sets whether columns should be hidden or visible.
bool collapsed() const
Returns true if the columns should be collapsed.
bool hidden() const
Returns true if the columns should be hidden, i.e not visible.
void setWidth(unsigned w)
Sets the width of the column(s), specified in 1/256 of a character width.
unsigned width() const
Returns the width of the column(s), specified in 1/256 of a character width.
void setCollapsed(bool c)
Sets whether columns should be collapsed or not.
virtual const char * name()
Returns the name of the record.
Provides color based on RGB values.
Class CellInfo represents a base class for records which provide information about a span of columns.
virtual unsigned lastColumn() const
Returns the last column associated with the span information.
virtual void setLastColumn(unsigned c)
Sets the last column associated with the span information.
virtual unsigned firstColumn() const
Returns the first column associated with the span information.
virtual ~ColumnSpanInfo()
Destroys the column span information.
ColumnSpanInfo()
Creates a new column span information.
virtual void setFirstColumn(unsigned c)
Sets the first column associated with the span information.
~DateModeRecord()
Destroy the record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
virtual const char * name()
Returns the name of the record.
DateModeRecord()
Creates a new DateMode record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
bool base1904() const
Returns true if the reference date is 1st of January, 1904 or false if the reference date is 31st of ...
void setBase1904(bool r)
If r is true, sets the reference date to 1st of January, 1904.
void setFirstColumn(unsigned r)
Sets index to the first used column.
void setFirstRow(unsigned r)
Sets index to the first used row.
DimensionRecord()
Creates a new Dimension record.
unsigned firstColumn() const
Returns index to the first used column.
unsigned lastColumn() const
Returns index to the last used column.
void setLastColumn(unsigned r)
Sets index to the last used column.
unsigned lastRow() const
Returns index to the last used row.
unsigned firstRow() const
Returns index to the first used row.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual const char * name()
Returns the name of the record.
void setLastRow(unsigned r)
Sets index to the last used row.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
~DimensionRecord()
Destroys the record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual ~EOFRecord()
Destroy the record.
EOFRecord()
Creates a new EOF record.
virtual const char * name()
Returns the name of the record.
bool italic() const
Returns true if italic has been set.
void setColorIndex(unsigned c)
Sets the index of the color of the font.
void setEscapement(unsigned s)
Sets the superscript or subscript.
FontRecord & operator=(const FontRecord &fr)
Assigns from another Font record.
virtual ~FontRecord()
Destroy the record.
void setItalic(bool i)
If i is true, italic is set on; otherwise italic is set off.
UString fontName() const
Returns the name of font, e.g "Arial".
bool strikeout() const
Returns true if strikeout has been set.
void setFontName(const UString &fn)
Sets the name of the font.
void setBoldness(unsigned b)
Sets the boldness of the font.
void setStrikeout(bool s)
If s is true, strikeout is set on; otherwise strikeout is set off.
void setUnderline(unsigned u)
Sets the underline style of the font.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
FontRecord()
Creates a new Font record.
virtual const char * name()
Returns the name of the record.
unsigned underline() const
Returns the underline style of the font.
unsigned escapement() const
Returns Font::Superscript if superscript is set, or Font::Subscript if subscript is set,...
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
unsigned colorIndex() const
Returns index of the color of the font.
unsigned boldness() const
Returns the boldness of the font.
Class LabelRecord represents a cell that contains a string.
void setLabel(const UString &l)
Sets the label string.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
LabelRecord()
Creates a new Label record.
virtual const char * name()
Returns the name of the record.
UString label() const
Returns the label string.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
virtual ~LabelRecord()
Destroys the record.
Class LabelSSTRecord represents a cell that contains a string.
virtual const char * name()
Returns the name of the record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
unsigned sstIndex() const
Returns the SST index.
virtual ~LabelSSTRecord()
Destroys the record.
LabelSSTRecord()
Creates a new LabelSST record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
Class LeftMarginRecord holds information about left margin.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
~LeftMarginRecord()
Destroy the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
double leftMargin() const
Gets the left margin (in inches).
void setLeftMargin(double m)
Sets the new left margin (in inches).
virtual const char * name()
Returns the name of the record.
LeftMarginRecord()
Creates a new LeftMargin record.
Class MergedCellsRecord represents MergedCells record, which contains a list of all merged cells in t...
unsigned firstColumn(unsigned i) const
Returns the index to first column in the i-th position in the list.
virtual ~MergedCellsRecord()
Destroys the record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
unsigned count() const
Returns the total number of merged cells in the list.
unsigned firstRow(unsigned i) const
Returns the index to first row in the i-th position in the list.
unsigned lastColumn(unsigned i) const
Returns the index to last column in the i-th position in the list.
virtual const char * name()
Returns the name of the record.
unsigned lastRow(unsigned i) const
Returns the index to last row in the i-th position in the list.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
MergedCellsRecord()
Creates a new MergedCells record.
Class MulBlankRecord represents a cell range containing blank cells.
unsigned xfIndex(unsigned i) const
Returns XF index of ith column.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
virtual const char * name()
Returns the name of the record.
MulBlankRecord()
Creates a new MulBlank record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual ~MulBlankRecord()
Destroys the record.
Class MulRKRecord represents a cell range containing RK value cells.
MulRKRecord()
Creates a new MulRK record.
virtual ~MulRKRecord()
Destroys the record.
double asFloat(unsigned i) const
Returns the floating-point value specified by the record.
bool isInteger(unsigned i) const
Returns true if the record holds an integer value.
int asInteger(unsigned i) const
Returns the integer value specified by the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual const char * name()
Returns the name of the record.
unsigned xfIndex(unsigned i) const
Returns XF index of ith column.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
Class NumberRecord represents a cell that contains a floating point value.
virtual const char * name()
Returns the name of the record.
double number() const
Returns the floating-point value specified by the record.
void setNumber(double f)
Sets the floating-point value specified by the record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
NumberRecord()
Creates a new Number record.
virtual ~NumberRecord()
Destroys the record.
Class PaletteRecord lists colors.
virtual const char * name()
Returns the name of the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
unsigned count() const
Returns the number of colors in the palette.
PaletteRecord()
Creates a new Palette record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
~PaletteRecord()
Destroy the record.
Color color(unsigned i) const
Gets the n-th color.
Class RKRecord represents a cell that contains an RK value, i.e encoded integer or floating-point val...
bool isInteger() const
Returns true if the record holds an integer value.
bool isFloat() const
Returns true if the record holds a floating-point value.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
RKRecord()
Creates a new RK record.
virtual ~RKRecord()
Destroys the record.
void setFloat(double f)
Sets the floating-point value to be specified by the record.
void setInteger(int i)
Sets the integer value to be specified by the record.
virtual const char * name()
Returns the name of the record.
int asInteger() const
Returns the integer value specified by the record.
double asFloat() const
Returns the floating-point value specified by the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
Class RStringRecord represents a cell that contains rich-text string.
UString label() const
Returns the label string.
void setLabel(const UString &l)
Sets the label string.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual const char * name()
Returns the name of the record.
RStringRecord()
Creates a new Label record.
virtual ~RStringRecord()
Destroys the record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
Class Record represents a base class for all other type record, hence do not use this class in real l...
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual const char * name()
Returns the name of the record.
static const unsigned int id
Static ID of the record.
unsigned position() const
Gets the position of this record in the OLE stream.
static Record * create(unsigned type)
Record factory, create a new record of specified type.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
void setPosition(unsigned pos)
Sets the position of the record in the OLE stream.
virtual ~Record()
Destroys the record.
Record()
Creates a new generic record.
Class RightMarginRecord holds information about right margin.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
double rightMargin() const
Gets the right margin (in inches).
virtual const char * name()
Returns the name of the record.
void setRightMargin(double m)
Sets the new right margin (in inches).
RightMarginRecord()
Creates a new RightMargin record.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
~RightMarginRecord()
Destroy the record.
Class RowRecord represents Row record, which provides information (such as row height and formatting)...
unsigned row() const
Returns the index of the row.
virtual ~RowRecord()
Destroys the record.
void setRow(unsigned r)
Sets the index of the row.
unsigned height() const
Returns the height of the row, specified in twips (1/20 pt).
void setXfIndex(unsigned i)
Sets the XF index for the formatting of the cells.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
bool hidden() const
Returns true if the row should be hidden, i.e not visible.
void setHeight(unsigned h)
Sets the height of the row, specified in twips (1/20 pt).
RowRecord()
Creates a new Row record.
void setHidden(bool h)
Sets whether row should be hidden or visible.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
unsigned xfIndex() const
Returns the XF index for the formatting of the cells.
virtual const char * name()
Returns the name of the record.
Class SSTRecord represents SST record, which holds the shared string table of the workbook.
SSTRecord()
Creates a new SST record.
virtual ~SSTRecord()
Destroys the record.
virtual const char * name()
Returns the name of the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
unsigned count() const
Returns the number of available string in this string table.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
UString stringAt(unsigned index) const
Returns the string at specified index.
Class String represents a string record, which holds the value of calculation if a formula returns a ...
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
UString ustring() const
Returns the string (in Unicode).
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
StringRecord()
Creates a new string record.
virtual ~StringRecord()
Destroys the record.
virtual const char * name()
Returns the name of the record.
Value value() const
Returns the string as a value.
Class SupbookRecord stores references to external workbook.
ReferenceType referenceType() const
Returns the type of the reference.
SupbookRecord()
Creates a new Supbook record.
void setReferenceType(ReferenceType type)
Sets the type of the reference.
~SupbookRecord()
Destroy the record.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
virtual const char * name()
Returns the name of the record.
Class TopMarginRecord holds information about top margin.
void setTopMargin(double m)
Sets the new top margin (in inches).
double topMargin() const
Gets the top margin (in inches).
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
TopMarginRecord()
Creates a new TopMargin record.
virtual const char * name()
Returns the name of the record.
~TopMarginRecord()
Destroy the record.
Provides a wrapper for cell value.
Class XFRecord holds information of XF (eXtended Format) which specifies many kind of properties of a...
unsigned indentLevel() const
Returns indent level.
void setPatternForeColor(unsigned color)
Sets the fill foreground color.
bool formulaHidden() const
Returns true if the formula of the cells using this format should be hidden from user.
void setRotationAngle(unsigned angle)
Sets the rotation angle of the text.
virtual void dump(std::ostream &out) const
Dumps record information to output stream.
unsigned topBorderColor() const
Returns the color for top border.
unsigned horizontalAlignment() const
Gets the horizontal alignment, e.g Left.
unsigned leftBorderStyle() const
Returns the line style for left border.
void setTopBorderColor(unsigned color)
Sets the color for top border.
XFRecord & operator=(const XFRecord &xf)
Assigns from another XF record.
void setLeftBorderColor(unsigned color)
Sets the color for left border.
const char * horizontalAlignmentAsString() const
Returns human-readable string representation of the horizontal alignment.
void setFormatIndex(unsigned fi)
Sets the index of the number format for use in this XFormat.
void setPatternBackColor(unsigned color)
Sets the fill background color.
unsigned parentStyle() const
Returns the index of the parent stlye of this format.
unsigned fontIndex() const
Gets the index of the font for use in this XFormat.
unsigned rightBorderStyle() const
Returns the line style for right border.
void setShrinkContent(bool s)
Sets whether content should be shrunk to fit into cell.
bool textWrap() const
Returns true if text is wrapped at right border.
void setLocked(bool l)
Sets whether the cells using this format should be locked or not.
void setTextWrap(bool wrap)
Sets whether text should be wrapped at right border.
void setFormulaHidden(bool f)
Sets whether the formula of the cells using this format should be hidden or should be visible.
unsigned patternBackColor() const
Returns the fill background color.
void setVerticalAlignment(unsigned va)
Sets the vertical alignment, e.g Top.
unsigned rightBorderColor() const
Returns the color for right border.
void setStackedLetters(bool stacked)
Sets whether the letters for text should be stacked top-to-bottom.
void setDiagonalTopLeft(bool d)
Sets whether there should be a diagonal line from top left to right bottom.
unsigned patternForeColor() const
Returns the fill foreground color.
unsigned verticalAlignment() const
Gets the vertical alignment, e.g Bottom.
bool stackedLetters() const
Returns true if the letters for text are not rotated, but instead stacked top-to-bottom.
~XFRecord()
Destroy the record.
virtual const char * name()
Returns the name of the record.
void setParentStyle(unsigned ps)
Sets the index of the parent stlye of this format.
unsigned bottomBorderStyle() const
Returns the line style for bottom border.
bool diagonalBottomLeft() const
Returns true if there is a diagonal line from bottom left to right top.
void setRightBorderStyle(unsigned style)
Sets the line style for right border.
unsigned diagonalColor() const
Returns the color for diagonal line.
unsigned diagonalStyle() const
Returns the diagonal line style.
const char * verticalAlignmentAsString() const
Returns human-readable string representation of the vertical alignment.
void setLeftBorderStyle(unsigned style)
Sets the line style for left border.
void setBottomBorderStyle(unsigned style)
Sets the line style for bottom border.
unsigned bottomBorderColor() const
Returns the color for bottom border.
void setDiagonalColor(unsigned color)
Sets the color for diagonal line.
unsigned fillPattern() const
Returns fill pattern.
void setFontIndex(unsigned fi)
Sets the index of the font for use in this XFormat.
void setIndentLevel(unsigned i)
Sets indent level.
unsigned leftBorderColor() const
Returns the color for left border.
unsigned formatIndex() const
Gets the index of the number format for use in this XFormat.
void setDiagonalStyle(unsigned style)
Sets the line style for diagonal line.
void setRightBorderColor(unsigned color)
Sets the color for right border.
unsigned topBorderStyle() const
Returns the line style for top border.
XFRecord()
Creates a new XF record.
unsigned rotationAngle() const
Returns the rotation angle of the text.
virtual void setData(unsigned size, const unsigned char *data)
Sets the data for this record.
bool shrinkContent() const
Returns true if content should be shrunk to fit into cell.
void setFillPattern(unsigned pattern)
Sets fill pattern.
void setBottomBorderColor(unsigned color)
Sets the color for bottom border.
void setHorizontalAlignment(unsigned ha)
Sets the horizontal alignment, e.g Left.
void setTopBorderStyle(unsigned style)
Sets the line style for top border.
void setDiagonalBottomLeft(bool d)
Sets whether there should be a diagonal line from bottom left to right top.
bool locked() const
Returns true if the cells using this format should be locked.
bool diagonalTopLeft() const
Returns true if there is a diagonal line from top left to right bottom.