- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

WPS8.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3 * Version: MPL 2.0 / LGPLv2.1+
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * Major Contributor(s):
10 * Copyright (C) 2006, 2007 Andrew Ziem
11 * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
12 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
13 *
14 * For minor contributions see the git repository.
15 *
16 * Alternatively, the contents of this file may be used under the terms
17 * of the GNU Lesser General Public License Version 2.1 or later
18 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19 * applicable instead of those above.
20 */
21
22 #ifndef WPS8_H
23 #define WPS8_H
24
25 #include <deque>
26 #include <vector>
27
28 #include <librevenge/librevenge.h>
29
30 #include "libwps_internal.h"
31 #include "WPSParser.h"
32
33 class WPSPageSpan;
34
35 namespace WPS8ParserInternal
36 {
37 class SubDocument;
38 struct State;
39 }
40
41 class WPS8Graph;
42 class WPS8Table;
43 class WPS8Text;
44
49 class WPS8Parser : public WPSParser
50 {
51 friend class WPS8ParserInternal::SubDocument;
52 friend class WPS8Graph;
53 friend class WPS8Table;
54 friend class WPS8Text;
55
56 public:
58 WPS8Parser(RVNGInputStreamPtr &input, WPSHeaderPtr &header);
60 ~WPS8Parser();
62 void parse(librevenge::RVNGTextInterface *documentInterface);
63 protected:
65 bool checkInFile(long pos);
66
68 void newPage(int number);
70 void setListener(shared_ptr<WPSContentListener> listener);
72 shared_ptr<WPSContentListener> createListener(librevenge::RVNGTextInterface *interface);
73
75 bool createStructures();
77 bool createOLEStructures();
78
80 float pageHeight() const;
82 float pageWidth() const;
84 int numColumns() const;
85
87 void sendPageFrames();
88 // interface with text parser
89
91 void sendTextBox(WPSPosition const &pos, int strsid,
92 librevenge::RVNGPropertyList frameExtras=librevenge::RVNGPropertyList());
93
95 void send(WPSEntry const &entry);
97 void send(int strsId);
98
100 void sendTextInCell(int strsId, int cellId);
101
102 // interface with table parser
103
105 bool sendTable(Vec2f const &size, int objectId);
107 int getTableSTRSId(int tableId) const;
108
109 // interface with graph parser
110
116 bool sendObject(Vec2f const &size, int objectId, bool ole);
117
118 //
119 // low level
120 //
121
123 bool parseHeaderIndexEntry();
126 bool parseHeaderIndexEntryEnd(long endPos, WPSEntry &hie,std::string &mess);
127
132 bool parseHeaderIndex();
133
137 bool readDocProperties(WPSEntry const &entry, WPSPageSpan &page);
138
141 bool readFRAM(WPSEntry const &entry);
142
147 bool readSYID(WPSEntry const &entry, std::vector<int> &listId);
148
152 bool readWNPR(WPSEntry const &entry);
153
155 bool readSPELLING(RVNGInputStreamPtr input, std::string const &oleName);
156
157 shared_ptr<WPSContentListener> m_listener; /* the listener (if set)*/
159 shared_ptr<WPS8Graph> m_graphParser;
161 shared_ptr<WPS8Table> m_tableParser;
163 shared_ptr<WPS8Text> m_textParser;
165 shared_ptr<WPS8ParserInternal::State> m_state;
166
167 private:
168 std::deque<int> m_sendingTables;
169 };
170
171 #endif /* WPS8_H */
172 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPS8Parser
This class parses Works version 2000 through 8.
Definition: WPS8.h:49
WPS8Parser::m_tableParser
shared_ptr< WPS8Table > m_tableParser
the table parser
Definition: WPS8.h:161
WPS8Graph
the main class to read/store pictures in a Pc MS Works document v5-8
Definition: WPS8Graph.h:54
WPS8Text::WPS8Parser
friend class WPS8Parser
Definition: WPS8Text.h:50
WPS8Text
Definition: WPS8Text.h:47
WPS8Table
the main class to read/store table in a Pc MS Works document v5-8
Definition: WPS8Table.h:57
WPSParser.h
WPS8ParserInternal::SubDocument
Internal: the subdocument of a WPS8Parser.
Definition: WPS8.cpp:50
WPSParser
Definition: WPSParser.h:35
WPS8Parser::m_sendingTables
std::deque< int > m_sendingTables
Definition: WPS8.h:168
WPS8Parser::m_listener
shared_ptr< WPSContentListener > m_listener
Definition: WPS8.h:157
WPSHeaderPtr
shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:108
libwps_internal.h
WPS8Parser::m_textParser
shared_ptr< WPS8Text > m_textParser
the text parser
Definition: WPS8.h:163
WPS8ParserInternal
Definition: WPS8.cpp:47
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
WPS8Text::setListener
void setListener(WPSContentListenerPtr &listen)
sets the listener
Definition: WPS8Text.cpp:532
WPS8Parser::m_state
shared_ptr< WPS8ParserInternal::State > m_state
the internal state
Definition: WPS8.h:165
WPSPageSpan
Definition: WPSPageSpan.h:38
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:37
Vec2< float >
WPS8Parser::m_graphParser
shared_ptr< WPS8Graph > m_graphParser
the graph parser
Definition: WPS8.h:159
WPSPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: WPSPosition.h:39