BibleTime
thmltohtml.h
Go to the documentation of this file.
1/*********
2*
3* In the name of the Father, and of the Son, and of the Holy Spirit.
4*
5* This file is part of BibleTime's source code, https://bibletime.info/
6*
7* Copyright 1999-2026 by the BibleTime developers.
8* The BibleTime source code is licensed under the GNU General Public License
9* version 2.0.
10*
11**********/
12
13#pragma once
14
15#include <optional>
16#include <QString>
17
18// Sword includes:
19#ifdef __GNUC__
20#pragma GCC diagnostic push
21#pragma GCC diagnostic ignored "-Wextra-semi"
22#pragma GCC diagnostic ignored "-Wsuggest-override"
23#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
24#endif
25#ifdef __clang__
26#pragma clang diagnostic push
27#pragma clang diagnostic ignored "-Wsuggest-destructor-override"
28#endif
29#include <swbuf.h>
30#include <thmlhtml.h>
31#ifdef __clang__
32#pragma clang diagnostic pop
33#endif
34#ifdef __GNUC__
35#pragma GCC diagnostic pop
36#endif
37
38
39namespace Filters {
40
41/**
42 \brief ThML to HTML conversion filter.
43*/
44class ThmlToHtml: public sword::ThMLHTML {
45 protected: // types:
47 public:
48 UserData(sword::SWModule const * module,
49 sword::SWKey const * key)
50 : sword::ThMLHTML::MyUserData(module, key),
51 inscriptRef(false), inFootnoteTag(false),
52 swordFootnote(1) {}
53
54 std::optional<QString> absolutePath;
57 unsigned short int swordFootnote;
58 };
59
60 public: // methods:
62
63 bool handleToken(sword::SWBuf &buf,
64 const char *token,
65 sword::BasicFilterUserData *userData) override;
66
67 char processText(sword::SWBuf &buf,
68 const sword::SWKey *key,
69 const sword::SWModule *module = nullptr) override;
70
71 protected: // methods:
72
73 sword::BasicFilterUserData * createUserData(
74 sword::SWModule const * module,
75 sword::SWKey const * key) override
76 { return new UserData(module, key); }
77};
78
79} // namespace Filters
std::optional< QString > absolutePath
Definition thmltohtml.h:54
UserData(sword::SWModule const *module, sword::SWKey const *key)
Definition thmltohtml.h:48
unsigned short int swordFootnote
Definition thmltohtml.h:57
ThML to HTML conversion filter.
Definition thmltohtml.h:44
sword::BasicFilterUserData * createUserData(sword::SWModule const *module, sword::SWKey const *key) override
Definition thmltohtml.h:73
bool handleToken(sword::SWBuf &buf, const char *token, sword::BasicFilterUserData *userData) override
char processText(sword::SWBuf &buf, const sword::SWKey *key, const sword::SWModule *module=nullptr) override