BeagleWksSSParser.hxx Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

BeagleWksSSParser.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 #ifndef BEAGLE_WKS_SS_PARSER
35 # define BEAGLE_WKS_SS_PARSER
36
37 #include <string>
38 #include <vector>
39
40 #include <librevenge/librevenge.h>
41
42 #include "MWAWCell.hxx"
43 #include "MWAWDebug.hxx"
44 #include "MWAWGraphicStyle.hxx"
45 #include "MWAWInputStream.hxx"
46
47 #include "MWAWParser.hxx"
48
49 namespace BeagleWksSSParserInternal
50 {
51 class SubDocument;
52
53 struct Cell;
54 struct Chart;
55 struct Spreadsheet;
56 struct State;
57 }
58
59 class BeagleWksStructManager;
60
63 class BeagleWksSSParser : public MWAWSpreadsheetParser
64 {
65 friend struct BeagleWksSSParserInternal::Chart;
66 friend class BeagleWksSSParserInternal::SubDocument;
67 public:
69 BeagleWksSSParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header);
71 virtual ~BeagleWksSSParser();
72
74 bool checkHeader(MWAWHeader *header, bool strict=false);
75
76 // the main parse function
77 void parse(librevenge::RVNGSpreadsheetInterface *documentInterface);
78
79 protected:
81 void init();
82
84 void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface);
85
87 Vec2f getPageLeftTop() const;
89 void newPage(int number);
90
92 bool sendSpreadsheet();
94 bool sendText(MWAWEntry entry, bool headerFooter=false);
96 bool sendPageFrames();
98 bool sendFrame(BeagleWksStructManager::Frame const &frame);
100 bool sendPicture(int pId, MWAWPosition const &pos,
101 MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle());
102 protected:
104 bool createZones();
105
107 bool readRSRCZones();
108
109 //
110 // low level
111 //
112
113 // data fork similar than in BeagleWksParser ...
114
116 bool readPrintInfo();
117
118 // data fork
119
121 bool readChartZone();
122
124 bool readChart();
125
127 bool readSpreadsheet();
128
130 bool readRowSheet(BeagleWksSSParserInternal::Spreadsheet &sheet);
131
133 bool readCellSheet(BeagleWksSSParserInternal::Cell &cell);
134
136 bool readZone0();
137
139 bool readColumnWidths(BeagleWksSSParserInternal::Spreadsheet &sheet);
140
142 bool readFormula(BeagleWksSSParserInternal::Spreadsheet &sheet);
143
144 // resource fork
145
147 MWAWInputStreamPtr rsrcInput();
148
150 libmwaw::DebugFile &rsrcAscii();
151
153 shared_ptr<BeagleWksSSParserInternal::State> m_state;
154
156 shared_ptr<BeagleWksStructManager> m_structureManager;
157 };
158 #endif
159 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
MWAWParser.hxx
BeagleWksSSParser::newPage
void newPage(int number)
adds a new page
Definition: BeagleWksSSParser.cxx:319
BeagleWksSSParserInternal::Chart
Internal: the chart of a BeagleWksSSParser.
Definition: BeagleWksSSParser.cxx:133
BeagleWksSSParser::sendText
bool sendText(MWAWEntry entry, bool headerFooter=false)
try to send a text zone
Definition: BeagleWksSSParser.cxx:1415
BeagleWksSSParser::createDocument
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface)
creates the listener which will be associated to the document
Definition: BeagleWksSSParser.cxx:365
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
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
BeagleWksSSParser::getPageLeftTop
Vec2f getPageLeftTop() const
returns the page left top point ( in inches)
Definition: BeagleWksSSParser.cxx:310
BeagleWksSSParser::sendSpreadsheet
bool sendSpreadsheet()
try to send the main spreadsheet
Definition: BeagleWksSSParser.cxx:1451
BeagleWksSSParser::readRSRCZones
bool readRSRCZones()
read the resource fork zone
Definition: BeagleWksSSParser.cxx:498
BeagleWksSSParser
the main class to read a BeagleWorks spreadsheet file
Definition: BeagleWksSSParser.hxx:63
BeagleWksSSParser::init
void init()
inits all internal variables
Definition: BeagleWksSSParser.cxx:285
BeagleWksSSParser::sendPageFrames
bool sendPageFrames()
try to send the page graphic
Definition: BeagleWksSSParser.cxx:1366
BeagleWksSSParserInternal::Spreadsheet
Internal: the spreadsheet of a BeagleWksSSParser.
Definition: BeagleWksSSParser.cxx:78
BeagleWksSSParserInternal::Cell
Internal: the cell of a BeagleWksSSParser.
Definition: BeagleWksSSParser.cxx:63
BeagleWksStructManager::Frame
Internal: a structure use to store a frame in a BeagleWorks files.
Definition: BeagleWksStructManager.hxx:102
BeagleWksSSParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: BeagleWksSSParser.cxx:1520
MWAWRSRCParserPtr
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:439
BeagleWksSSParser::m_structureManager
shared_ptr< BeagleWksStructManager > m_structureManager
the structure manager
Definition: BeagleWksSSParser.hxx:156
BeagleWksSSParser::rsrcAscii
libmwaw::DebugFile & rsrcAscii()
a DebugFile used to write what we recognize when we parse the document in rsrc
Definition: BeagleWksSSParser.cxx:302
BeagleWksSSParser::sendPicture
bool sendPicture(int pId, MWAWPosition const &pos, MWAWGraphicStyle const &style=MWAWGraphicStyle::emptyStyle())
try to send a picture
Definition: BeagleWksSSParser.cxx:1390
BeagleWksSSParser::readCellSheet
bool readCellSheet(BeagleWksSSParserInternal::Cell &cell)
read a cell row
Definition: BeagleWksSSParser.cxx:967
BeagleWksSSParser::readSpreadsheet
bool readSpreadsheet()
read the spreadsheet zone
Definition: BeagleWksSSParser.cxx:886
BeagleWksSSParser::BeagleWksSSParser
BeagleWksSSParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: BeagleWksSSParser.cxx:275
BeagleWksSSParserInternal::SubDocument
Internal: the subdocument of a BeagleWksSSParser.
Definition: BeagleWksSSParser.cxx:221
BeagleWksSSParser::readPrintInfo
bool readPrintInfo()
read the print info zone
Definition: BeagleWksSSParser.cxx:537
BeagleWksSSParser::sendFrame
bool sendFrame(BeagleWksStructManager::Frame const &frame)
try to send a frame
Definition: BeagleWksSSParser.cxx:1375
BeagleWksSSParser::readFormula
bool readFormula(BeagleWksSSParserInternal::Spreadsheet &sheet)
read the differents formula
Definition: BeagleWksSSParser.cxx:1317
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:429
BeagleWksSSParser::readChart
bool readChart()
read a chart
Definition: BeagleWksSSParser.cxx:627
BeagleWksSSParser::createZones
bool createZones()
finds the different objects zones
Definition: BeagleWksSSParser.cxx:412
MWAWInputStream.hxx
MWAWDebug.hxx
BeagleWksSSParser::rsrcInput
MWAWInputStreamPtr rsrcInput()
return the input input
Definition: BeagleWksSSParser.cxx:297
BeagleWksStructManager
the main class to read the structure shared between different BeagleWorks files
Definition: BeagleWksStructManager.hxx:56
MWAWCell.hxx
Defines MWAWCell (cell content and format)
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
BeagleWksSSParser::readChartZone
bool readChartZone()
read the chart zone
Definition: BeagleWksSSParser.cxx:593
BeagleWksSSParser::parse
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface)
virtual function used to parse the input
Definition: BeagleWksSSParser.cxx:335
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
Vec2< float >
MWAWSpreadsheetParser
virtual class which defines the ancestor of all spreadsheet zone parser
Definition: MWAWParser.hxx:271
BeagleWksSSParser::~BeagleWksSSParser
virtual ~BeagleWksSSParser()
destructor
Definition: BeagleWksSSParser.cxx:281
BeagleWksSSParser::readZone0
bool readZone0()
read an unknown zone ( which appears before and after the columns's width zone )
Definition: BeagleWksSSParser.cxx:1248
BeagleWksSSParser::readRowSheet
bool readRowSheet(BeagleWksSSParserInternal::Spreadsheet &sheet)
read the spreadsheet row
Definition: BeagleWksSSParser.cxx:918
BeagleWksSSParserInternal
Internal: the structures of a BeagleWksSSParser.
Definition: BeagleWksSSParser.cxx:60
BeagleWksSSParser::m_state
shared_ptr< BeagleWksSSParserInternal::State > m_state
the state
Definition: BeagleWksSSParser.hxx:153
MWAWGraphicStyle.hxx
MWAWGraphicStyle::emptyStyle
static MWAWGraphicStyle emptyStyle()
returns an empty style.
Definition: MWAWGraphicStyle.hxx:204
BeagleWksSSParser::readColumnWidths
bool readColumnWidths(BeagleWksSSParserInternal::Spreadsheet &sheet)
read the columns widths
Definition: BeagleWksSSParser.cxx:1269