Canvas5BMParser.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 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
71 class Canvas5BMParser final : public MWAWGraphicParser
72{
73 friend class Canvas5Graph;
74 friend class Canvas5Image;
75 friend class Canvas5StyleManager;
76 public:
78 Canvas5BMParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
80 ~Canvas5BMParser() final;
81
83 bool checkHeader(MWAWHeader *header, bool strict=false) final;
84
85 // the main parse function
86 void parse(librevenge::RVNGDrawingInterface *documentInterface) final;
87
88protected:
90 bool createDocument(librevenge::RVNGDrawingInterface *documentInterface);
91
92 //
93 // interface
94 //
95
97 bool isWindowsFile() const;
98
99protected:
101 bool createZones();
102
103 // Intermediate level
104
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 //
121 std::shared_ptr<Canvas5BMParserInternal::State> m_state;
122};
123#endif
124// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWInputStream.hxx
MWAWParser.hxx
MWAWPosition.hxx
Canvas5BMParser::isWindowsFile
bool isWindowsFile() const
returns true if the file is a windows file
Definition Canvas5BMParser.cxx:116
Canvas5BMParser::readFileHeader
bool readFileHeader(Canvas5Structure::Stream &stream)
try to read the file header
Definition Canvas5BMParser.cxx:235
Canvas5BMParser::Canvas5Graph
friend class Canvas5Graph
Definition Canvas5BMParser.hxx:73
Canvas5BMParser::createDocument
bool createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition Canvas5BMParser.cxx:154
Canvas5BMParser::~Canvas5BMParser
~Canvas5BMParser() final
destructor
Definition Canvas5BMParser.cxx:112
Canvas5BMParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition Canvas5BMParser.cxx:214
Canvas5BMParser::Canvas5BMParser
Canvas5BMParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition Canvas5BMParser.cxx:100
Canvas5BMParser::parse
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition Canvas5BMParser.cxx:124
Canvas5BMParser::m_state
std::shared_ptr< Canvas5BMParserInternal::State > m_state
the state
Definition Canvas5BMParser.hxx:121
Canvas5BMParser::createZones
bool createZones()
finds the different objects zones
Definition Canvas5BMParser.cxx:188
Canvas5BMParser::Canvas5StyleManager
friend class Canvas5StyleManager
Definition Canvas5BMParser.hxx:75
Canvas5BMParser::Canvas5Image
friend class Canvas5Image
Definition Canvas5BMParser.hxx:74
Canvas5Graph
the main class to read the graphic part of Canvas v5-v11 file
Definition Canvas5Graph.hxx:85
Canvas5Image
the main class to read/convert the image or movie inside of Canvas 5-11 files
Definition Canvas5Image.hxx:78
Canvas5StyleManager
the main class to read the style part of Canvas 5 file
Definition Canvas5StyleManager.hxx:86
MWAWGraphicParser::MWAWGraphicParser
MWAWGraphicParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor (protected)
Definition MWAWParser.hxx:259
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition MWAWHeader.hxx:57
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition libmwaw_internal.hxx:561
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
Canvas5BMParserInternal
Internal: the structures of a Canvas5BMParser.
Definition Canvas5BMParser.cxx:71
Canvas5Structure
a namespace used to define basic function or structure to read a Canvas v5-v11 file
Definition Canvas5BMParser.hxx:64
librevenge
Definition MWAWDocument.hxx:57
Canvas5BMParserInternal::State
Internal: the state of a Canvas5BMParser.
Definition Canvas5BMParser.cxx:74
Canvas5Structure::Stream
a sub stream of Canvas5Structure
Definition Canvas5Structure.hxx:49