1 /****************************************************************************** 2 * 3 * thmlxhtml.h - Implementation of ThMLXHTML 4 * 5 * $Id: thmlxhtml.h 3548 2017-12-10 05:11:38Z scribe $ 6 * 7 * Copyright 2011-2013 CrossWire Bible Society (http://www.crosswire.org) 8 * CrossWire Bible Society 9 * P. O. Box 2528 10 * Tempe, AZ 85280-2528 11 * 12 * This program is free software; you can redistribute it and/or modify it 13 * under the terms of the GNU General Public License as published by the 14 * Free Software Foundation version 2. 15 * 16 * This program is distributed in the hope that it will be useful, but 17 * WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * General Public License for more details. 20 * 21 */ 22 23 #ifndef _THMLXHTML_H 24 #define _THMLXHTML_H 25 26 #include <swbasicfilter.h> 27 #include <utilxml.h> 28 29 SWORD_NAMESPACE_START 30 31 /** this filter converts ThML text to classed XHTML 32 */ 33 class SWDLLEXPORT ThMLXHTML : public SWBasicFilter { 34 SWBuf imgPrefix; 35 bool renderNoteNumbers; 36 protected: 37 class MyUserData : public BasicFilterUserData { 38 public: 39 MyUserData(const SWModule *module, const SWKey *key);//: BasicFilterUserData(module, key) {} 40 bool inscriptRef; 41 char secHeadLevel; 42 bool isBiblicalText; 43 SWBuf version; 44 XMLTag startTag; 45 }; createUserData(const SWModule * module,const SWKey * key)46 virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) { 47 return new MyUserData(module, key); 48 } 49 virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData); 50 public: 51 ThMLXHTML(); getImagePrefix()52 virtual const char *getImagePrefix() { return imgPrefix.c_str(); } setImagePrefix(const char * newImgPrefix)53 virtual void setImagePrefix(const char *newImgPrefix) { imgPrefix = newImgPrefix; } 54 virtual const char *getHeader() const; 55 void setRenderNoteNumbers(bool val = true) { renderNoteNumbers = val; } 56 }; 57 58 SWORD_NAMESPACE_END 59 60 #endif 61