Go to the documentation of this file.
37 #ifndef HAN_MAC_WRD_J_PARSER
38 # define HAN_MAC_WRD_J_PARSER
44 #include <librevenge/librevenge.h>
75 if (h.
m_n) o <<
"N=" << h.
m_n <<
",";
76 if (h.
m_id) o <<
"zId=" << std::hex << h.
m_id << std::dec <<
",";
77 bool toPrint[4]= {
true,
true,
true,
true};
80 toPrint[0]=toPrint[1]=
false;
82 toPrint[0]=toPrint[2]=
false;
86 for (
int i=0; i < 4; i++)
87 if (toPrint[i] && h.
m_values[i]) o <<
"h" << i <<
"=" << h.
m_values[i] <<
",";
181 bool readZoneWithHeader(
MWAWEntry const &entry);
193 std::shared_ptr<HanMacWrdJParserInternal::State>
m_state;
std::shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:567
bool sendZone(long zId)
send a zone
Definition: HanMacWrdJParser.cxx:200
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
MWAWVec2i size() const
returns the size
Definition: MWAWPrinter.hxx:56
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: HanMacWrdJParser.cxx:1036
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
void init()
inits all internal variables
Definition: HanMacWrdJParser.cxx:176
virtual class which defines the ancestor of all text zone parser
Definition: MWAWParser.hxx:299
bool readZone(MWAWEntry &entry)
try to read a generic zone
Definition: HanMacWrdJParser.cxx:509
MWAWVec2i pos(int i) const
returns the position ( 0: leftTop, 1:rightBottom )
Definition: MWAWPrinter.hxx:61
void setName(std::string const &nam)
sets the name of the entry
Definition: MWAWEntry.hxx:148
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:268
long getId() const
returns the subdocument id
Definition: HanMacWrdJParser.cxx:120
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
void setRelativePosition(AnchorTo anchor, XPos X=XLeft, YPos Y=YTop)
sets the relative position
Definition: MWAWPosition.hxx:237
bool isParsed() const
a flag to know if the entry was parsed or not
Definition: MWAWEntry.hxx:121
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:65
the main class to read the graphic part of a HanMac Word-J file
Definition: HanMacWrdJGraph.hxx:79
PrinterRect paper() const
returns the paper rectangle
Definition: MWAWPrinter.cxx:222
bool open(std::string const &filename)
opens/creates a file to store a result
Definition: MWAWDebug.cxx:46
int id() const
returns the id
Definition: MWAWEntry.hxx:164
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:208
the class to store a color
Definition: libmwaw_internal.hxx:192
long m_id
the subdocument id
Definition: HanMacWrdJParser.cxx:135
bool readZoneB(MWAWEntry const &entry)
try to read the zone B
Definition: HanMacWrdJParser.cxx:805
void newPage(int number)
adds a new page
Definition: HanMacWrdJParser.cxx:224
State()
constructor
Definition: HanMacWrdJParser.cxx:68
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:193
bool readClassicHeader(HanMacWrdJZoneHeader &header, long endPos=-1)
try to read a header of classic zone
Definition: HanMacWrdJParser.cxx:237
the AppleŠ printer information : TPrint
Definition: MWAWPrinter.hxx:82
void createDocument(librevenge::RVNGTextInterface *documentInterface)
creates the listener which will be associated to the document
Definition: HanMacWrdJParser.cxx:296
void setParsed(bool ok=true) const
sets the flag m_parsed to true or false
Definition: MWAWEntry.hxx:126
MWAWTextListenerPtr & getTextListener()
returns the text listener
Definition: MWAWParser.hxx:145
bool sendText(long id, long cPos, MWAWListenerPtr listener=MWAWListenerPtr())
send a text zone
Definition: HanMacWrdJParser.cxx:190
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:42
libmwaw::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: MWAWParser.hxx:195
Defines MWAWCell (cell content and format)
std::vector< int > m_zonesIdList
an internal flag, used to know the actual id of a zone
Definition: HanMacWrdJParser.cxx:86
std::string const & asciiName() const
return the ascii file name
Definition: MWAWParser.hxx:232
bool canSendTextAsGraphic(long id, long cPos)
check if we can send a textzone as graphic
Definition: HanMacWrdJParser.cxx:195
void parse(librevenge::RVNGTextInterface *documentInterface) final
virtual function used to parse the input
Definition: HanMacWrdJParser.cxx:261
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:178
the main class to read the text part of HanMac Word-J file
Definition: HanMacWrdJText.hxx:63
SubDocumentType
Definition: libmwaw_internal.hxx:188
std::shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
int m_numPages
the number of page of the final document
Definition: HanMacWrdJParser.cxx:88
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:93
Internal: the state of a HanMacWrdJParser.
Definition: HanMacWrdJParser.cxx:66
void setTextListener(MWAWTextListenerPtr &listener)
sets the text listener
Definition: MWAWParser.cxx:158
void setAsciiName(char const *name)
Debugging: change the default ascii file.
Definition: MWAWParser.hxx:227
void skipZone(long beginPos, long endPos)
skips the file zone defined by beginPos-endPos
Definition: MWAWDebug.hxx:113
MWAWVec2f getPageLeftTop() const
returns the page left top point ( in inches)
Definition: HanMacWrdJParser.cxx:215
the main class to read a HanMac Word-J file
Definition: HanMacWrdJParser.hxx:110
T y() const
second element
Definition: libmwaw_internal.hxx:673
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:183
bool readZonesList()
try to read the zones list
Definition: HanMacWrdJParser.cxx:463
T x() const
first element
Definition: libmwaw_internal.hxx:668
Internal: the subdocument of a HanMacWrdJParser.
Definition: HanMacWrdJParser.cxx:100
int m_actPage
the actual page
Definition: HanMacWrdJParser.cxx:88
Class to define the position of an object (textbox, picture, ..) in the document.
Definition: MWAWPosition.hxx:48
@ MWAW_T_HANMACWORDJ
HanMac Word-J (v2.0.4)
Definition: MWAWDocument.hxx:117
std::string const & name() const
name of the entry
Definition: MWAWEntry.hxx:153
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:67
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:561
long length() const
returns the length of the zone
Definition: MWAWEntry.hxx:93
@ DOC_HEADER_FOOTER
Definition: libmwaw_internal.hxx:188
int m_footerHeight
the footer height if known
Definition: HanMacWrdJParser.cxx:90
@ PageBreak
Definition: MWAWListener.hxx:58
bool readHeaderEnd()
try to read a unknown zone, just after the header (simillar to HanMacWrd Zoneb)
Definition: HanMacWrdJParser.cxx:885
void setStream(MWAWInputStreamPtr const &ip)
resets the input
Definition: MWAWDebug.hxx:81
Definition: libmwaw_internal.hxx:144
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:83
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:72
MWAWPageSpan const & getPageSpan() const
returns the actual page dimension
Definition: MWAWParser.hxx:160
long m_headerId
the header text zone id or 0
Definition: HanMacWrdJParser.cxx:92
bool createZones()
finds the different objects zones in a Hapanese File
Definition: HanMacWrdJParser.cxx:339
friend class HanMacWrdJText
Definition: HanMacWrdJParser.hxx:112
int m_headerHeight
the header height if known
Definition: HanMacWrdJParser.cxx:89
bool readPrintInfo(MWAWEntry const &entry)
try to read a printinfo zone
Definition: HanMacWrdJParser.cxx:602
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:169
void setMarginTop(const double marginTop)
set the page top margin
Definition: MWAWPageSpan.hxx:203
bool read(MWAWInputStreamPtr input)
reads the struture in a file
Definition: MWAWPrinter.cxx:235
Internal: the structures of a HanMacWrdJParser.
Definition: HanMacWrdJParser.cxx:63
@ Char
Definition: MWAWPosition.hxx:51
MWAWParserStatePtr getParserState()
returns the parser state
Definition: MWAWParser.hxx:113
long end() const
returns the end offset
Definition: MWAWEntry.hxx:88
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type) final
the parser function
Definition: HanMacWrdJParser.cxx:138
SubDocument(HanMacWrdJParser &pars, MWAWInputStreamPtr const &input, long zoneId)
Definition: HanMacWrdJParser.cxx:102
~HanMacWrdJParser() final
destructor
Definition: HanMacWrdJParser.cxx:172
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
HanMacWrdJParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: HanMacWrdJParser.cxx:163
Defines MWAWTextListener: the libmwaw word processor listener.
bool decodeZone(MWAWEntry const &entry, librevenge::RVNGBinaryData &data)
try to decode a zone
Definition: HanMacWrdJParser.cxx:1168
std::map< long, MWAWEntry > m_zonesMap
a map of entry: filepos->zone
Definition: HanMacWrdJParser.cxx:84
bool getColor(int colId, int patternId, MWAWColor &color) const
returns the color associated with a pattern
Definition: HanMacWrdJParser.cxx:207
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
bool operator!=(MWAWSubDocument const &doc) const final
operator!=
Definition: HanMacWrdJParser.cxx:110
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:198
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:99
PrinterRect page() const
returns the page rectangle
Definition: MWAWPrinter.cxx:218
void setHeaderFooter(MWAWHeaderFooter const &headerFooter)
add a header/footer on some page
Definition: MWAWPageSpan.cxx:227
std::shared_ptr< HanMacWrdJGraph > m_graphParser
the graph parser
Definition: HanMacWrdJParser.hxx:196
long m_footerId
the footer text zone id or 0
Definition: HanMacWrdJParser.cxx:94
std::shared_ptr< HanMacWrdJParserInternal::State > m_state
the state
Definition: HanMacWrdJParser.hxx:193
void setId(long vid)
sets the subdocument id
Definition: HanMacWrdJParser.cxx:125
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:66
std::shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:553
Definition: MWAWDocument.hxx:57
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:213
bool checkEntry(MWAWEntry &entry)
look in entry.begin() to see if a entry exists at this position, if so fills entry....
Definition: HanMacWrdJParser.cxx:421
friend class HanMacWrdJGraph
Definition: HanMacWrdJParser.hxx:111
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:838
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
std::shared_ptr< HanMacWrdJText > m_textParser
the text parser
Definition: HanMacWrdJParser.hxx:199
long m_zonesListBegin
the list of zone begin
Definition: HanMacWrdJParser.cxx:82
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:99
void resetTextListener()
resets the listener
Definition: MWAWParser.cxx:163
bool readZoneA(MWAWEntry const &entry)
try to read the zone A ( a big zone containing 5 sub zone ? )
Definition: HanMacWrdJParser.cxx:705
~SubDocument() final
destructor
Definition: HanMacWrdJParser.cxx:107
Generated on Fri Sep 18 2020 18:14:52 for libmwaw by
doxygen 1.8.20