1 /****************************************************************************** 2 * 3 * gbfhtmlhref.h - Implementation of GBFHTMLHREF 4 * 5 * $Id: gbfhtmlhref.h 2833 2013-06-29 06:40:28Z chrislit $ 6 * 7 * Copyright 2001-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 GBFHTMLHREF_H 24 #define GBFHTMLHREF_H 25 26 #include <swbasicfilter.h> 27 28 SWORD_NAMESPACE_START 29 30 /** this filter converts GBF text to HTML text with hrefs 31 */ 32 class SWDLLEXPORT GBFHTMLHREF : public SWBasicFilter { 33 bool renderNoteNumbers; 34 protected: 35 class MyUserData : public BasicFilterUserData { 36 public: 37 MyUserData(const SWModule *module, const SWKey *key); 38 bool hasFootnotePreTag; 39 SWBuf version; 40 }; createUserData(const SWModule * module,const SWKey * key)41 virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) { 42 return new MyUserData(module, key); 43 } 44 virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData); 45 public: 46 GBFHTMLHREF(); 47 void setRenderNoteNumbers(bool val = true) { renderNoteNumbers = val; } 48 }; 49 50 SWORD_NAMESPACE_END 51 #endif 52