CDRParser.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libcdr project.
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 
10 #ifndef __CDRPARSER_H__
11 #define __CDRPARSER_H__
12 
13 #include <stdio.h>
14 #include <iostream>
15 #include <vector>
16 #include <map>
17 #include <stack>
18 #include <libwpd-stream/libwpd-stream.h>
19 #include "CDRTypes.h"
20 #include "CommonParser.h"
21 
22 namespace libcdr
23 {
24 
25 class CDRCollector;
26 
27 class CDRParser : protected CommonParser
28 {
29 public:
30  explicit CDRParser(const std::vector<WPXInputStream *> &externalStreams, CDRCollector *collector);
31  virtual ~CDRParser();
32  bool parseRecords(WPXInputStream *input, unsigned *blockLengths = 0, unsigned level = 0);
33  bool parseWaldo(WPXInputStream *input);
34 
35 private:
36  CDRParser();
37  CDRParser(const CDRParser &);
38  CDRParser &operator=(const CDRParser &);
39  bool parseWaldoStructure(WPXInputStream *input, std::stack<WaldoRecordType1> &waldoStack,
40  const std::map<unsigned, WaldoRecordType1> &records1,
41  std::map<unsigned, WaldoRecordInfo> &records2);
42  bool gatherWaldoInformation(WPXInputStream *input, std::vector<WaldoRecordInfo> &records, std::map<unsigned, WaldoRecordInfo> &records2,
43  std::map<unsigned, WaldoRecordInfo> &records3, std::map<unsigned, WaldoRecordInfo> &records4,
44  std::map<unsigned, WaldoRecordInfo> &records6, std::map<unsigned, WaldoRecordInfo> &records7,
45  std::map<unsigned, WaldoRecordInfo> &records8, std::map<unsigned, WaldoRecordInfo> recordsOther);
46  void readWaldoRecord(WPXInputStream *input, const WaldoRecordInfo &info);
47  bool parseRecord(WPXInputStream *input, unsigned *blockLengths = 0, unsigned level = 0);
48  void readRecord(unsigned fourCC, unsigned length, WPXInputStream *input);
49  double readRectCoord(WPXInputStream *input);
50  CDRColor readColor(WPXInputStream *input);
51 
52  void readRectangle(WPXInputStream *input);
53  void readEllipse(WPXInputStream *input);
54  void readLineAndCurve(WPXInputStream *input);
55  void readBitmap(WPXInputStream *input);
56  void readPageSize(WPXInputStream *input);
57  void readWaldoBmp(WPXInputStream *input, unsigned length, unsigned id);
58  void readWaldoBmpf(WPXInputStream *input, unsigned id);
59  void readWaldoTrfd(WPXInputStream *input);
60  void readWaldoOutl(WPXInputStream *input);
61  void readWaldoFill(WPXInputStream *input);
62  void readWaldoLoda(WPXInputStream *input, unsigned length);
63  void readOpacity(WPXInputStream *input, unsigned length);
64  void readTrfd(WPXInputStream *input, unsigned length);
65  void readFild(WPXInputStream *input, unsigned length);
66  void readOutl(WPXInputStream *input, unsigned length);
67  void readLoda(WPXInputStream *input, unsigned length);
68  void readFlags(WPXInputStream *input, unsigned length);
69  void readMcfg(WPXInputStream *input, unsigned length);
70  void readPath(WPXInputStream *input);
71  void readArrw(WPXInputStream *input, unsigned length);
72  void readPolygonCoords(WPXInputStream *input);
73  void readPolygonTransform(WPXInputStream *input);
74  void readBmp(WPXInputStream *input, unsigned length);
75  void readBmpf(WPXInputStream *input, unsigned length);
76  void readPpdt(WPXInputStream *input, unsigned length);
77  void readFtil(WPXInputStream *input, unsigned length);
78  void readDisp(WPXInputStream *input, unsigned length);
79  void readVersion(WPXInputStream *input, unsigned length);
80  void readIccd(WPXInputStream *input, unsigned length);
81  void readBBox(WPXInputStream *input, unsigned length);
82  void readSpnd(WPXInputStream *input, unsigned length);
83  void readVpat(WPXInputStream *input, unsigned length);
84  void readUidr(WPXInputStream *input, unsigned length);
85  void readFont(WPXInputStream *input, unsigned length);
86  void readStlt(WPXInputStream *input, unsigned length);
87  void readStyd(WPXInputStream *input);
88  void readTxsm(WPXInputStream *input, unsigned length);
89  void readTxsm16(WPXInputStream *input);
90  void readTxsm6(WPXInputStream *input);
91  void readTxsm5(WPXInputStream *input);
92  void readUdta(WPXInputStream *input);
93  void readArtisticText(WPXInputStream *input);
94  void readParagraphText(WPXInputStream *input);
95 
96  bool _redirectX6Chunk(WPXInputStream **input, unsigned &length);
97  void _readX6StyleString(WPXInputStream *input, unsigned length, CDRCharacterStyle &style);
98 
99  std::vector<WPXInputStream *> m_externalStreams;
100 
101  std::map<unsigned, CDRFont> m_fonts;
102  std::map<unsigned, CDRFillStyle> m_fillStyles;
103  std::map<unsigned, CDRLineStyle> m_lineStyles;
104  std::map<unsigned, CDRPath> m_arrows;
105 
106  unsigned m_version;
107 
108 };
109 
110 } // namespace libcdr
111 
112 #endif // __CDRPARSER_H__
113 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */

Generated for libcdr by doxygen 1.8.3.1