FullWrtGraph.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 
34 /*
35  * Parser to FullWrite Text document ( graphic part )
36  *
37  */
38 #ifndef FULL_WRT_GRAPH
39 # define FULL_WRT_GRAPH
40 
41 #include <string>
42 #include <vector>
43 
44 #include <librevenge/librevenge.h>
45 
46 #include "libmwaw_internal.hxx"
47 
48 #include "MWAWDebug.hxx"
49 #include "MWAWInputStream.hxx"
50 
51 #include "FullWrtStruct.hxx"
52 
53 namespace FullWrtGraphInternal
54 {
55 struct SideBar;
56 struct State;
57 class SubDocument;
58 }
59 
60 class FullWrtParser;
61 
68 {
69  friend class FullWrtParser;
71 
72 public:
74  explicit FullWrtGraph(FullWrtParser &parser);
76  virtual ~FullWrtGraph();
77 
79  int version() const;
80 
82  int numPages() const;
83 
84 protected:
86  void flushExtra();
87 
89  bool sendPageGraphics();
90 
92  bool getBorder(int bId, FullWrtStruct::Border &border) const;
93 
94  //
95  // Intermediate level
96  //
97 
98  // interface with main parser
99 
101  bool send(int fileId, MWAWColor const &fontColor);
102 
103  //
104  // low level
105  //
106 
109 
111  shared_ptr<FullWrtStruct::ZoneHeader> readSideBar
120  bool sendSideBar(FullWrtGraphInternal::SideBar const &frame);
124  bool sendGraphic(int fId);
127 
129  shared_ptr<FullWrtStruct::ZoneHeader> readGraphicData
131 private:
134 
135 protected:
136  //
137  // data
138  //
141 
143  shared_ptr<FullWrtGraphInternal::State> m_state;
144 
147 };
148 #endif
149 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
FullWrtGraphInternal::SubDocument::operator=
SubDocument & operator=(SubDocument const &orig)
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
MWAWPict::ReadResult
ReadResult
an enum to defined the result of a parsing use by some picture's classes which can read their data
Definition: MWAWPict.hxx:73
MWAWTextListenerPtr
shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:519
FullWrtGraph::m_state
shared_ptr< FullWrtGraphInternal::State > m_state
the state
Definition: FullWrtGraph.hxx:143
FullWrtGraphInternal::SideBar::m_box
MWAWBox2f m_box
the position (in point)
Definition: FullWrtGraph.cxx:66
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:127
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:785
FullWrtGraphInternal::SideBar::m_page
int m_page
the page
Definition: FullWrtGraph.cxx:68
libmwaw::DebugFile::addDelimiter
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
FullWrtStruct
a namespace use to define common structure in a FullWrite file
Definition: FullWrtStruct.cxx:44
FullWrtGraph::~FullWrtGraph
virtual ~FullWrtGraph()
destructor
Definition: FullWrtGraph.cxx:166
FullWrtStruct::ZoneHeader::m_type
int m_type
the zone type
Definition: FullWrtStruct.hxx:160
MWAWPosition::setRelativePosition
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:221
MWAWPosition::setPage
void setPage(int pg) const
sets the page
Definition: MWAWPosition.hxx:189
MWAWPosition::WBackground
@ WBackground
Definition: MWAWPosition.hxx:53
FullWrtStruct::ZoneHeader::m_fileId
int m_fileId
the file id
Definition: FullWrtStruct.hxx:164
FullWrtGraphInternal::SubDocument::m_id
int m_id
the zone file id
Definition: FullWrtGraph.cxx:123
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:182
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:425
FullWrtStruct::ZoneHeader::ZoneHeader
ZoneHeader()
constructor
Definition: FullWrtStruct.hxx:152
FullWrtStruct::Border
Internal: class to store a border which appear in docInfo.
Definition: FullWrtStruct.hxx:60
FullWrtGraph::sendGraphic
bool sendGraphic(int fId)
send a graphic knowing the graphic fileId
Definition: FullWrtGraph.cxx:693
MWAWPosition::WDynamic
@ WDynamic
Definition: MWAWPosition.hxx:53
FullWrtGraphInternal::SubDocument::SubDocument
SubDocument(FullWrtGraph &pars, int id, MWAWColor fontColor)
constructor
Definition: FullWrtGraph.cxx:102
FullWrtGraphInternal::SubDocument::operator==
virtual bool operator==(MWAWSubDocument const &doc) const
operator!==
Definition: FullWrtGraph.cxx:111
FullWrtGraph::readGraphicData
shared_ptr< FullWrtStruct::ZoneHeader > readGraphicData(FullWrtStruct::EntryPtr zone, FullWrtStruct::ZoneHeader &doc)
try to read the graphic data
Definition: FullWrtGraph.cxx:554
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:509
FullWrtGraph::readSideBarUnknown
bool readSideBarUnknown(FullWrtStruct::EntryPtr zone, FullWrtGraphInternal::SideBar &frame)
try to read the sidebar third zone
Definition: FullWrtGraph.cxx:481
libmwaw::DebugFile::addNote
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
MWAWSubDocument
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:42
FullWrtGraphInternal::SubDocument
Internal: the subdocument of a FullWrtGraph.
Definition: FullWrtGraph.cxx:99
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
FullWrtGraph::readSideBarPosition
bool readSideBarPosition(FullWrtStruct::EntryPtr zone, FullWrtGraphInternal::SideBar &frame)
try to read the sidebar position zone
Definition: FullWrtGraph.cxx:352
FullWrtGraphInternal
Internal: the structures of a FullWrtGraph.
Definition: FullWrtGraph.cxx:55
MWAWPosition::setNaturalSize
void setNaturalSize(MWAWVec2f const &naturalSz)
sets the natural size (if known)
Definition: MWAWPosition.hxx:204
FullWrtGraphInternal::SideBar
Internal: the sidebar of a FullWrtGraph.
Definition: FullWrtGraph.cxx:58
MWAWSubDocument.hxx
FullWrtGraph::sendSideBar
bool sendSideBar(FullWrtGraphInternal::SideBar const &frame)
try to send a sidebar
Definition: FullWrtGraph.cxx:528
FullWrtGraphInternal::State::m_sidebarList
std::vector< shared_ptr< SideBar > > m_sidebarList
the sidebar list
Definition: FullWrtGraph.cxx:88
FullWrtParser::getDocumentTypeName
std::string getDocumentTypeName(int zId) const
returns a the type of a document zone ( mainly used for debugging)
Definition: FullWrtParser.cxx:348
MWAWPictData::check
static ReadResult check(MWAWInputStreamPtr input, int size, MWAWBox2f &box)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:100
libmwaw::SubDocumentType
SubDocumentType
Definition: libmwaw_internal.hxx:178
libmwaw::DebugFile::reset
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:85
FullWrtParser
the main class to read a FullWrite file
Definition: FullWrtParser.hxx:67
libmwaw::DebugFile::skipZone
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:105
MWAWVec2::y
T y() const
second element
Definition: libmwaw_internal.hxx:620
libmwaw::Debug::dumpFile
bool dumpFile(librevenge::RVNGBinaryData &data, char const *fileName)
a debug function to store in a datafile in the current directory WARNING: this function erase the fil...
Definition: MWAWDebug.cxx:197
libmwaw_internal.hxx
MWAWPosition.hxx
MWAWVec2::x
T x() const
first element
Definition: libmwaw_internal.hxx:615
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
FullWrtParser.hxx
MWAWPosition::m_wrapping
Wrapping m_wrapping
Wrapping.
Definition: MWAWPosition.hxx:262
MWAWPictData.hxx
FullWrtGraphInternal::SideBar::~SideBar
~SideBar()
destructor
Definition: FullWrtGraph.cxx:75
MWAWPict::MWAW_R_BAD
@ MWAW_R_BAD
Definition: MWAWPict.hxx:73
MWAWVec2< float >
MWAWDebug.hxx
FullWrtGraph::readSideBar
shared_ptr< FullWrtStruct::ZoneHeader > readSideBar(FullWrtStruct::EntryPtr zone, FullWrtStruct::ZoneHeader const &doc)
try to read a sidebar data (zone 13 or zone 14)
Definition: FullWrtGraph.cxx:271
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1134
FullWrtStruct::ZoneHeader
a structure used to store the data of a zone header in a FullWrite file
Definition: FullWrtStruct.hxx:150
FullWrtGraph::readGraphic
bool readGraphic(FullWrtStruct::EntryPtr zone)
check if a zone is a graphic zone
Definition: FullWrtGraph.cxx:634
FullWrtGraphInternal::State
Internal: the state of a FullWrtGraph.
Definition: FullWrtGraph.cxx:81
FullWrtGraphInternal::State::m_numPages
int m_numPages
Definition: FullWrtGraph.cxx:93
MWAWPosition::Char
@ Char
Definition: MWAWPosition.hxx:51
FullWrtGraphInternal::SideBar::m_parsed
bool m_parsed
a flag to know if the sidebar is send to the listener
Definition: FullWrtGraph.cxx:72
FullWrtGraphInternal::SubDocument::parse
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type)
the parser function
Definition: FullWrtGraph.cxx:132
FullWrtGraph::operator=
FullWrtGraph & operator=(FullWrtGraph const &orig)
FullWrtGraphInternal::SideBar::SideBar
SideBar(FullWrtStruct::ZoneHeader const &header)
constructor
Definition: FullWrtGraph.cxx:60
FullWrtGraphInternal::SubDocument::SubDocument
SubDocument(SubDocument const &orig)
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:503
FullWrtGraph::readSideBarFormat
bool readSideBarFormat(FullWrtStruct::EntryPtr zone, FullWrtGraphInternal::SideBar &frame)
try to read the sidebar second zone
Definition: FullWrtGraph.cxx:420
FullWrtGraph::m_mainParser
FullWrtParser * m_mainParser
the main parser;
Definition: FullWrtGraph.hxx:146
FullWrtStruct::Border::m_frontColor
MWAWColor m_frontColor
the front color (used for layout )
Definition: FullWrtStruct.hxx:89
FullWrtStruct::Border::read
bool read(shared_ptr< FullWrtStruct::Entry > zone, int fSz)
try to read a border definiton
Definition: FullWrtStruct.cxx:142
FullWrtGraphInternal::State::m_graphicMap
std::multimap< int, FullWrtStruct::EntryPtr > m_graphicMap
zoneId -> graphic entry
Definition: FullWrtGraph.cxx:90
FullWrtParser::getPageLeftTop
MWAWVec2f getPageLeftTop() const
returns the page left top point ( in inches)
Definition: FullWrtParser.cxx:332
FullWrtStruct::Border::addTo
void addTo(MWAWGraphicStyle &style) const
add to frame properties
Definition: FullWrtStruct.cxx:127
FullWrtGraph::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: FullWrtGraph.cxx:789
MWAWTextListener.hxx
FullWrtGraph::send
bool send(int fileId, MWAWColor const &fontColor)
try to send the child of a zone
Definition: FullWrtGraph.cxx:202
FullWrtGraph.hxx
FullWrtGraphInternal::SubDocument::m_graphParser
FullWrtGraph * m_graphParser
the graph parser
Definition: FullWrtGraph.cxx:121
FullWrtGraphInternal::State::State
State()
constructor
Definition: FullWrtGraph.cxx:83
MWAWPosition::Page
@ Page
Definition: MWAWPosition.hxx:51
FullWrtStruct::ZoneHeader::m_wrapping
int m_wrapping
the wrapping type
Definition: FullWrtStruct.hxx:166
libmwaw::DebugFile::addPos
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
FullWrtStruct::ZoneHeader::read
bool read(shared_ptr< FullWrtStruct::Entry > zone)
try to read the data header of a classical zone
Definition: FullWrtStruct.cxx:413
FullWrtGraph::readBorderDocInfo
bool readBorderDocInfo(FullWrtStruct::EntryPtr zone)
try to read the border definiton (at the end of doc info)
Definition: FullWrtGraph.cxx:219
FullWrtGraphInternal::State::m_borderList
std::vector< FullWrtStruct::Border > m_borderList
a list of border
Definition: FullWrtGraph.cxx:92
MWAWBox2::size
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:1008
FullWrtGraph::FullWrtGraph
FullWrtGraph(FullWrtParser &parser)
constructor
Definition: FullWrtGraph.cxx:160
libmwaw::DebugFile
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:66
FullWrtGraph::numPages
int numPages() const
returns the number of pages
Definition: FullWrtGraph.cxx:177
FullWrtGraphInternal::State::m_version
int m_version
the file version
Definition: FullWrtGraph.cxx:86
MWAWInputStream.hxx
FullWrtStruct.hxx
FullWrtGraphInternal::SubDocument::m_fontColor
MWAWColor m_fontColor
the default font color
Definition: FullWrtGraph.cxx:125
MWAWSubDocumentPtr
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:517
MWAWBox2< float >
FullWrtGraphInternal::SubDocument::~SubDocument
virtual ~SubDocument()
destructor
Definition: FullWrtGraph.cxx:106
FullWrtGraph::FullWrtGraph
FullWrtGraph(FullWrtGraph const &orig)
FullWrtGraphInternal::SideBar::m_borderId
int m_borderId
the border id
Definition: FullWrtGraph.cxx:70
FullWrtGraph::sendPageGraphics
bool sendPageGraphics()
try to send the page graphic
Definition: FullWrtGraph.cxx:777
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:781
libmwaw::DebugStream
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
MWAWListenerPtr
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:505
FullWrtStruct::EntryPtr
shared_ptr< Entry > EntryPtr
Definition: FullWrtStruct.hxx:147
MWAWPictData::get
static MWAWPictData * get(MWAWInputStreamPtr input, int size)
checks if the data pointed by input is known
Definition: MWAWPictData.hxx:108
FullWrtGraph::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: FullWrtGraph.hxx:140
FullWrtGraphInternal::SubDocument::operator!=
virtual bool operator!=(MWAWSubDocument const &doc) const
operator!=
Definition: FullWrtGraph.cxx:145
FullWrtGraph::getBorder
bool getBorder(int bId, FullWrtStruct::Border &border) const
try to return a border corresponding to an id
Definition: FullWrtGraph.cxx:191
FullWrtGraph::version
int version() const
returns the file version
Definition: FullWrtGraph.cxx:170
FullWrtGraph
the main class to read the graphic part of a FullWrite Text file
Definition: FullWrtGraph.hxx:68
FullWrtParser::send
bool send(int fileId, MWAWColor fontColor=MWAWColor::black())
ask the text parser to send a zone
Definition: FullWrtParser.cxx:370

Generated on Wed Jun 17 2020 06:30:09 for libmwaw by doxygen 1.8.18