1 2 // Copied from coolreader-3.2.49 (crengine/src/hyphman.cpp) 3 4 #ifndef MY_HYPHPATTERNREADER_H 5 #define MY_HYPHPATTERNREADER_H 6 7 #include "lvxml.h" 8 #include "lvstring.h" 9 #include "lvstring32collection.h" 10 11 class MyHyphPatternReader : public LVXMLParserCallback 12 { 13 protected: 14 bool insidePatternTag; 15 lString32Collection & data; 16 public: 17 MyHyphPatternReader(lString32Collection & result); 18 /// called on parsing end OnStop()19 virtual void OnStop() { } 20 /// called on opening tag end OnTagBody()21 virtual void OnTagBody() {} 22 /// called on opening tag 23 virtual ldomNode * OnTagOpen( const lChar32 * nsname, const lChar32 * tagname); 24 /// called on closing 25 virtual void OnTagClose( const lChar32 * nsname, const lChar32 * tagname, bool self_closing_tag=false ); 26 /// called on element attribute OnAttribute(const lChar32 * nsname,const lChar32 * attrname,const lChar32 * attrvalue)27 virtual void OnAttribute( const lChar32 * nsname, const lChar32 * attrname, const lChar32 * attrvalue ) 28 { 29 CR_UNUSED3(nsname, attrname, attrvalue); 30 } 31 /// called on text 32 virtual void OnText( const lChar32 * text, int len, lUInt32 flags ); 33 /// add named BLOB data to document OnBlob(lString32 name,const lUInt8 * data,int size)34 virtual bool OnBlob(lString32 name, const lUInt8 * data, int size) { 35 CR_UNUSED3(name, data, size); 36 return false; 37 } 38 }; 39 40 #endif // MY_HYPHPATTERNREADER_H 41