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 
52 {
53 struct Layer;
54 struct Slide;
55 
56 struct State;
57 }
58 
59 class Canvas5Graph;
60 class Canvas5Image;
62 
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 
88 protected:
90  bool createDocument(librevenge::RVNGDrawingInterface *documentInterface);
91 
92  //
93  // interface
94  //
95 
97  bool isWindowsFile() const;
98 
99 protected:
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:
Canvas5Image
the main class to read/convert the image or movie inside of Canvas 5-11 files
Definition: Canvas5Image.hxx:78
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
Canvas5BMParser::createZones
bool createZones()
finds the different objects zones
Definition: Canvas5BMParser.cxx:188
MWAWGraphicListenerPtr
std::shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:549
MWAWPageSpan::setPageSpan
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:268
Canvas5BMParser::isWindowsFile
bool isWindowsFile() const
returns true if the file is a windows file
Definition: Canvas5BMParser.cxx:116
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
Canvas5BMParserInternal
Internal: the structures of a Canvas5BMParser.
Definition: Canvas5BMParser.cxx:71
MWAWParser::getGraphicListener
MWAWGraphicListenerPtr & getGraphicListener()
returns the graphic listener
Definition: MWAWParser.hxx:130
Canvas5BMParserInternal::State::m_dimension
MWAWVec2i m_dimension
the image dimension
Definition: Canvas5BMParser.cxx:90
MWAWPosition::setRelativePosition
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:237
MWAWDocument::MWAW_K_PAINT
@ MWAW_K_PAINT
bitmap graphic
Definition: MWAWDocument.hxx:84
MWAWDocument::MWAW_T_CANVAS
@ MWAW_T_CANVAS
Deneba Canvas mac: v2-v3 and v5-v8, windows: v3 and v5-v6 and probably v7-v8 ADC Canvas mac: v9-v10,...
Definition: MWAWDocument.hxx:229
Canvas5BMParser
the main class to read a mac Canvas 5/6 bitmap file: .cvi
Definition: Canvas5BMParser.hxx:72
Canvas5BMParserInternal::State::m_isWindowsFile
bool m_isWindowsFile
true if this is a windows file
Definition: Canvas5BMParser.cxx:86
MWAWFontConverter.hxx
Canvas5BMParser.hxx
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
MWAWParser::version
int version() const
returns the works version
Definition: MWAWParser.hxx:108
Canvas5Graph
the main class to read the graphic part of Canvas v5-v11 file
Definition: Canvas5Graph.hxx:85
MWAWPrinter.hxx
Canvas5Structure::Stream::input
MWAWInputStreamPtr input()
returns the input file
Definition: Canvas5Structure.hxx:65
MWAWParser::ascii
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
Canvas5StyleManager.hxx
MWAWParser::asciiName
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
Canvas5BMParserInternal::State::m_image
MWAWEmbeddedObject m_image
the image
Definition: Canvas5BMParser.cxx:92
MWAWPageSpan::setFormLength
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:178
libmwaw::DebugFile::reset
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
MWAWParser::setAsciiName
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
MWAWParagraph.hxx
MWAWRSRCParser.hxx
MWAWParser::getRSRCParser
MWAWRSRCParserPtr & getRSRCParser()
returns the rsrc parser
Definition: MWAWParser.hxx:190
MWAWPageSpan::setFormWidth
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:183
MWAWPosition.hxx
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
Canvas5Structure::Stream::ascii
libmwaw::DebugFile & ascii()
return the ascii file
Definition: Canvas5Structure.hxx:70
MWAWParser::setGraphicListener
void setGraphicListener(MWAWGraphicListenerPtr &listener)
sets the graphic listener
Definition: MWAWParser.cxx:125
Canvas5BMParserInternal::State::m_stream
std::shared_ptr< Canvas5Structure::Stream > m_stream
the current stream
Definition: Canvas5BMParser.cxx:88
Canvas5Structure
a namespace used to define basic function or structure to read a Canvas v5-v11 file
Definition: Canvas5BMParser.hxx:64
MWAWParser::setVersion
void setVersion(int vers)
sets the document's version
Definition: MWAWParser.hxx:206
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:561
MWAWPosition::m_wrapping
Wrapping m_wrapping
Wrapping.
Definition: MWAWPosition.hxx:278
MWAWPictData.hxx
MWAWOLEParser.hxx
MWAWVec2< int >
Canvas5BMParser::createDocument
bool createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition: Canvas5BMParser.cxx:154
MWAWGraphicListener.hxx
MWAWGraphicShape.hxx
Canvas5Structure::readBitmapDAD58Bim
bool readBitmapDAD58Bim(Stream &stream, int version, MWAWEmbeddedObject &object)
try to read a bitmap followed by DAD5 and 8BIM zones
Definition: Canvas5Structure.cxx:286
libmwaw::ParseException
Definition: libmwaw_internal.hxx:144
MWAWDebug.hxx
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:57
MWAWParser::getPageSpan
MWAWPageSpan const & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
Canvas5Structure.hxx
Canvas5BMParserInternal::State::State
State()
constructor
Definition: Canvas5BMParser.cxx:76
MWAWGraphicParser
virtual class which defines the ancestor of all graphic zone parser
Definition: MWAWParser.hxx:251
Canvas5Graph.hxx
Canvas5BMParser::~Canvas5BMParser
~Canvas5BMParser() final
destructor
Definition: Canvas5BMParser.cxx:112
MWAWParser::getParserState
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
Canvas5BMParser::parse
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
virtual function used to parse the input
Definition: Canvas5BMParser.cxx:124
MWAWHeader.hxx
Defines MWAWHeader (document's type, version, kind)
MWAWGraphicStyle.hxx
MWAWParser::getInput
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
Canvas5BMParser::Canvas5BMParser
Canvas5BMParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: Canvas5BMParser.cxx:100
MWAWPosition::Page
@ Page
Definition: MWAWPosition.hxx:51
Canvas5Structure::Stream
a sub stream of Canvas5Structure
Definition: Canvas5Structure.hxx:49
MWAWStringStream.hxx
MWAWInputStream.hxx
Canvas5Image.hxx
MWAWHeader::reset
void reset(MWAWDocument::Type type, int vers, Kind kind=MWAWDocument::MWAW_K_TEXT)
resets the data
Definition: MWAWHeader.hxx:84
MWAWPosition::WNone
@ WNone
Definition: MWAWPosition.hxx:53
librevenge
Definition: MWAWDocument.hxx:57
MWAWPictBitmap.hxx
MWAWPageSpan::setMargins
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
Canvas5BMParser::m_state
std::shared_ptr< Canvas5BMParserInternal::State > m_state
the state
Definition: Canvas5BMParser.hxx:121
Canvas5StyleManager
the main class to read the style part of Canvas 5 file
Definition: Canvas5StyleManager.hxx:86
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
libmwaw::DebugStream
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
MWAWParser.hxx
MWAWParser::resetGraphicListener
void resetGraphicListener()
resets the listener
Definition: MWAWParser.cxx:130
Canvas5BMParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: Canvas5BMParser.cxx:214
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:99
MWAWGraphicListener
This class contains the code needed to create Graphic document.
Definition: MWAWGraphicListener.hxx:60
Canvas5BMParserInternal::State
Internal: the state of a Canvas5BMParser.
Definition: Canvas5BMParser.cxx:74
Canvas5BMParser::readFileHeader
bool readFileHeader(Canvas5Structure::Stream &stream)
try to read the file header
Definition: Canvas5BMParser.cxx:235

Generated on Mon Jul 26 2021 00:00:00 for libmwaw by doxygen 1.8.20