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 <vector>
26 
27 #include <libwpd/libwpd.h>
28 
29 #include "libwps_internal.h"
30 #include "WPSParser.h"
31 
32 class WPXString;
35 class WPSEntry;
36 class WPSPosition;
37 class WPSPageSpan;
38 
39 namespace WPS8ParserInternal
40 {
41 class SubDocument;
42 struct State;
43 }
44 
45 class WPS8Graph;
46 class WPS8Table;
47 class WPS8Text;
48 
53 class WPS8Parser : public WPSParser
54 {
56  friend class WPS8Graph;
57  friend class WPS8Table;
58  friend class WPS8Text;
59 
60 public:
62  WPS8Parser(WPXInputStreamPtr &input, WPSHeaderPtr &header);
64  ~WPS8Parser();
66  void parse(WPXDocumentInterface *documentInterface);
67 protected:
69  bool checkInFile(long pos);
70 
72  void newPage(int number);
74  void setListener(shared_ptr<WPS8ContentListener> listener);
76  shared_ptr<WPS8ContentListener> createListener(WPXDocumentInterface *interface);
77 
79  bool createStructures();
81  bool createOLEStructures();
82 
84  float pageHeight() const;
86  float pageWidth() const;
88  int numColumns() const;
89 
91  void sendPageFrames();
92  // interface with text parser
93 
95  void sendTextBox(WPSPosition const &pos, int strsid,
96  WPXPropertyList frameExtras=WPXPropertyList());
97 
99  void send(WPSEntry const &entry);
101  void send(int strsId);
102 
104  void sendTextInCell(int strsId, int cellId);
105 
106  // interface with table parser
107 
109  bool sendTable(Vec2f const &size, int objectId);
111  int getTableSTRSId(int tableId) const;
112 
113  // interface with graph parser
114 
120  bool sendObject(Vec2f const &size, int objectId, bool ole);
121 
122  //
123  // low level
124  //
125 
127  bool parseHeaderIndexEntry();
130  bool parseHeaderIndexEntryEnd(long endPos, WPSEntry &hie,std::string &mess);
131 
136  bool parseHeaderIndex();
137 
141  bool readDocProperties(WPSEntry const &entry, WPSPageSpan &page);
142 
145  bool readFRAM(WPSEntry const &entry);
146 
151  bool readSYID(WPSEntry const &entry, std::vector<int> &listId);
152 
156  bool readWNPR(WPSEntry const &entry);
157 
159  bool readSPELLING(WPXInputStreamPtr input, std::string const &oleName);
160 
161  shared_ptr<WPS8ContentListener> m_listener; /* the listener (if set)*/
163  shared_ptr<WPS8Graph> m_graphParser;
165  shared_ptr<WPS8Table> m_tableParser;
167  shared_ptr<WPS8Text> m_textParser;
169  shared_ptr<WPS8ParserInternal::State> m_state;
170 };
171 
172 #endif /* WPS8_H */
173 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPSContentListener WPS8ContentListener
Definition: WPS8.h:33
This class parses Works version 2000 through 8.
Definition: WPS8.h:53
shared_ptr< WPS8Table > m_tableParser
the table parser
Definition: WPS8.h:165
shared_ptr< WPXInputStream > WPXInputStreamPtr
Definition: libwps_internal.h:74
the main class to read/store pictures in a Pc MS Works document v5-8
Definition: WPS8Graph.h:60
friend class WPS8Parser
Definition: WPS8Text.h:56
Definition: WPS8Text.h:53
the main class to read/store table in a Pc MS Works document v5-8
Definition: WPS8Table.h:62
Internal: the subdocument of a WPS8Parser.
Definition: WPS8.cpp:49
Definition: WPSContentListener.h:168
Definition: WPSParser.h:41
void setListener(WPS8ContentListenerPtr &listen)
sets the listener
Definition: WPS8Text.cpp:526
shared_ptr< WPS8ContentListener > m_listener
Definition: WPS8.h:161
shared_ptr< WPS8Text > m_textParser
the text parser
Definition: WPS8.h:167
Definition: WPS8.cpp:46
shared_ptr< WPSHeader > WPSHeaderPtr
Definition: WPSHeader.h:66
shared_ptr< WPS8ParserInternal::State > m_state
the internal state
Definition: WPS8.h:169
Definition: WPSPageSpan.h:42
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:37
shared_ptr< WPS8Graph > m_graphParser
the graph parser
Definition: WPS8.h:163
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: WPSPosition.h:39

Generated on Fri Oct 19 2018 22:44:32 for libwps by doxygen 1.8.13