RagTimeSpreadsheet.hxx Source File documentation

RagTimeSpreadsheet.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33
34 /*
35 * Parser to spreadsheet's part of a RagTime document
36 *
37 */
38 #ifndef RAGTIME_SPREADSHEET
39 # define RAGTIME_SPREADSHEET
40
41 #include <list>
42 #include <string>
43 #include <vector>
44
45 #include "libmwaw_internal.hxx"
46
47 #include "MWAWCell.hxx"
48 #include "MWAWDebug.hxx"
49 #include "MWAWEntry.hxx"
50 #include "MWAWInputStream.hxx"
51
52 #include "MWAWParser.hxx"
53
54 namespace RagTimeSpreadsheetInternal
55 {
56 struct ComplexBlock;
57
58 struct Cell;
59 struct Spreadsheet;
60
61 struct State;
62 }
63
64 class RagTimeParser;
65
71 class RagTimeSpreadsheet
72 {
73 friend class RagTimeParser;
74 public:
76 explicit RagTimeSpreadsheet(RagTimeParser &parser);
78 virtual ~RagTimeSpreadsheet();
79
81 int version() const;
82
83 protected:
84 // generic resource ( used mainly by spreadsheet )
85
87 bool getDateTimeFormat(int dtId, std::string &dtFormat) const;
89 bool readNumericFormat(MWAWEntry &entry);
90
91 // specific spreadsheet resource
92
94 bool readResource(MWAWEntry &entry);
96 bool readRsrcSpDo(MWAWEntry &entry);
98 bool readRsrcSpDI(MWAWEntry &entry);
99
100 //
101
103 bool readSpreadsheet(MWAWEntry &entry);
105 bool readSpreadsheetZone9(MWAWEntry const &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet);
107 bool readSpreadsheetSimpleStructure(MWAWEntry const &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet);
109 bool readSpreadsheetComplexStructure(MWAWEntry const &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet);
110
112 bool readSpreadsheetCellContent(RagTimeSpreadsheetInternal::Cell &cell, long endPos);
114 bool readSpreadsheetCellDimension(MWAWVec2i const &cellPos, long endPos, RagTimeSpreadsheetInternal::Spreadsheet &sheet);
116 bool readSpreadsheetCellFormat(MWAWVec2i const &cellPos, long endPos, RagTimeSpreadsheetInternal::Cell &cell);
117
119 bool readPositionsList(MWAWEntry const &entry, std::vector<long> &posList, long &lastDataPos);
121 bool readBlockHeader(MWAWEntry const &entry, RagTimeSpreadsheetInternal::ComplexBlock &block);
122
124 bool readSpreadsheetV2(MWAWEntry &entry);
126 bool readSpreadsheetCellsV2(MWAWEntry &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet);
128 bool readSpreadsheetExtraV2(MWAWEntry &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet);
129
131 bool send(int zId, MWAWPosition const &pos);
133 void flushExtra();
134
135 //
136 // low level
137 //
138
140 bool readSpreadsheetCellV2(RagTimeSpreadsheetInternal::Cell &cell, long endPos);
142 bool readFormulaV2(MWAWVec2i const &cellPos, std::vector<MWAWCellContent::FormulaInstruction> &formula, long endPos, std::string &extra);
144 bool readFormula(MWAWVec2i const &cellPos, std::vector<MWAWCellContent::FormulaInstruction> &formula, long endPos, std::string &extra);
146 bool readCellInFormulaV2(MWAWVec2i const &pos, bool canBeList, MWAWCellContent::FormulaInstruction &instr, long endPos, std::string &extra);
148 bool readCellInFormula(MWAWVec2i const &pos, bool canBeList, MWAWCellContent::FormulaInstruction &instr, long endPos, std::string &extra);
150 bool send(RagTimeSpreadsheetInternal::Spreadsheet &sheet, MWAWSpreadsheetListenerPtr listener);
151
152 private:
153 RagTimeSpreadsheet(RagTimeSpreadsheet const &orig) = delete;
154 RagTimeSpreadsheet &operator=(RagTimeSpreadsheet const &orig) = delete;
155
156 protected:
157 //
158 // data
159 //
161 MWAWParserStatePtr m_parserState;
162
164 std::shared_ptr<RagTimeSpreadsheetInternal::State> m_state;
165
167 RagTimeParser *m_mainParser;
168 };
169 #endif
170 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWCellContent::FormulaInstruction::F_CellList
@ F_CellList
Definition: MWAWCell.hxx:398
RagTimeSpreadsheet::readCellInFormula
bool readCellInFormula(MWAWVec2i const &pos, bool canBeList, MWAWCellContent::FormulaInstruction &instr, long endPos, std::string &extra)
try to read a cell in a formula
Definition: RagTimeSpreadsheet.cxx:2619
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
RagTimeStruct::ResourceList::Type
Type
the different resource type which can be stored as list
Definition: RagTimeStruct.hxx:59
RagTimeSpreadsheetInternal::State::m_idSpreadsheetMap
std::map< int, std::shared_ptr< Spreadsheet > > m_idSpreadsheetMap
map id -> spreadsheet
Definition: RagTimeSpreadsheet.cxx:424
RagTimeSpreadsheet::readSpreadsheetCellV2
bool readSpreadsheetCellV2(RagTimeSpreadsheetInternal::Cell &cell, long endPos)
try to read a cell :v2
Definition: RagTimeSpreadsheet.cxx:2047
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
RagTimeSpreadsheet::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: RagTimeSpreadsheet.hxx:161
MWAWFont::set
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:314
RagTimeSpreadsheetInternal::Cell::operator=
Cell & operator=(Cell const &)=default
RagTimeSpreadsheetInternal::Spreadsheet::Map
std::map< MWAWVec2i, Cell, MWAWVec2i::PosSizeLtY > Map
a map a cell sorted by row
Definition: RagTimeSpreadsheet.cxx:300
RagTimeSpreadsheetInternal::CellBorder::hasBorders
bool hasBorders() const
returns true if the cell has some border
Definition: RagTimeSpreadsheet.cxx:135
MWAWCellContent::m_textEntry
MWAWEntry m_textEntry
the cell string
Definition: MWAWCell.hxx:489
RagTimeStruct::ResourceList::read
bool read(MWAWInputStreamPtr input, MWAWEntry &entry)
try to read the header block
Definition: RagTimeStruct.cxx:42
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
RagTimeSpreadsheetInternal::ComplexBlock::m_intList
std::vector< int > m_intList
a list of unknown counter
Definition: RagTimeSpreadsheet.cxx:219
libmwaw::DebugFile::addDelimiter
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
MWAWCellContent::setValue
void setValue(double value)
sets the double value
Definition: MWAWCell.hxx:458
RagTimeStruct.hxx
MWAWCell::F_DATE
@ F_DATE
Definition: MWAWCell.hxx:56
MWAWBorder::isEmpty
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:356
RagTimeParser.hxx
RagTimeSpreadsheetInternal::Cell::m_textEntry
MWAWEntry m_textEntry
the text entry if the cell is a zone of text zone
Definition: RagTimeSpreadsheet.cxx:261
RagTimeSpreadsheet::readSpreadsheetZone9
bool readSpreadsheetZone9(MWAWEntry const &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet)
try to read a the last spreadsheet zone
Definition: RagTimeSpreadsheet.cxx:1642
RagTimeSpreadsheetInternal::Cell::m_rotation
int m_rotation
the content's rotation angle
Definition: RagTimeSpreadsheet.cxx:263
RagTimeSpreadsheetInternal::CellFormat::m_flags
int m_flags
some flags
Definition: RagTimeSpreadsheet.cxx:122
RagTimeSpreadsheet::readBlockHeader
bool readBlockHeader(MWAWEntry const &entry, RagTimeSpreadsheetInternal::ComplexBlock &block)
try to read a complex bock header
Definition: RagTimeSpreadsheet.cxx:1094
MWAWCell::setPosition
void setPosition(MWAWVec2i posi)
set the cell positions : 0,0 -> A1, 0,1 -> A2
Definition: MWAWCell.hxx:189
MWAWCell::F_NUMBER_DECIMAL
@ F_NUMBER_DECIMAL
Definition: MWAWCell.hxx:58
RagTimeSpreadsheet::readNumericFormat
bool readNumericFormat(MWAWEntry &entry)
try to read the numeric/date format table zone: FoTa
Definition: RagTimeSpreadsheet.cxx:462
MWAWCell::setHAlignment
void setHAlignment(HorizontalAlignment align)
sets the horizontal alignment
Definition: MWAWCell.hxx:281
RagTimeSpreadsheetInternal::Cell::~Cell
~Cell() final
destructor
Definition: RagTimeSpreadsheet.cxx:266
RagTimeSpreadsheetInternal::State
Internal: the state of a RagTimeSpreadsheet.
Definition: RagTimeSpreadsheet.cxx:392
RagTimeStruct::ResourceList::getName
static std::string getName(Type type)
returns a string corresponding to a type
Definition: RagTimeStruct.hxx:75
MWAWCellContent::FormulaInstruction::F_Operator
@ F_Operator
Definition: MWAWCell.hxx:398
RagTimeSpreadsheetInternal::Spreadsheet::getRightBottomPosition
MWAWVec2i getRightBottomPosition() const
returns the spreadsheet dimension
Definition: RagTimeSpreadsheet.cxx:354
MWAWFont::Script::sub100
static Script sub100()
return a yposition which correspond to a basic subscript100
Definition: MWAWFont.hxx:125
RagTimeParser::getNewZoneId
int getNewZoneId()
returns a new unique zone id
Definition: RagTimeParser.cxx:452
MWAWFont::boldBit
@ boldBit
Definition: MWAWFont.hxx:190
MWAWCell::F_NUMBER_PERCENT
@ F_NUMBER_PERCENT
Definition: MWAWCell.hxx:58
MWAWCellContent::isValueSet
bool isValueSet() const
returns true if the value has been setted
Definition: MWAWCell.hxx:464
RagTimeSpreadsheetInternal::CellBorder::m_extra
std::string m_extra
extra data
Definition: RagTimeSpreadsheet.cxx:154
RagTimeParser::getCharStyle
bool getCharStyle(int charId, MWAWFont &font) const
returns font style corresponding to a char style id
Definition: RagTimeParser.cxx:422
RagTimeSpreadsheetInternal::CellFormat::m_numeric
MWAWCell::Format m_numeric
the numeric format
Definition: RagTimeSpreadsheet.cxx:114
RagTimeSpreadsheetInternal::Spreadsheet::m_columns
int m_columns
the number of col
Definition: RagTimeSpreadsheet.cxx:369
RagTimeSpreadsheetInternal::Spreadsheet::getRowHeight
float getRowHeight(int row) const
returns the row size in point
Definition: RagTimeSpreadsheet.cxx:317
libmwaw::BottomBit
@ BottomBit
Definition: libmwaw_internal.hxx:178
RagTimeSpreadsheetInternal::CellExtra::m_color
MWAWColor m_color
the background color
Definition: RagTimeSpreadsheet.cxx:179
MWAWCell::F_UNKNOWN
@ F_UNKNOWN
Definition: MWAWCell.hxx:56
RagTimeSpreadsheetInternal::Spreadsheet::m_heightDefault
float m_heightDefault
the default row height
Definition: RagTimeSpreadsheet.cxx:375
MWAWCellContent::date2Double
static bool date2Double(int Y, int M, int D, double &val)
conversion beetween date and double days since 1900 date
Definition: MWAWCell.cxx:560
MWAWCellContent::FormulaInstruction
small class use to define a formula instruction
Definition: MWAWCell.hxx:397
MWAWEntry::id
int id() const
returns the id
Definition: MWAWEntry.hxx:164
RagTimeStruct::ResourceList::res_
@ res_
Definition: RagTimeStruct.hxx:59
MWAWEntry.hxx
MWAWFontConverter.hxx
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:192
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
RagTimeSpreadsheetInternal::DateTime
Internal: date/time format of a RagTimeSpreadsheet.
Definition: RagTimeSpreadsheet.cxx:63
RagTimeStruct::ResourceList::BuSl
@ BuSl
Definition: RagTimeStruct.hxx:59
RagTimeSpreadsheetInternal::Cell::m_content
MWAWCellContent m_content
the cell content
Definition: RagTimeSpreadsheet.cxx:259
RagTimeSpreadsheetInternal::State::m_version
int m_version
the file version
Definition: RagTimeSpreadsheet.cxx:408
MWAWCell::F_NUMBER_SCIENTIFIC
@ F_NUMBER_SCIENTIFIC
Definition: MWAWCell.hxx:58
RagTimeSpreadsheet::readRsrcSpDI
bool readRsrcSpDI(MWAWEntry &entry)
try to read the SpDI zone (a spreadsheet zone zone with id=0)
Definition: RagTimeSpreadsheet.cxx:977
RagTimeSpreadsheetInternal::CellFormat::m_dateTime
DateTime m_dateTime
the date/time format
Definition: RagTimeSpreadsheet.cxx:116
RagTimeSpreadsheet::send
bool send(int zId, MWAWPosition const &pos)
send a spreadsheet corresponding to zId
Definition: RagTimeSpreadsheet.cxx:2568
MWAWCellContent::FormulaInstruction::F_Function
@ F_Function
Definition: MWAWCell.hxx:398
MWAWCell::setFormat
void setFormat(Format const &format)
set the cell format
Definition: MWAWCell.hxx:242
MWAWFont::Line::Simple
@ Simple
Definition: MWAWFont.hxx:49
MWAW_FALLTHROUGH
#define MWAW_FALLTHROUGH
Definition: libmwaw_internal.hxx:118
MWAWBorder::m_width
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:387
RagTimeSpreadsheetInternal::Spreadsheet::Spreadsheet
Spreadsheet()
constructor
Definition: RagTimeSpreadsheet.cxx:302
MWAWCell::F_NUMBER_GENERIC
@ F_NUMBER_GENERIC
Definition: MWAWCell.hxx:58
MWAWCell::setBackgroundColor
void setBackgroundColor(MWAWColor color)
sets the background color
Definition: MWAWCell.hxx:332
RagTimeStruct::ResourceList::SpTe
@ SpTe
Definition: RagTimeStruct.hxx:59
MWAWEntry::setParsed
void setParsed(bool ok=true) const
sets the flag m_parsed to true or false
Definition: MWAWEntry.hxx:126
RagTimeSpreadsheetInternal::Spreadsheet
Internal: a spreadsheet's zone of a RagTimeSpreadsheet.
Definition: RagTimeSpreadsheet.cxx:298
RagTimeSpreadsheetInternal::Spreadsheet::m_widthDefault
float m_widthDefault
the default column width
Definition: RagTimeSpreadsheet.cxx:371
libmwaw::DebugFile::addNote
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
MWAWFont::setDeltaLetterSpacing
void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
sets the letter spacing ( delta value in point )
Definition: MWAWFont.hxx:292
RagTimeSpreadsheetInternal::State::m_cellFormatList
std::vector< CellFormat > m_cellFormatList
a list SpVaId -> cellFormat
Definition: RagTimeSpreadsheet.cxx:416
MWAWCellContent::FormulaInstruction::m_content
std::string m_content
the content ( if type == F_Operator or type = F_Function or type==F_Text)
Definition: MWAWCell.hxx:417
RagTimeParser::getZoneDataFieldSize
int getZoneDataFieldSize(int zId) const
returns the size of a zone data field
Definition: RagTimeParser.cxx:443
MWAWCell::Format::m_DTFormat
std::string m_DTFormat
a date/time format ( using a subset of strftime format )
Definition: MWAWCell.hxx:113
MWAWCell::setFont
void setFont(MWAWFont const &font, bool isDefault=false)
sets the fonts
Definition: MWAWCell.hxx:258
MWAWPosition::size
const MWAWVec2f & size() const
returns the frame size
Definition: MWAWPosition.hxx:135
MWAWEntry::type
const std::string & type() const
returns the type of the entry
Definition: MWAWEntry.hxx:137
RagTimeSpreadsheetInternal::Spreadsheet::m_isSent
bool m_isSent
true if the sheet is sent to the listener
Definition: RagTimeSpreadsheet.cxx:387
RagTimeStruct::ResourceList
a structure used to store list in a resource fork
Definition: RagTimeStruct.hxx:57
RagTimeSpreadsheetInternal::State::m_dateTimeList
std::vector< DateTime > m_dateTimeList
a list dateTimeFormatId -> dateTimeFormat;
Definition: RagTimeSpreadsheet.cxx:412
RagTimeSpreadsheetInternal::DateTime::m_isDate
bool m_isDate
true if this is a date field
Definition: RagTimeSpreadsheet.cxx:79
RagTimeStruct::ResourceList::gray
@ gray
Definition: RagTimeStruct.hxx:59
MWAWFont::Script::super100
static Script super100()
return a yposition which correspond to a basic superscript100
Definition: MWAWFont.hxx:135
MWAWFont::embossBit
@ embossBit
Definition: MWAWFont.hxx:190
RagTimeSpreadsheet::readFormula
bool readFormula(MWAWVec2i const &cellPos, std::vector< MWAWCellContent::FormulaInstruction > &formula, long endPos, std::string &extra)
try to read a formula: v3...
Definition: RagTimeSpreadsheet.cxx:2950
RagTimeSpreadsheet::readSpreadsheetCellDimension
bool readSpreadsheetCellDimension(MWAWVec2i const &cellPos, long endPos, RagTimeSpreadsheetInternal::Spreadsheet &sheet)
try to read a spreadsheet cells dimension
Definition: RagTimeSpreadsheet.cxx:1356
RagTimeParser
the main class to read a RagTime v2-3 file
Definition: RagTimeParser.hxx:60
RagTimeSpreadsheetInternal::CellFormat::m_align
MWAWCell::HorizontalAlignment m_align
the cell's alignment
Definition: RagTimeSpreadsheet.cxx:118
RagTimeSpreadsheet::readPositionsList
bool readPositionsList(MWAWEntry const &entry, std::vector< long > &posList, long &lastDataPos)
try to read a list of position
Definition: RagTimeSpreadsheet.cxx:1175
RagTimeStruct::ResourceList::SpDE
@ SpDE
Definition: RagTimeStruct.hxx:59
MWAWCell.hxx
RagTimeSpreadsheetInternal::ComplexBlock::m_zones
std::vector< Zone > m_zones
the list of zone
Definition: RagTimeSpreadsheet.cxx:217
MWAWCell::getFormat
const Format & getFormat() const
returns the cell format
Definition: MWAWCell.hxx:237
MWAWCell::Format::m_digits
int m_digits
the number of digits
Definition: MWAWCell.hxx:99
RagTimeSpreadsheetInternal::Spreadsheet::m_rows
int m_rows
the number of row
Definition: RagTimeSpreadsheet.cxx:367
RagTimeSpreadsheetInternal::DateTime::DateTime
DateTime()
constructor
Definition: RagTimeSpreadsheet.cxx:65
RagTimeSpreadsheetInternal::Spreadsheet::m_cellsBegin
long m_cellsBegin
the positions of the cells in the file
Definition: RagTimeSpreadsheet.cxx:379
MWAWCellContent::FormulaInstruction::F_Text
@ F_Text
Definition: MWAWCell.hxx:398
RagTimeSpreadsheet::version
int version() const
returns the file version
Definition: RagTimeSpreadsheet.cxx:442
MWAWCell::Format::m_numberFormat
NumberType m_numberFormat
the numeric format
Definition: MWAWCell.hxx:97
RagTimeStruct::ResourceList::Undef
@ Undef
Definition: RagTimeStruct.hxx:59
RagTimeSpreadsheetInternal::CellExtra::m_extra
std::string m_extra
extra data
Definition: RagTimeSpreadsheet.cxx:181
MWAWCell::position
const MWAWVec2i & position() const
position accessor
Definition: MWAWCell.hxx:184
RagTimeSpreadsheetInternal::ComplexBlock::Zone::Zone
Zone()
constructor
Definition: RagTimeSpreadsheet.cxx:195
MWAWFont::m_extra
std::string m_extra
extra data
Definition: MWAWFont.hxx:573
RagTimeSpreadsheetInternal::CellFormat
Internal: cell number format of a RagTimeSpreadsheet (SpVa block)
Definition: RagTimeSpreadsheet.cxx:85
RagTimeSpreadsheetInternal::Cell
Internal: a cell of a RagTimeSpreadsheet.
Definition: RagTimeSpreadsheet.cxx:223
MWAWCell::setProtected
void setProtected(bool fl)
sets the cell's protected flag
Definition: MWAWCell.hxx:270
RagTimeParser::getFontId
int getFontId(int localId) const
returns a mac font id corresponding to a local id
Definition: RagTimeParser.cxx:417
RagTimeSpreadsheet::RagTimeSpreadsheet
RagTimeSpreadsheet(RagTimeParser &parser)
constructor
Definition: RagTimeSpreadsheet.cxx:432
MWAWCellContent::m_formula
std::vector< FormulaInstruction > m_formula
the formula list of instruction
Definition: MWAWCell.hxx:491
RagTimeSpreadsheetInternal::Spreadsheet::getRowHeight
float getRowHeight(int row, int &numRepeated) const
returns the height of a row in point and updated repeated row
Definition: RagTimeSpreadsheet.cxx:324
MWAWSpreadsheetListenerPtr
std::shared_ptr< MWAWSpreadsheetListener > MWAWSpreadsheetListenerPtr
a smart pointer of MWAWSpreadsheetListener
Definition: libmwaw_internal.hxx:563
MWAWFont::shadowBit
@ shadowBit
Definition: MWAWFont.hxx:191
MWAWEntry::setType
void setType(std::string const &newType)
sets the type of the entry: BTEP,FDPP, BTEC, FDPC, PLC , TEXT, ...
Definition: MWAWEntry.hxx:132
RagTimeSpreadsheet::readSpreadsheetComplexStructure
bool readSpreadsheetComplexStructure(MWAWEntry const &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet)
try to read a complex structured spreadsheet zone
Definition: RagTimeSpreadsheet.cxx:1769
MWAWSpreadsheetListener
This class contents the main functions needed to create a spreadsheet processing Document.
Definition: MWAWSpreadsheetListener.hxx:65
MWAWParagraph.hxx
libmwaw_internal.hxx
RagTimeSpreadsheetInternal::CellFormat::operator<<
friend std::ostream & operator<<(std::ostream &o, CellFormat const &form)
operator<<
Definition: RagTimeSpreadsheet.cxx:99
MWAWPosition.hxx
MWAWEntry::setEnd
void setEnd(long off)
sets the end offset
Definition: MWAWEntry.hxx:77
MWAWCellContent::FormulaInstruction::m_type
Type m_type
the type
Definition: MWAWCell.hxx:415
MWAWCell::Format
a structure uses to define the format of a cell content
Definition: MWAWCell.hxx:60
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:47
RagTimeSpreadsheetInternal::CellExtra::operator<<
friend std::ostream & operator<<(std::ostream &o, CellExtra const &st)
operator<<
Definition: RagTimeSpreadsheet.cxx:169
MWAWBorder
a border
Definition: libmwaw_internal.hxx:333
MWAWEntry::setBegin
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:67
MWAWSpreadsheetEncoder::getBinaryResult
bool getBinaryResult(MWAWEmbeddedObject &object)
return the final spreadsheet
Definition: MWAWSpreadsheetEncoder.cxx:77
RagTimeSpreadsheet::operator=
RagTimeSpreadsheet & operator=(RagTimeSpreadsheet const &orig)=delete
RagTimeSpreadsheet
the main class to read the spreadsheet part of ragTime file
Definition: RagTimeSpreadsheet.hxx:71
RagTimeSpreadsheetInternal::CellFormat::m_rotation
int m_rotation
the rotation angle
Definition: RagTimeSpreadsheet.cxx:120
RagTimeSpreadsheetInternal::State::m_cellDEList
std::vector< std::string > m_cellDEList
a list SpDEId -> unknown data
Definition: RagTimeSpreadsheet.cxx:422
RagTimeSpreadsheetInternal
Internal: the structures of a RagTimeSpreadsheet.
Definition: RagTimeSpreadsheet.cxx:59
MWAWCellContent::m_value
double m_value
the cell value
Definition: MWAWCell.hxx:485
MWAWEntry::length
long length() const
returns the length of the zone
Definition: MWAWEntry.hxx:93
RagTimeSpreadsheetInternal::CellBorder::m_borders
MWAWBorder m_borders[2]
the top and left border
Definition: RagTimeSpreadsheet.cxx:152
RagTimeSpreadsheet::m_mainParser
RagTimeParser * m_mainParser
the main parser;
Definition: RagTimeSpreadsheet.hxx:167
libmwaw::RightBit
@ RightBit
Definition: libmwaw_internal.hxx:178
RagTimeSpreadsheetInternal::CellExtra::update
void update(Cell &cell) const
update the cell color if need
Definition: RagTimeSpreadsheet.cxx:292
MWAWVec2< int >
MWAWCellContent
small class use to define a sheet cell content
Definition: MWAWCell.hxx:393
MWAWPictMac.hxx
RagTimeSpreadsheetInternal::CellFormat::update
void update(Cell &cell) const
update the cell format if needed
Definition: RagTimeSpreadsheet.cxx:270
MWAWDebug.hxx
MWAWFont::getDebugString
std::string getDebugString(std::shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:181
MWAWEntry::begin
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:83
RagTimeSpreadsheetInternal::Spreadsheet::m_rowPositionsList
std::vector< long > m_rowPositionsList
the positions of row in the file
Definition: RagTimeSpreadsheet.cxx:383
MWAWEntry::setLength
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:72
RagTimeSpreadsheet::getDateTimeFormat
bool getDateTimeFormat(int dtId, std::string &dtFormat) const
returns the ith date format or ""
Definition: RagTimeSpreadsheet.cxx:452
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
RagTimeSpreadsheetInternal::CellBorder::operator<<
friend std::ostream & operator<<(std::ostream &o, CellBorder const &border)
operator<<
Definition: RagTimeSpreadsheet.cxx:142
MWAWFont::setId
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:264
MWAWCellContent::FormulaInstruction::m_longValue
double m_longValue
value ( if type==F_Long )
Definition: MWAWCell.hxx:419
RagTimeSpreadsheet::readSpreadsheet
bool readSpreadsheet(MWAWEntry &entry)
try to read a spreadsheet zone: v3-...
Definition: RagTimeSpreadsheet.cxx:1233
MWAWEntry::setId
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:169
MWAWPosition::Char
@ Char
Definition: MWAWPosition.hxx:51
MWAWCellContent::FormulaInstruction::m_doubleValue
double m_doubleValue
value ( if type==F_Double )
Definition: MWAWCell.hxx:421
RagTimeStruct::ResourceList::SpBo
@ SpBo
Definition: RagTimeStruct.hxx:59
RagTimeSpreadsheetInternal::State::State
State()
constructor
Definition: RagTimeSpreadsheet.cxx:394
RagTimeSpreadsheetInternal::CellBorder::CellBorder
CellBorder()
constructor
Definition: RagTimeSpreadsheet.cxx:130
MWAWCellContent::C_FORMULA
@ C_FORMULA
Definition: MWAWCell.hxx:433
RagTimeSpreadsheetInternal::ComplexBlock::Zone
a small zone of a ComplexBlock
Definition: RagTimeSpreadsheet.cxx:193
RagTimeSpreadsheetInternal::Cell::validateFormula
bool validateFormula()
test if we can use or not the formula
Definition: RagTimeSpreadsheet.cxx:239
MWAWCellContent::FormulaInstruction::F_Cell
@ F_Cell
Definition: MWAWCell.hxx:398
RagTimeSpreadsheet::readFormulaV2
bool readFormulaV2(MWAWVec2i const &cellPos, std::vector< MWAWCellContent::FormulaInstruction > &formula, long endPos, std::string &extra)
try to read a formula
Definition: RagTimeSpreadsheet.cxx:3143
RagTimeStruct::ResourceList::SpVa
@ SpVa
Definition: RagTimeStruct.hxx:59
RagTimeParser::sendText
bool sendText(int zId, MWAWListenerPtr listener)
try to send the text zone (interface of RagTimeText)
Definition: RagTimeParser.cxx:467
MWAWCellContent::FormulaInstruction::F_Long
@ F_Long
Definition: MWAWCell.hxx:398
MWAWEntry::end
long end() const
returns the end offset
Definition: MWAWEntry.hxx:88
MWAWFont::setSize
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:275
MWAWCell::F_NUMBER
@ F_NUMBER
Definition: MWAWCell.hxx:56
RagTimeSpreadsheetInternal::State::m_cellFontList
std::vector< MWAWFont > m_cellFontList
a list SpTe -> font
Definition: RagTimeSpreadsheet.cxx:414
RagTimeSpreadsheet::readSpreadsheetCellsV2
bool readSpreadsheetCellsV2(MWAWEntry &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet)
try to read spreadsheet cells :v2
Definition: RagTimeSpreadsheet.cxx:1983
RagTimeSpreadsheetInternal::DateTime::operator<<
friend std::ostream & operator<<(std::ostream &o, DateTime const &dt)
operator<<
Definition: RagTimeSpreadsheet.cxx:71
MWAWCell::F_TIME
@ F_TIME
Definition: MWAWCell.hxx:56
RagTimeSpreadsheetInternal::ComplexBlock::ComplexBlock
ComplexBlock()
constructor
Definition: RagTimeSpreadsheet.cxx:187
RagTimeSpreadsheet.hxx
libmwaw::LeftBit
@ LeftBit
Definition: libmwaw_internal.hxx:178
RagTimeSpreadsheetInternal::CellExtra::CellExtra
CellExtra()
constructor
Definition: RagTimeSpreadsheet.cxx:160
RagTimeSpreadsheetInternal::State::m_numericFormatList
std::vector< MWAWCell::Format > m_numericFormatList
a list of numeric format
Definition: RagTimeSpreadsheet.cxx:410
RagTimeParser::getColor
bool getColor(int colId, MWAWColor &color, int listId=-1) const
returns the ith color ( if possible)
Definition: RagTimeParser.cxx:427
MWAWSpreadsheetEncoder.hxx
RagTimeSpreadsheetInternal::Spreadsheet::m_widthCols
std::vector< float > m_widthCols
the column size in points
Definition: RagTimeSpreadsheet.cxx:373
MWAWFont::italicBit
@ italicBit
Definition: MWAWFont.hxx:190
MWAWCell::F_NUMBER_CURRENCY
@ F_NUMBER_CURRENCY
Definition: MWAWCell.hxx:58
RagTimeSpreadsheetInternal::Cell::Cell
Cell(MWAWVec2i pos=MWAWVec2i(0, 0))
constructor
Definition: RagTimeSpreadsheet.cxx:225
RagTimeSpreadsheetInternal::CellBorder::update
void update(Cell &cell) const
update the cell border if need
Definition: RagTimeSpreadsheet.cxx:286
MWAWTextListener.hxx
RagTimeSpreadsheetInternal::Spreadsheet::getColumnsWidth
std::vector< float > getColumnsWidth() const
returns the columns dimension in point
Definition: RagTimeSpreadsheet.cxx:341
MWAWCellContent::C_TEXT
@ C_TEXT
Definition: MWAWCell.hxx:433
RagTimeStruct::ResourceList::SpCe
@ SpCe
Definition: RagTimeStruct.hxx:59
RagTimeSpreadsheetInternal::ComplexBlock::Zone::m_data
int m_data[3]
three unknown int
Definition: RagTimeSpreadsheet.cxx:214
MWAWCell::Format::m_format
FormatType m_format
the cell format : by default unknown
Definition: MWAWCell.hxx:95
RagTimeSpreadsheetInternal::CellExtra
Internal: extra cell format of a RagTimeSpreadsheet (SpCe block)
Definition: RagTimeSpreadsheet.cxx:158
RagTimeSpreadsheet::readRsrcSpDo
bool readRsrcSpDo(MWAWEntry &entry)
try to read the SpDo zone (a spreadsheet zone with id=0)
Definition: RagTimeSpreadsheet.cxx:1034
MWAWCellContent::FormulaInstruction::F_Double
@ F_Double
Definition: MWAWCell.hxx:398
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:557
MWAWCell::HorizontalAlignment
HorizontalAlignment
the default horizontal alignment.
Definition: MWAWCell.hxx:128
libmwaw::TopBit
@ TopBit
Definition: libmwaw_internal.hxx:178
MWAWCellContent::FormulaInstruction::m_position
MWAWVec2i m_position[2]
cell position ( if type==F_Cell or F_CellList )
Definition: MWAWCell.hxx:423
MWAWSpreadsheetEncoder
main class used to define store librevenge::RVNGSpreadsheetInterface lists of command in a librevenge...
Definition: MWAWSpreadsheetEncoder.hxx:55
RagTimeSpreadsheet::readSpreadsheetCellFormat
bool readSpreadsheetCellFormat(MWAWVec2i const &cellPos, long endPos, RagTimeSpreadsheetInternal::Cell &cell)
try to read a spreadsheet cell's format
Definition: RagTimeSpreadsheet.cxx:1552
libmwaw::DebugFile::addPos
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
MWAWCell::setBorders
void setBorders(int wh, MWAWBorder const &border)
sets the cell border: wh=libmwaw::LeftBit|...
Definition: MWAWCell.cxx:382
MWAWCellContent::FormulaInstruction::m_sheet
librevenge::RVNGString m_sheet[2]
the sheet names (if not empty)
Definition: MWAWCell.hxx:427
RagTimeSpreadsheetInternal::CellFormat::CellFormat
CellFormat()
constructor
Definition: RagTimeSpreadsheet.cxx:87
RagTimeSpreadsheet::readResource
bool readResource(MWAWEntry &entry)
try to read a SpXX resource
Definition: RagTimeSpreadsheet.cxx:706
RagTimeSpreadsheet::~RagTimeSpreadsheet
virtual ~RagTimeSpreadsheet()
destructor
Definition: RagTimeSpreadsheet.cxx:439
MWAWEntry::valid
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:99
MWAWBorder::m_extra
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:395
RagTimeSpreadsheetInternal::CellExtra::m_isTransparent
bool m_isTransparent
true if the cell is transparent
Definition: RagTimeSpreadsheet.cxx:177
MWAWSpreadsheetListener.hxx
RagTimeSpreadsheetInternal::DateTime::m_DTFormat
std::string m_DTFormat
the date time format
Definition: RagTimeSpreadsheet.cxx:81
RagTimeSpreadsheetInternal::State::m_cellBorderList
std::vector< CellBorder > m_cellBorderList
a list SpBoId -> cellBorder
Definition: RagTimeSpreadsheet.cxx:418
RagTimeSpreadsheet::readCellInFormulaV2
bool readCellInFormulaV2(MWAWVec2i const &pos, bool canBeList, MWAWCellContent::FormulaInstruction &instr, long endPos, std::string &extra)
try to read a cell in a formula
Definition: RagTimeSpreadsheet.cxx:2828
RagTimeSpreadsheetInternal::Spreadsheet::m_cellsMap
Map m_cellsMap
the map cell position to not empty cells
Definition: RagTimeSpreadsheet.cxx:381
RagTimeSpreadsheet::readSpreadsheetSimpleStructure
bool readSpreadsheetSimpleStructure(MWAWEntry const &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet)
try to read a simple structured spreadsheet zone
Definition: RagTimeSpreadsheet.cxx:1689
libmwaw::DebugFile
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:65
RagTimeSpreadsheet::m_state
std::shared_ptr< RagTimeSpreadsheetInternal::State > m_state
the state
Definition: RagTimeSpreadsheet.hxx:164
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:106
RagTimeSpreadsheetInternal::Spreadsheet::m_name
std::string m_name
the sheet name
Definition: RagTimeSpreadsheet.cxx:385
MWAWCellContent::FormulaInstruction::m_positionRelative
MWAWVec2b m_positionRelative[2]
relative cell position ( if type==F_Cell or F_CellList )
Definition: MWAWCell.hxx:425
MWAWInputStream.hxx
RagTimeSpreadsheetInternal::ComplexBlock::Zone::m_pos
long m_pos
the zone position
Definition: RagTimeSpreadsheet.cxx:212
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:289
MWAWListenerPtr
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:553
RagTimeSpreadsheetInternal::ComplexBlock
Internal: header of a complex block of a RagTimeSpreadsheet.
Definition: RagTimeSpreadsheet.cxx:185
MWAWFont.hxx
MWAWPosition::m_anchorTo
AnchorTo m_anchorTo
anchor position
Definition: MWAWPosition.hxx:270
RagTimeStruct::ResourceList::colr
@ colr
Definition: RagTimeStruct.hxx:59
RagTimeSpreadsheet::readSpreadsheetExtraV2
bool readSpreadsheetExtraV2(MWAWEntry &entry, RagTimeSpreadsheetInternal::Spreadsheet &sheet)
try to read spreadsheet end zone (positions, ...) :v2
Definition: RagTimeSpreadsheet.cxx:2400
MWAWCell::HALIGN_LEFT
@ HALIGN_LEFT
Definition: MWAWCell.hxx:128
RagTimeStruct::ResourceList::BuGr
@ BuGr
Definition: RagTimeStruct.hxx:59
RagTimeSpreadsheetInternal::Spreadsheet::m_heightRows
std::vector< float > m_heightRows
the row height in points
Definition: RagTimeSpreadsheet.cxx:377
MWAWBox2< float >
RagTimeParser::readTextZone
bool readTextZone(MWAWEntry &entry, int width, MWAWColor const &fontColor=MWAWColor::black())
try to read a text zone (knowing the zone width in point and the font color)
Definition: RagTimeParser.cxx:457
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:43
RagTimeSpreadsheet::readSpreadsheetV2
bool readSpreadsheetV2(MWAWEntry &entry)
try to read spreadsheet zone ( a big zone):v2
Definition: RagTimeSpreadsheet.cxx:1920
MWAWCell
a structure used to define a cell and its format
Definition: MWAWCell.hxx:52
RagTimeSpreadsheetInternal::CellFormat::m_extra
std::string m_extra
extra data (for debugging)
Definition: RagTimeSpreadsheet.cxx:124
MWAWCellContent::m_contentType
Type m_contentType
the content type ( by default unknown )
Definition: MWAWCell.hxx:483
RagTimeSpreadsheet::readSpreadsheetCellContent
bool readSpreadsheetCellContent(RagTimeSpreadsheetInternal::Cell &cell, long endPos)
try to read a spreadsheet cells content
Definition: RagTimeSpreadsheet.cxx:1422
MWAWCellContent::C_NUMBER
@ C_NUMBER
Definition: MWAWCell.hxx:433
MWAWBorder::m_color
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:393
MWAWCell::HALIGN_RIGHT
@ HALIGN_RIGHT
Definition: MWAWCell.hxx:128
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
libmwaw::DebugStream
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
MWAWParser.hxx
MWAWFont::setUnderlineStyle
void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
sets the underline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:466
RagTimeSpreadsheetInternal::CellBorder
Internal: cell border of a RagTimeSpreadsheet (SpVa block)
Definition: RagTimeSpreadsheet.cxx:128
MWAWCell::Format::m_thousandHasSeparator
bool m_thousandHasSeparator
true if we must separate the thousand
Definition: MWAWCell.hxx:107
MWAWCell::HALIGN_CENTER
@ HALIGN_CENTER
Definition: MWAWCell.hxx:128
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:325
RagTimeSpreadsheetInternal::State::m_cellExtraList
std::vector< CellExtra > m_cellExtraList
a list SpCeId -> cellExtra
Definition: RagTimeSpreadsheet.cxx:420
MWAWCell::F_TEXT
@ F_TEXT
Definition: MWAWCell.hxx:56
RagTimeSpreadsheetInternal::ComplexBlock::Zone::operator<<
friend std::ostream & operator<<(std::ostream &o, Zone const &z)
operator<<
Definition: RagTimeSpreadsheet.cxx:201
MWAWCell::getFont
MWAWFont getFont() const
returns the font
Definition: MWAWCell.hxx:253
RagTimeSpreadsheet::flushExtra
void flushExtra()
flush extra data
Definition: RagTimeSpreadsheet.cxx:2593