ClarisDrawParser.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
#ifndef CLARISDRAW_PARSER
# define CLARISDRAW_PARSER
#include <string>
#include <vector>
#include <librevenge/librevenge.h>
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
#include "ClarisWksStruct.hxx"
namespace ClarisDrawParserInternal
{
struct State;
class SubDocument;
}
class ClarisDrawGraph;
class ClarisDrawText;
class ClarisDrawStyleManager;
class ClarisDrawParser final : public MWAWGraphicParser
{
friend class ClarisDrawGraph;
friend class ClarisDrawText;
public:
ClarisDrawParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
~ClarisDrawParser() final;
bool checkHeader(MWAWHeader *header, bool strict=false) final;
void parse(librevenge::RVNGDrawingInterface *documentInterface) final;
int getFileType(int zoneId) const;
MWAWVec2f getPageLeftTop();
bool sendTextZone(int number, int subZone=-1);
protected:
void init();
void createDocument(librevenge::RVNGDrawingInterface *documentInterface);
protected:
bool createZones();
bool readZone();
// Intermediate level
bool readDocHeader();
bool readLibraryHeader();
std::shared_ptr<ClarisWksStruct::DSET> readDSET(bool isLibHeader=false);
bool readPrintInfo();
bool readDocInfo();
bool readLayouts();
bool readLibraryNames();
//
// low level
//
protected:
//
// data
//
std::shared_ptr<ClarisDrawParserInternal::State> m_state;
std::shared_ptr<ClarisDrawStyleManager> m_styleManager;
std::shared_ptr<ClarisDrawGraph> m_graphParser;
std::shared_ptr<ClarisDrawText> m_textParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
ClarisWksStruct.hxx
MWAWDebug.hxx
MWAWInputStream.hxx
MWAWParser.hxx
ClarisDrawGraph
the main class to read the graphic part of ClarisDraw file
Definition ClarisDrawGraph.hxx:76
ClarisDrawParser::m_graphParser
std::shared_ptr< ClarisDrawGraph > m_graphParser
the graph parser
Definition ClarisDrawParser.hxx:131
ClarisDrawParser::init
void init()
inits all internal variables
Definition ClarisDrawParser.cxx:153
ClarisDrawParser::ClarisDrawText
friend class ClarisDrawText
Definition ClarisDrawParser.hxx:66
ClarisDrawParser::ClarisDrawParser
ClarisDrawParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition ClarisDrawParser.cxx:139
ClarisDrawParser::getFileType
int getFileType(int zoneId) const
returns the file type corresponding to a zone id
Definition ClarisDrawParser.cxx:166
ClarisDrawParser::readDSET
std::shared_ptr< ClarisWksStruct::DSET > readDSET(bool isLibHeader=false)
try to read a DSET structure
Definition ClarisDrawParser.cxx:1452
ClarisDrawParser::getPageLeftTop
MWAWVec2f getPageLeftTop()
returns the page left top point ( in inches)
Definition ClarisDrawParser.cxx:180
ClarisDrawParser::parse
void parse(librevenge::RVNGDrawingInterface *documentInterface) final
the main parse function
Definition ClarisDrawParser.cxx:189
ClarisDrawParser::createZones
bool createZones()
finds the different objects zones
Definition ClarisDrawParser.cxx:321
ClarisDrawParser::readZone
bool readZone()
try to read a zone
Definition ClarisDrawParser.cxx:360
ClarisDrawParser::createDocument
void createDocument(librevenge::RVNGDrawingInterface *documentInterface)
creates the listener which will be associated to the document
Definition ClarisDrawParser.cxx:254
ClarisDrawParser::m_state
std::shared_ptr< ClarisDrawParserInternal::State > m_state
the state
Definition ClarisDrawParser.hxx:127
ClarisDrawParser::readPrintInfo
bool readPrintInfo()
try to read the print info zone
Definition ClarisDrawParser.cxx:1393
ClarisDrawParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition ClarisDrawParser.cxx:1094
ClarisDrawParser::ClarisDrawGraph
friend class ClarisDrawGraph
Definition ClarisDrawParser.hxx:65
ClarisDrawParser::readDocInfo
bool readDocInfo()
try to read the document info zone
Definition ClarisDrawParser.cxx:1347
ClarisDrawParser::m_textParser
std::shared_ptr< ClarisDrawText > m_textParser
the text parser
Definition ClarisDrawParser.hxx:133
ClarisDrawParser::readLibraryHeader
bool readLibraryHeader()
try to read the library header
Definition ClarisDrawParser.cxx:816
ClarisDrawParser::readLibraryNames
bool readLibraryNames()
try to read the library names(two zone)
Definition ClarisDrawParser.cxx:1230
ClarisDrawParser::readDocHeader
bool readDocHeader()
try to read a document header
Definition ClarisDrawParser.cxx:401
ClarisDrawParser::readLayouts
bool readLayouts()
try to read the layout
Definition ClarisDrawParser.cxx:1133
ClarisDrawParser::sendTextZone
bool sendTextZone(int number, int subZone=-1)
sends a text zone
Definition ClarisDrawParser.cxx:175
ClarisDrawParser::m_styleManager
std::shared_ptr< ClarisDrawStyleManager > m_styleManager
the style manager
Definition ClarisDrawParser.hxx:129
ClarisDrawParser::~ClarisDrawParser
~ClarisDrawParser() final
destructor
Definition ClarisDrawParser.cxx:149
ClarisDrawStyleManager
the main class to read a ClarisDraw style
Definition ClarisDrawStyleManager.hxx:60
ClarisDrawText
the main class to read the text part of ClarisDraw file
Definition ClarisDrawText.hxx:73
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
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition libmwaw_internal.hxx:842
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
ClarisDrawParserInternal
Internal: the structures of a ClarisDrawParser.
Definition ClarisDrawParser.cxx:63
ClarisWksStruct
namespace to store the main structure which appears in a ClarisDraw/ClarisWorks file
Definition ClarisWksStruct.cxx:50
librevenge
Definition MWAWDocument.hxx:57
ClarisDrawParserInternal::State
Internal: the state of a ClarisDrawParser.
Definition ClarisDrawParser.cxx:83