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>
64 for (
int i=0; i < 4; i++)
m_values[i] = 0;
70 if (h.
m_n) o <<
"N=" << h.
m_n <<
",";
71 if (h.
m_id) o <<
"zId=" << std::hex << h.
m_id << std::dec <<
",";
72 bool toPrint[4]= {
true,
true,
true,
true};
75 toPrint[0]=toPrint[1]=
false;
77 toPrint[0]=toPrint[2]=
false;
81 for (
int i=0; i < 4; i++)
82 if (toPrint[i] && h.
m_values[i]) o <<
"h" << i <<
"=" << h.
m_values[i] <<
",";
120 void parse(librevenge::RVNGTextInterface *documentInterface);
127 void createDocument(librevenge::RVNGTextInterface *documentInterface);
176 bool readZoneWithHeader(
MWAWEntry const &entry);
188 shared_ptr<HanMacWrdJParserInternal::State>
m_state;
bool sendZone(long zId)
send a zone
Definition: HanMacWrdJParser.cxx:195
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)
checks if the document header is correct (or not)
Definition: HanMacWrdJParser.cxx:1033
void init()
inits all internal variables
Definition: HanMacWrdJParser.cxx:171
virtual class which defines the ancestor of all text zone parser
Definition: MWAWParser.hxx:296
bool readZone(MWAWEntry &entry)
try to read a generic zone
Definition: HanMacWrdJParser.cxx:506
shared_ptr< HanMacWrdJParserInternal::State > m_state
the state
Definition: HanMacWrdJParser.hxx:188
shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:519
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:137
void setPageSpan(const int pageSpan)
set the page span ( default 1)
Definition: MWAWPageSpan.hxx:262
long getId() const
returns the subdocument id
Definition: HanMacWrdJParser.cxx:118
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:127
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:785
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:221
bool isParsed() const
a flag to know if the entry was parsed or not
Definition: MWAWEntry.hxx:110
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:205
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:153
void setMarginBottom(const double marginBottom)
set the page bottom margin
Definition: MWAWPageSpan.hxx:202
the class to store a color
Definition: libmwaw_internal.hxx:182
long m_id
the subdocument id
Definition: HanMacWrdJParser.cxx:133
bool readZoneB(MWAWEntry const &entry)
try to read the zone B
Definition: HanMacWrdJParser.cxx:802
void newPage(int number)
adds a new page
Definition: HanMacWrdJParser.cxx:219
State()
constructor
Definition: HanMacWrdJParser.cxx:68
shared_ptr< HanMacWrdJText > m_textParser
the text parser
Definition: HanMacWrdJParser.hxx:194
void setMarginLeft(const double marginLeft)
set the page left margin
Definition: MWAWPageSpan.hxx:187
SubDocument(HanMacWrdJParser &pars, MWAWInputStreamPtr input, long zoneId)
Definition: HanMacWrdJParser.cxx:95
bool readClassicHeader(HanMacWrdJZoneHeader &header, long endPos=-1)
try to read a header of classic zone
Definition: HanMacWrdJParser.cxx:232
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:291
void setParsed(bool ok=true) const
sets the flag m_parsed to true or false
Definition: MWAWEntry.hxx:115
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:185
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
std::vector< int > m_zonesIdList
an internal flag, used to know the actual id of a zone
Definition: HanMacWrdJParser.cxx:79
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:190
void setFormLength(const double formLength)
set the total page length
Definition: MWAWPageSpan.hxx:172
the main class to read the text part of HanMac Word-J file
Definition: HanMacWrdJText.hxx:63
SubDocumentType
Definition: libmwaw_internal.hxx:178
int m_numPages
the number of page of the final document
Definition: HanMacWrdJParser.cxx:81
void reset()
writes the current file and reset to zero
Definition: MWAWDebug.hxx:85
Internal: the state of a HanMacWrdJParser.
Definition: HanMacWrdJParser.cxx:66
void setTextListener(MWAWTextListenerPtr &listener)
sets the text listener
Definition: MWAWParser.cxx:146
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:105
MWAWVec2f getPageLeftTop() const
returns the page left top point ( in inches)
Definition: HanMacWrdJParser.cxx:210
the main class to read a HanMac Word-J file
Definition: HanMacWrdJParser.hxx:105
T y() const
second element
Definition: libmwaw_internal.hxx:620
void setFormWidth(const double formWidth)
set the total page width
Definition: MWAWPageSpan.hxx:177
bool readZonesList()
try to read the zones list
Definition: HanMacWrdJParser.cxx:460
T x() const
first element
Definition: libmwaw_internal.hxx:615
Internal: the subdocument of a HanMacWrdJParser.
Definition: HanMacWrdJParser.cxx:93
int m_actPage
the actual page
Definition: HanMacWrdJParser.cxx:81
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:142
void setBegin(long off)
sets the begin offset
Definition: MWAWEntry.hxx:56
virtual ~HanMacWrdJParser()
destructor
Definition: HanMacWrdJParser.cxx:167
long length() const
returns the length of the zone
Definition: MWAWEntry.hxx:82
@ DOC_HEADER_FOOTER
Definition: libmwaw_internal.hxx:178
int m_footerHeight
the footer height if known
Definition: HanMacWrdJParser.cxx:83
@ PageBreak
Definition: MWAWListener.hxx:58
bool readHeaderEnd()
try to read a unknown zone, just after the header (simillar to HanMacWrd Zoneb)
Definition: HanMacWrdJParser.cxx:882
Definition: libmwaw_internal.hxx:142
long begin() const
returns the begin offset
Definition: MWAWEntry.hxx:72
void setLength(long l)
sets the zone size
Definition: MWAWEntry.hxx:61
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:85
bool createZones()
finds the different objects zones in a Hapanese File
Definition: HanMacWrdJParser.cxx:334
friend class HanMacWrdJText
Definition: HanMacWrdJParser.hxx:107
HanMacWrdJParser(MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
constructor
Definition: HanMacWrdJParser.cxx:161
virtual bool operator==(MWAWSubDocument const &doc) const
operator!==
Definition: HanMacWrdJParser.cxx:112
int m_headerHeight
the header height if known
Definition: HanMacWrdJParser.cxx:82
bool readPrintInfo(MWAWEntry const &entry)
try to read a printinfo zone
Definition: HanMacWrdJParser.cxx:599
void setId(int newId)
sets the id
Definition: MWAWEntry.hxx:158
void parse(librevenge::RVNGTextInterface *documentInterface)
virtual function used to parse the input
Definition: HanMacWrdJParser.cxx:256
void setMarginTop(const double marginTop)
set the page top margin
Definition: MWAWPageSpan.hxx:197
bool read(MWAWInputStreamPtr input)
reads the struture in a file
Definition: MWAWPrinter.cxx:218
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
shared_ptr< HanMacWrdJGraph > m_graphParser
the graph parser
Definition: HanMacWrdJParser.hxx:191
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:503
long end() const
returns the end offset
Definition: MWAWEntry.hxx:77
virtual bool operator!=(MWAWSubDocument const &doc) const
operator!=
Definition: HanMacWrdJParser.cxx:102
MWAWInputStreamPtr & getInput()
returns the actual input
Definition: MWAWParser.hxx:123
bool decodeZone(MWAWEntry const &entry, librevenge::RVNGBinaryData &data)
try to decode a zone
Definition: HanMacWrdJParser.cxx:1166
std::map< long, MWAWEntry > m_zonesMap
a map of entry: filepos->zone
Definition: HanMacWrdJParser.cxx:77
bool getColor(int colId, int patternId, MWAWColor &color) const
returns the color associated with a pattern
Definition: HanMacWrdJParser.cxx:202
MWAWParser * m_parser
the main zone parser
Definition: MWAWSubDocument.hxx:75
virtual ~SubDocument()
destructor
Definition: HanMacWrdJParser.cxx:99
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
void setStream(MWAWInputStreamPtr ip)
resets the input
Definition: MWAWDebug.hxx:73
void setMarginRight(const double marginRight)
set the page right margin
Definition: MWAWPageSpan.hxx:192
bool valid() const
returns true if the zone length is positive
Definition: MWAWEntry.hxx:88
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:513
PrinterRect page() const
returns the page rectangle
Definition: MWAWPrinter.cxx:201
void setHeaderFooter(MWAWHeaderFooter const &headerFooter)
add a header/footer on some page
Definition: MWAWPageSpan.cxx:223
long m_footerId
the footer text zone id or 0
Definition: HanMacWrdJParser.cxx:87
void setId(long vid)
sets the subdocument id
Definition: HanMacWrdJParser.cxx:123
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:66
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type)
the parser function
Definition: HanMacWrdJParser.cxx:136
void setMargins(double margin, int wh=libmwaw::LeftBit|libmwaw::RightBit|libmwaw::TopBit|libmwaw::BottomBit)
set all the margins
Definition: MWAWPageSpan.hxx:207
bool checkEntry(MWAWEntry &entry)
look in entry.begin() to see if a entry exists at this position, if so fills entry....
Definition: HanMacWrdJParser.cxx:419
friend class HanMacWrdJGraph
Definition: HanMacWrdJParser.hxx:106
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:781
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:505
long m_zonesListBegin
the list of zone begin
Definition: HanMacWrdJParser.cxx:75
shared_ptr< MWAWInputStream > m_input
the input
Definition: MWAWSubDocument.hxx:77
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:96
void resetTextListener()
resets the listener
Definition: MWAWParser.cxx:151
bool readZoneA(MWAWEntry const &entry)
try to read the zone A ( a big zone containing 5 sub zone ? )
Definition: HanMacWrdJParser.cxx:702
Generated on Wed Jun 17 2020 06:30:10 for libmwaw by
doxygen 1.8.18