diff options
author | Roberto C. Sanchez <roberto@connexer.com> | 2014-05-12 08:21:30 -0400 |
---|---|---|
committer | Roberto C. Sanchez <roberto@connexer.com> | 2014-05-12 08:21:30 -0400 |
commit | 7a00574163029c0c2b649878c95d5acbd083564a (patch) | |
tree | c13cc5736025834df2874ed87ee8598070025ea6 /include/thmlxhtml.h | |
parent | b745315323de9f27538edac9453205ca70e6186e (diff) |
Imported Upstream version 1.7.2+dfsg
Diffstat (limited to 'include/thmlxhtml.h')
-rw-r--r-- | include/thmlxhtml.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/include/thmlxhtml.h b/include/thmlxhtml.h new file mode 100644 index 0000000..b0b5ef3 --- /dev/null +++ b/include/thmlxhtml.h @@ -0,0 +1,60 @@ +/****************************************************************************** + * + * thmlxhtml.h - Implementation of ThMLXHTML + * + * $Id: thmlxhtml.h 2833 2013-06-29 06:40:28Z chrislit $ + * + * Copyright 2011-2013 CrossWire Bible Society (http://www.crosswire.org) + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + */ + +#ifndef _THMLXHTML_H +#define _THMLXHTML_H + +#include <swbasicfilter.h> +#include <utilxml.h> + +SWORD_NAMESPACE_START + +/** this filter converts ThML text to classed XHTML + */ +class SWDLLEXPORT ThMLXHTML : public SWBasicFilter { + SWBuf imgPrefix; + bool renderNoteNumbers; +protected: + class MyUserData : public BasicFilterUserData { + public: + MyUserData(const SWModule *module, const SWKey *key);//: BasicFilterUserData(module, key) {} + bool inscriptRef; + bool SecHead; + bool BiblicalText; + SWBuf version; + XMLTag startTag; + }; + virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) { + return new MyUserData(module, key); + } + virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData); +public: + ThMLXHTML(); + virtual const char *getImagePrefix() { return imgPrefix.c_str(); } + virtual void setImagePrefix(const char *newImgPrefix) { imgPrefix = newImgPrefix; } + virtual const char *getHeader() const; + void setRenderNoteNumbers(bool val = true) { renderNoteNumbers = val; } +}; + +SWORD_NAMESPACE_END + +#endif |