1 /****************************************************************************** 2 * 3 * thmlrtf.h - Implementation of ThMLRTF 4 * 5 * $Id: thmlrtf.h 3548 2017-12-10 05:11:38Z scribe $ 6 * 7 * Copyright 1999-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 THMLRTF_H 24 #define THMLRTF_H 25 26 #include <swbasicfilter.h> 27 #include <utilxml.h> 28 29 SWORD_NAMESPACE_START 30 31 /** this filter converts ThML text to RTF text 32 */ 33 class SWDLLEXPORT ThMLRTF : public SWBasicFilter { 34 protected: 35 class MyUserData : public BasicFilterUserData { 36 public: 37 MyUserData(const SWModule *module, const SWKey *key); 38 bool inSecHead; 39 SWBuf version; 40 bool isBiblicalText; 41 XMLTag startTag; 42 }; createUserData(const SWModule * module,const SWKey * key)43 virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) { 44 return new MyUserData(module, key); 45 } 46 virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData); 47 virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0); 48 public: 49 ThMLRTF(); 50 }; 51 52 SWORD_NAMESPACE_END 53 #endif 54