Debian Codegraph @

src/lib/Canvas5BMParser.hxx

raw
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 ([email protected])
18 * Copyright (C) 2002,2004 Marc Maurer ([email protected])
19 * Copyright (C) 2004-2006 Fridrich Strba ([email protected])
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent ([email protected])
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 CANVAS5_BM_PARSER
35 # define CANVAS5_BM_PARSER
36
37 #include <functional>
38 #include <map>
39 #include <string>
40 #include <utility>
41 #include <vector>
42
43 #include <librevenge/librevenge.h>
44
45 #include "MWAWDebug.hxx"
46 #include "MWAWInputStream.hxx"
47 #include "MWAWPosition.hxx"
48
49 #include "MWAWParser.hxx"
50
51 namespace Canvas5BMParserInternal
52 {
53 struct Layer;
54 struct Slide;
55
56 struct State;
57 }
58
59 class Canvas5Graph;
60 class Canvas5Image;
61 class Canvas5StyleManager;
62
63 namespace Canvas5Structure
64 {
65 struct Stream;
66 }
67
68 /** \brief the main class to read a mac Canvas 5/6 bitmap file: .cvi
69 *
70 */
71 class Canvas5BMParser final : public MWAWGraphicParser
72 {
73 friend class Canvas5Graph;
74 friend class Canvas5Image;
75 friend class Canvas5StyleManager;
76 public:
77 //! constructor
78 Canvas5BMParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
79 //! destructor
80 ~Canvas5BMParser() final;
81
82 //! checks if the document header is correct (or not)
83 bool checkHeader(MWAWHeader *header, bool strict=false) final;
84
85 // the main parse function
86 void parse(librevenge::RVNGDrawingInterface *documentInterface) final;
87
88 protected:
89 //! creates the listener which will be associated to the document
90 bool createDocument(librevenge::RVNGDrawingInterface *documentInterface);
91
92 //
93 // interface
94 //
95
96 //! returns true if the file is a windows file
97 bool isWindowsFile() const;
98
99 protected:
100 //! finds the different objects zones
101 bool createZones();
102
103 // Intermediate level
104
105 //! try to read the file header
106 bool readFileHeader(Canvas5Structure::Stream &stream);
107
108 //
109 // send data to the listener
110 //
111
112
113 //
114 // low level
115 //
116
117 //
118 // data
119 //
120 //! the state
121 std::shared_ptr<Canvas5BMParserInternal::State> m_state;
122 };
123 #endif
124 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: