HMWKGraph.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 HanMac Word text document ( graphic part )
*
*/
#ifndef HMWK_GRAPH
# define HMWK_GRAPH
#include <map>
#include <string>
#include <vector>
#include <libwpd/libwpd.h>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
namespace HMWKGraphInternal
{
struct Frame;
struct BasicGraph;
struct FootnoteFrame;
struct Group;
struct PictureFrame;
struct Table;
struct TableCell;
struct TextBox;
struct Picture;
struct State;
class SubDocument;
}
struct HMWKZone;
class HMWKParser;
class HMWKGraph
{
friend class HMWKParser;
friend class HMWKGraphInternal::SubDocument;
friend struct HMWKGraphInternal::Table;
public:
HMWKGraph(HMWKParser &parser);
virtual ~HMWKGraph();
int version() const;
int numPages() const;
protected:
bool getColor(int colId, int patternId, MWAWColor &color) const;
bool sendPageGraphics(std::vector<long> const &doNotSendIds);
void flushExtra();
//
// Intermediate level
//
bool readFrames(shared_ptr<HMWKZone> zone);
bool readPicture(shared_ptr<HMWKZone> zone);
// interface with mainParser
bool sendFrame(long frameId, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
bool sendPicture(long pictId, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
bool sendText(long textId, long id);
std::map<long,int> getTextFrameInformations() const;
//
// low level
//
bool sendPicture(HMWKGraphInternal::Picture const &picture, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
bool sendFrame(HMWKGraphInternal::Frame const &frame, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
bool sendBasicGraph(HMWKGraphInternal::BasicGraph const &pict, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
bool sendPictureFrame(HMWKGraphInternal::PictureFrame const &pict, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
bool sendEmptyPicture(MWAWPosition pos);
bool sendTextBox(HMWKGraphInternal::TextBox const &textbox, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList());
bool sendTableUnformatted(long fId);
shared_ptr<HMWKGraphInternal::BasicGraph> readBasicGraph(shared_ptr<HMWKZone> zone, HMWKGraphInternal::Frame const &header);
shared_ptr<HMWKGraphInternal::FootnoteFrame> readFootnoteFrame(shared_ptr<HMWKZone> zone, HMWKGraphInternal::Frame const &header);
shared_ptr<HMWKGraphInternal::Group> readGroup(shared_ptr<HMWKZone> zone, HMWKGraphInternal::Frame const &header);
shared_ptr<HMWKGraphInternal::PictureFrame> readPictureFrame(shared_ptr<HMWKZone> zone, HMWKGraphInternal::Frame const &header);
shared_ptr<HMWKGraphInternal::Table> readTable(shared_ptr<HMWKZone> zone, HMWKGraphInternal::Frame const &header);
shared_ptr<HMWKGraphInternal::TextBox> readTextBox(shared_ptr<HMWKZone> zone, HMWKGraphInternal::Frame const &header, bool isMemo);
private:
HMWKGraph(HMWKGraph const &orig);
HMWKGraph &operator=(HMWKGraph const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<HMWKGraphInternal::State> m_state;
HMWKParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
HMWKParser
the main class to read a HanMac Word-K file
Definition: HMWKParser.hxx:173
HMWKGraph::sendTextBox
bool sendTextBox(HMWKGraphInternal::TextBox const &textbox, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList())
try to send a textbox to the listener
Definition: HMWKGraph.cxx:1208
HMWKGraph::m_mainParser
HMWKParser * m_mainParser
the main parser;
Definition: HMWKGraph.hxx:181
HMWKGraph::readFrames
bool readFrames(shared_ptr< HMWKZone > zone)
try to read the frame definition (type 2)
Definition: HMWKGraph.cxx:868
libmwaw_internal.hxx
HMWKGraph::sendTableUnformatted
bool sendTableUnformatted(long fId)
try to send a table unformatted
Definition: HMWKGraph.cxx:1374
HMWKGraph::m_state
shared_ptr< HMWKGraphInternal::State > m_state
the state
Definition: HMWKGraph.hxx:178
HMWKGraph::getColor
bool getColor(int colId, int patternId, MWAWColor &color) const
returns the color associated with a pattern
Definition: HMWKGraph.cxx:778
HMWKGraph::version
int version() const
returns the file version
Definition: HMWKGraph.cxx:773
HMWKGraphInternal::BasicGraph
Internal: the geometrical graph of a HMWKGraph.
Definition: HMWKGraph.cxx:181
HMWKGraph::sendPicture
bool sendPicture(long pictId, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList())
try to send a picture to the listener
Definition: HMWKGraph.cxx:1027
HMWKGraph::sendPageGraphics
bool sendPageGraphics(std::vector< long > const &doNotSendIds)
try to send the page graphic
Definition: HMWKGraph.cxx:1851
HMWKGraphInternal::Picture
Internal: the picture of a HMWKGraph.
Definition: HMWKGraph.cxx:524
HMWKGraph
the main class to read the graphic part of a HanMac Word file
Definition: HMWKGraph.hxx:77
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:161
HMWKZone
Small class used to store the decoded zone of HMWKParser.
Definition: HMWKParser.hxx:58
HMWKGraph::~HMWKGraph
virtual ~HMWKGraph()
destructor
Definition: HMWKGraph.cxx:770
HMWKGraph::sendText
bool sendText(long textId, long id)
ask main parser to send a text zone
Definition: HMWKGraph.cxx:811
HMWKGraph::readFootnoteFrame
shared_ptr< HMWKGraphInternal::FootnoteFrame > readFootnoteFrame(shared_ptr< HMWKZone > zone, HMWKGraphInternal::Frame const &header)
try to read the footnote data
Definition: HMWKGraph.cxx:1607
HMWKGraph::readBasicGraph
shared_ptr< HMWKGraphInternal::BasicGraph > readBasicGraph(shared_ptr< HMWKZone > zone, HMWKGraphInternal::Frame const &header)
try to read the basic graph data
Definition: HMWKGraph.cxx:1393
HMWKGraph::readGroup
shared_ptr< HMWKGraphInternal::Group > readGroup(shared_ptr< HMWKZone > zone, HMWKGraphInternal::Frame const &header)
try to read the group data
Definition: HMWKGraph.cxx:1525
HMWKGraph::readPicture
bool readPicture(shared_ptr< HMWKZone > zone)
try to read a picture zone (type d)
Definition: HMWKGraph.cxx:971
HMWKGraphInternal::SubDocument
Internal: the subdocument of a HMWKGraph.
Definition: HMWKGraph.cxx:672
HMWKGraphInternal::TextBox
Internal: the textbox of a HMWKGraph.
Definition: HMWKGraph.cxx:468
HMWKGraph::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: HMWKGraph.cxx:1871
HMWKGraph::sendEmptyPicture
bool sendEmptyPicture(MWAWPosition pos)
try to send an empty picture
Definition: HMWKGraph.cxx:1168
HMWKGraph::readTextBox
shared_ptr< HMWKGraphInternal::TextBox > readTextBox(shared_ptr< HMWKZone > zone, HMWKGraphInternal::Frame const &header, bool isMemo)
try to read the textbox data
Definition: HMWKGraph.cxx:1643
HMWKGraph::operator=
HMWKGraph & operator=(HMWKGraph const &orig)
HMWKGraph::sendPictureFrame
bool sendPictureFrame(HMWKGraphInternal::PictureFrame const &pict, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList())
try to send a picture frame
Definition: HMWKGraph.cxx:1194
MWAWInputStream.hxx
MWAWDebug.hxx
HMWKGraph::readTable
shared_ptr< HMWKGraphInternal::Table > readTable(shared_ptr< HMWKZone > zone, HMWKGraphInternal::Frame const &header)
try to read the table data
Definition: HMWKGraph.cxx:1681
HMWKGraph::getTextFrameInformations
std::map< long, int > getTextFrameInformations() const
return a list textZId -> type which 3(footnote), 4(textbox), 9(table), 10(comment) ...
Definition: HMWKGraph.cxx:816
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
HMWKGraph::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: HMWKGraph.hxx:175
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
HMWKGraph::readPictureFrame
shared_ptr< HMWKGraphInternal::PictureFrame > readPictureFrame(shared_ptr< HMWKZone > zone, HMWKGraphInternal::Frame const &header)
try to read the picture data
Definition: HMWKGraph.cxx:1563
HMWKGraphInternal::Frame
Internal: the frame header of a HMWKGraph.
Definition: HMWKGraph.cxx:65
HMWKGraph::sendFrame
bool sendFrame(long frameId, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList())
try to send a frame to the listener
Definition: HMWKGraph.cxx:1072
HMWKGraphInternal::PictureFrame
Internal: the picture of a HMWKGraph.
Definition: HMWKGraph.cxx:338
HMWKGraph::sendBasicGraph
bool sendBasicGraph(HMWKGraphInternal::BasicGraph const &pict, MWAWPosition pos, WPXPropertyList extras=WPXPropertyList())
try to send a basic picture to the listener
Definition: HMWKGraph.cxx:1255
HMWKGraphInternal::Table
Internal: the table of a HMWKGraph.
Definition: HMWKGraph.cxx:412
HMWKGraph::numPages
int numPages() const
returns the number of pages
Definition: HMWKGraph.cxx:793
HMWKGraph::HMWKGraph
HMWKGraph(HMWKParser &parser)
constructor
Definition: HMWKGraph.cxx:764