FWGraph.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 FullWrite Text document ( graphic part )
*
*/
#ifndef FW_GRAPH
# define FW_GRAPH
#include <string>
#include <vector>
#include <libwpd/libwpd.h>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "FWStruct.hxx"
namespace FWGraphInternal
{
struct SideBar;
struct State;
class SubDocument;
}
class FWParser;
class FWGraph
{
friend class FWParser;
friend class FWGraphInternal::SubDocument;
public:
FWGraph(FWParser &parser);
virtual ~FWGraph();
int version() const;
int numPages() const;
protected:
void flushExtra();
bool sendPageGraphics();
bool getBorder(int bId, FWStruct::Border &border) const;
//
// Intermediate level
//
// interface with main parser
bool send(int fileId);
//
// low level
//
bool readBorderDocInfo(FWStruct::EntryPtr zone);
shared_ptr<FWStruct::ZoneHeader> readSideBar
(FWStruct::EntryPtr zone, FWStruct::ZoneHeader const &doc);
bool readSideBarPosition(FWStruct::EntryPtr zone, FWGraphInternal::SideBar &frame);
bool readSideBarFormat(FWStruct::EntryPtr zone, FWGraphInternal::SideBar &frame);
bool readSideBarUnknown(FWStruct::EntryPtr zone, FWGraphInternal::SideBar &frame);
bool sendSideBar(FWGraphInternal::SideBar const &frame);
bool readGraphic(FWStruct::EntryPtr zone);
bool sendGraphic(int fId);
bool sendGraphic(FWStruct::EntryPtr zone);
shared_ptr<FWStruct::ZoneHeader> readGraphicData
(FWStruct::EntryPtr zone, FWStruct::ZoneHeader &doc);
private:
FWGraph(FWGraph const &orig);
FWGraph &operator=(FWGraph const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<FWGraphInternal::State> m_state;
FWParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
FWGraph::sendSideBar
bool sendSideBar(FWGraphInternal::SideBar const &frame)
try to send a sidebar
Definition: FWGraph.cxx:511
FWStruct::EntryPtr
shared_ptr< Entry > EntryPtr
Definition: FWStruct.hxx:135
FWGraph
the main class to read the graphic part of a FullWrite Text file
Definition: FWGraph.hxx:67
FWParser
the main class to read a FullWrite file
Definition: FWParser.hxx:66
FWGraph::readGraphicData
shared_ptr< FWStruct::ZoneHeader > readGraphicData(FWStruct::EntryPtr zone, FWStruct::ZoneHeader &doc)
try to read the graphic data
Definition: FWGraph.cxx:543
FWStruct.hxx
libmwaw_internal.hxx
FWGraph::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: FWGraph.hxx:140
FWStruct::ZoneHeader
a structure used to store the data of a zone header in a FullWrite file
Definition: FWStruct.hxx:138
FWGraph::readSideBarFormat
bool readSideBarFormat(FWStruct::EntryPtr zone, FWGraphInternal::SideBar &frame)
try to read the sidebar second zone
Definition: FWGraph.cxx:403
FWGraph::readBorderDocInfo
bool readBorderDocInfo(FWStruct::EntryPtr zone)
try to read the border definiton (at the end of doc info)
Definition: FWGraph.cxx:205
FWGraph::m_mainParser
FWParser * m_mainParser
the main parser;
Definition: FWGraph.hxx:146
FWGraph::readSideBarUnknown
bool readSideBarUnknown(FWStruct::EntryPtr zone, FWGraphInternal::SideBar &frame)
try to read the sidebar third zone
Definition: FWGraph.cxx:464
FWGraphInternal::SideBar
Internal: the sidebar of a FWGraph.
Definition: FWGraph.cxx:58
FWGraph::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: FWGraph.cxx:776
FWGraph::numPages
int numPages() const
returns the number of pages
Definition: FWGraph.cxx:163
FWGraph::readSideBar
shared_ptr< FWStruct::ZoneHeader > readSideBar(FWStruct::EntryPtr zone, FWStruct::ZoneHeader const &doc)
try to read a sidebar data (zone 13 or zone 14)
Definition: FWGraph.cxx:257
FWGraph::m_state
shared_ptr< FWGraphInternal::State > m_state
the state
Definition: FWGraph.hxx:143
MWAWInputStream.hxx
MWAWDebug.hxx
FWGraph::sendPageGraphics
bool sendPageGraphics()
try to send the page graphic
Definition: FWGraph.cxx:764
FWStruct::Border
Internal: class to store a border which appear in docInfo.
Definition: FWStruct.hxx:60
FWGraph::operator=
FWGraph & operator=(FWGraph const &orig)
FWGraph::readSideBarPosition
bool readSideBarPosition(FWStruct::EntryPtr zone, FWGraphInternal::SideBar &frame)
try to read the sidebar position zone
Definition: FWGraph.cxx:336
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
FWGraph::getBorder
bool getBorder(int bId, FWStruct::Border &border) const
try to return a border corresponding to an id
Definition: FWGraph.cxx:177
FWGraphInternal::SubDocument
Internal: the subdocument of a FWGraph.
Definition: FWGraph.cxx:91
FWGraph::version
int version() const
returns the file version
Definition: FWGraph.cxx:156
FWGraph::sendGraphic
bool sendGraphic(int fId)
send a graphic knowing the graphic fileId
Definition: FWGraph.cxx:680
FWGraph::FWGraph
FWGraph(FWParser &parser)
constructor
Definition: FWGraph.cxx:146
FWGraph::~FWGraph
virtual ~FWGraph()
destructor
Definition: FWGraph.cxx:152
FWGraph::readGraphic
bool readGraphic(FWStruct::EntryPtr zone)
check if a zone is a graphic zone
Definition: FWGraph.cxx:621
FWGraph::send
bool send(int fileId)
try to send the child of a zone
Definition: FWGraph.cxx:188