WPSOLE1Parser.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) 2009, 2011 Alonso Laurent (alonso@loria.fr)
11  * Copyright (C) 2006, 2007 Andrew Ziem
12  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
14  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
15  *
16  * For minor contributions see the git repository.
17  *
18  * Alternatively, the contents of this file may be used under the terms
19  * of the GNU Lesser General Public License Version 2.1 or later
20  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
21  * applicable instead of those above.
22  *
23  * For further information visit http://libwps.sourceforge.net
24  */
25 
26 /*
27  */
28 
29 #ifndef WPS_OLE1_PARSER_H
30 #define WPS_OLE1_PARSER_H
31 
32 #include <string>
33 
34 #include <librevenge-stream/librevenge-stream.h>
35 
36 #include "libwps_internal.h"
37 #include "libwps_tools_win.h"
38 
39 namespace WPSOLE1ParserInternal
40 {
41 struct State;
42 struct OLEZone;
43 }
44 
50 {
51 public:
53  explicit WPSOLE1Parser(shared_ptr<WPSStream> fileStream);
54 
57 
59  bool createZones();
60 
69  shared_ptr<WPSStream> getStreamForName(std::string const &name) const;
71  shared_ptr<WPSStream> getStreamForId(int id) const;
73  bool updateMetaData(librevenge::RVNGPropertyList &list, libwps_tools_win::Font::Type encoding) const;
75  bool updateEmbeddedObject(int id, WPSEmbeddedObject &object) const;
76 
77 protected:
81  shared_ptr<WPSStream> getStream(WPSOLE1ParserInternal::OLEZone const &zone) const;
83  void checkIfParsed(WPSOLE1ParserInternal::OLEZone const &zone) const;
84 
86  bool readPicture(shared_ptr<WPSStream> stream, WPSEmbeddedObject &object) const;
87 
88 private:
90  shared_ptr<WPSOLE1ParserInternal::State> m_state;
91 };
92 
93 #endif
94 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
shared_ptr< WPSStream > getStream(WPSOLE1ParserInternal::OLEZone const &zone) const
try to return a stream correponding to a zone
Definition: WPSOLE1Parser.cpp:390
shared_ptr< WPSStream > getStreamForName(std::string const &name) const
try to return a string corresponding to a name:
Definition: WPSOLE1Parser.cpp:334
bool readPicture(shared_ptr< WPSStream > stream, WPSEmbeddedObject &object) const
try to read a picture's frame: 0105 local zone
Definition: WPSOLE1Parser.cpp:634
bool createZones()
try to find the different zones
Definition: WPSOLE1Parser.cpp:128
Type
enum Type
Definition: libwps_tools_win.h:46
shared_ptr< WPSStream > getStreamForId(int id) const
try to return a string corresponding to some id
Definition: WPSOLE1Parser.cpp:347
void checkIfParsed(WPSOLE1ParserInternal::OLEZone const &zone) const
check for unparsed zone
Definition: WPSOLE1Parser.cpp:613
a class used to parse a container which is used by Lotus123 (and also by RagTime).
Definition: WPSOLE1Parser.h:49
std::string name(long id)
returns the name given Windows© id
Definition: libwps_tools_win.cpp:7297
~WPSOLE1Parser()
destructor
Definition: WPSOLE1Parser.cpp:114
bool updateEmbeddedObject(int id, WPSEmbeddedObject &object) const
try to retrieve the content of a graphic, knowing it local id
Definition: WPSOLE1Parser.cpp:431
Definition: WPSOLE1Parser.cpp:45
small class use to define a embedded object
Definition: libwps_internal.h:452
bool updateMetaData(librevenge::RVNGPropertyList &list, libwps_tools_win::Font::Type encoding) const
try to retrieve the meta data
Definition: WPSOLE1Parser.cpp:471
WPSOLE1Parser(shared_ptr< WPSStream > fileStream)
constructor knowing the file stream
Definition: WPSOLE1Parser.cpp:109
shared_ptr< WPSOLE1ParserInternal::State > m_state
a smart ptr used to stored the file data
Definition: WPSOLE1Parser.h:90
an OLE Zone
Definition: WPSOLE1Parser.cpp:48
bool updateZoneNames(WPSOLE1ParserInternal::OLEZone &zone) const
try to update the zone name
Definition: WPSOLE1Parser.cpp:357

Generated on Sat Jul 29 2017 15:32:22 for libwps by doxygen 1.8.8