LWGraph.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.
*/
/*
* Parser to LightWay Text document ( graphic part )
*
*/
#ifndef LW_GRAPH
# define LW_GRAPH
#include <string>
#include <vector>
#include <libwpd/libwpd.h>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
namespace LWGraphInternal
{
struct State;
}
class LWParser;
class LWGraph
{
friend class LWParser;
public:
LWGraph(LWParser &parser);
virtual ~LWGraph();
int version() const;
int numPages() const;
protected:
bool createZones();
void flushExtra();
bool sendPageGraphics();
void send(int id);
//
// Intermediate level
//
bool sendJPEG(MWAWEntry const &entry);
bool sendPICT(MWAWEntry const &entry);
//
// low level
//
static bool findJPEGSize(WPXBinaryData const &data, Vec2i &sz);
private:
LWGraph(LWGraph const &orig);
LWGraph &operator=(LWGraph const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<LWGraphInternal::State> m_state;
LWParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
LWGraph
the main class to read the graphic part of a LightWay Text file
Definition: LWGraph.hxx:63
libmwaw_internal.hxx
LWGraph::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: LWGraph.cxx:283
LWGraph::numPages
int numPages() const
returns the number of pages
Definition: LWGraph.cxx:90
LWGraph::m_state
shared_ptr< LWGraphInternal::State > m_state
the state
Definition: LWGraph.hxx:121
LWGraph::findJPEGSize
static bool findJPEGSize(WPXBinaryData const &data, Vec2i &sz)
try to find a JPEG size
Definition: LWGraph.cxx:219
LWGraph::sendPICT
bool sendPICT(MWAWEntry const &entry)
try to send a PICT resource
Definition: LWGraph.cxx:141
LWGraph::send
void send(int id)
try to send a graph
Definition: LWGraph.cxx:265
LWGraph::sendPageGraphics
bool sendPageGraphics()
try to send the page graphic
Definition: LWGraph.cxx:278
LWGraph::~LWGraph
virtual ~LWGraph()
destructor
Definition: LWGraph.cxx:82
LWGraph::sendJPEG
bool sendJPEG(MWAWEntry const &entry)
try to send a JPEG resource
Definition: LWGraph.cxx:173
LWParser
the main class to read a LightWay Text file
Definition: LWParser.hxx:58
LWGraph::LWGraph
LWGraph(LWParser &parser)
constructor
Definition: LWGraph.cxx:76
LWGraph::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: LWGraph.hxx:118
LWGraph::version
int version() const
returns the file version
Definition: LWGraph.cxx:85
MWAWInputStream.hxx
MWAWDebug.hxx
LWGraph::operator=
LWGraph & operator=(LWGraph const &orig)
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
Vec2< int >
LWGraph::createZones
bool createZones()
finds the different graphic zones
Definition: LWGraph.cxx:102
LWGraph::m_mainParser
LWParser * m_mainParser
the main parser;
Definition: LWGraph.hxx:124