BibleTime
|
Text rendering based on trees. More...
#include <ctextrendering.h>
Classes | |
class | KeyTreeItem |
Public Types | |
using | KeyTree = std::list< KeyTreeItem > |
Public Member Functions | |
CTextRendering (bool addText) | |
CTextRendering (bool addText, DisplayOptions const &displayOptions, FilterOptions const &filterOptions) | |
DisplayOptions const & | displayOptions () const noexcept |
FilterOptions const & | filterOptions () const noexcept |
QString | renderKeyRange (CSwordVerseKey const &lowerBound, CSwordVerseKey const &upperBound, const BtConstModuleList &modules, const QString &hightlightKey=QString(), const KeyTreeItem::Settings &settings=KeyTreeItem::Settings()) |
QString | renderKeyTree (KeyTree const &tree) const |
QString | renderSingleKey (const QString &key, const BtConstModuleList &modules, const KeyTreeItem::Settings &settings=KeyTreeItem::Settings()) |
void | setDisplayOptions (DisplayOptions const &displayOptions) noexcept |
void | setFilterOptions (FilterOptions const &filterOptions) noexcept |
virtual | ~CTextRendering () |
Protected Member Functions | |
virtual QString | entryLink (KeyTreeItem const &item, CSwordModuleInfo const &module) const |
virtual QString | finishText (QString const &text, KeyTree const &tree) const |
virtual QString | renderEntry (KeyTreeItem const &item, CSwordKey *key=nullptr) const |
Static Protected Member Functions | |
static BtConstModuleList | collectModules (KeyTree const &tree) |
Protected Attributes | |
bool const | m_addText |
DisplayOptions | m_displayOptions |
FilterOptions | m_filterOptions |
Text rendering based on trees.
CTextRendering is BibleTime's place where the actual rendering takes place. It provides several methods to convert an abstract tree of items into a string of html.
Definition at line 34 of file ctextrendering.h.
using Rendering::CTextRendering::KeyTree = std::list<KeyTreeItem> |
Definition at line 40 of file ctextrendering.h.
CTextRendering::CTextRendering | ( | bool | addText | ) |
Definition at line 135 of file ctextrendering.cpp.
CTextRendering::CTextRendering | ( | bool | addText, |
DisplayOptions const & | displayOptions, | ||
FilterOptions const & | filterOptions | ||
) |
Definition at line 141 of file ctextrendering.cpp.
|
virtualdefault |
|
staticprotected |
Definition at line 152 of file ctextrendering.cpp.
Referenced by finishText(), Rendering::CDisplayRendering::finishText(), BtPrinter::finishText(), renderEntry(), and renderKeyTree().
|
inlinenoexcept |
Definition at line 134 of file ctextrendering.h.
References m_displayOptions.
Referenced by BtModuleTextModel::bookData(), BtModuleTextModel::setDisplayOptions(), setDisplayOptions(), and BtModuleTextModel::verseData().
|
protectedvirtual |
Reimplemented in BtPrinter, Rendering::CrossRefRendering, and Rendering::CDisplayRendering.
Definition at line 477 of file ctextrendering.cpp.
References Rendering::CTextRendering::KeyTreeItem::key().
Referenced by renderEntry().
|
inlinenoexcept |
Definition at line 126 of file ctextrendering.h.
References m_filterOptions.
Referenced by setFilterOptions(), and BtModuleTextModel::setFilterOptions().
|
protectedvirtual |
Reimplemented in BtPrinter, Rendering::CrossRefRendering, Rendering::CPlainTextExportRendering, and Rendering::CDisplayRendering.
Definition at line 455 of file ctextrendering.cpp.
References CDisplayTemplateMgr::activeTemplateName(), collectModules(), CDisplayTemplateMgr::fillTemplate(), CDisplayTemplateMgr::instance(), CDisplayTemplateMgr::Settings::langAbbrev, CSwordModuleInfo::language(), CDisplayTemplateMgr::Settings::modules, CSwordModuleInfo::textDirection(), and CDisplayTemplateMgr::Settings::textDirection.
Referenced by renderKeyTree().
|
protectedvirtual |
Reimplemented in Rendering::CPlainTextExportRendering, and BtPrinter.
Definition at line 239 of file ctextrendering.cpp.
References BT_ASSERT, Rendering::CTextRendering::KeyTreeItem::childList(), collectModules(), entryLink(), Rendering::CTextRendering::KeyTreeItem::getAlternativeContent(), Rendering::CTextRendering::KeyTreeItem::hasAlternativeContent(), FilterOptions::headings, Rendering::CTextRendering::KeyTreeItem::Settings::highlight, CSwordKey::isValid(), Rendering::CTextRendering::KeyTreeItem::key(), CSwordKey::key(), DisplayOptions::lineBreaks, m_addText, m_displayOptions, m_filterOptions, Rendering::CTextRendering::KeyTreeItem::modules(), CSwordKey::renderedText(), CSwordVerseKey::setIndex(), CSwordVerseKey::setIntros(), CSwordKey::setKey(), Rendering::CTextRendering::KeyTreeItem::setMappedKey(), CSwordKey::setModule(), and Rendering::CTextRendering::KeyTreeItem::settings().
Referenced by renderKeyTree().
QString CTextRendering::renderKeyRange | ( | CSwordVerseKey const & | lowerBound, |
CSwordVerseKey const & | upperBound, | ||
const BtConstModuleList & | modules, | ||
const QString & | hightlightKey = QString() , |
||
const KeyTreeItem::Settings & | settings = KeyTreeItem::Settings() |
||
) |
Definition at line 187 of file ctextrendering.cpp.
References BT_ASSERT, Rendering::CTextRendering::KeyTreeItem::Settings::highlight, CSwordVerseKey::key(), renderKeyTree(), and renderSingleKey().
Referenced by BtQmlInterface::copyVerseRange(), and Search::BtSearchResultArea::updatePreview().
QString CTextRendering::renderKeyTree | ( | KeyTree const & | tree | ) | const |
Definition at line 163 of file ctextrendering.cpp.
References collectModules(), finishText(), CSwordBackend::instance(), m_filterOptions, renderEntry(), and CSwordBackend::setFilterOptions().
Referenced by anonymous_namespace{btinforendering.cpp}::decodeCrossReference(), BtPrinter::printKeyTree(), Rendering::CDisplayRendering::renderDisplayEntry(), renderKeyRange(), renderSingleKey(), and CDisplaySettingsPage::updateStylePreview().
QString CTextRendering::renderSingleKey | ( | const QString & | key, |
const BtConstModuleList & | modules, | ||
const KeyTreeItem::Settings & | settings = KeyTreeItem::Settings() |
||
) |
Definition at line 229 of file ctextrendering.cpp.
References renderKeyTree().
Referenced by Search::anonymous_namespace{cmoduleresultview.cpp}::populateStrongsResultList(), renderKeyRange(), and Search::BtSearchResultArea::updatePreview().
|
inlinenoexcept |
Definition at line 137 of file ctextrendering.h.
References displayOptions(), and m_displayOptions.
Referenced by BtQmlInterface::copyVerseRange(), and BtModuleTextModel::setDisplayOptions().
|
inlinenoexcept |
Definition at line 129 of file ctextrendering.h.
References filterOptions(), and m_filterOptions.
Referenced by BtQmlInterface::copyVerseRange(), and BtModuleTextModel::setFilterOptions().
|
protected |
Definition at line 170 of file ctextrendering.h.
Referenced by renderEntry(), and Rendering::CPlainTextExportRendering::renderEntry().
|
protected |
Definition at line 168 of file ctextrendering.h.
Referenced by displayOptions(), renderEntry(), and setDisplayOptions().
|
protected |
Definition at line 169 of file ctextrendering.h.
Referenced by filterOptions(), renderEntry(), renderKeyTree(), and setFilterOptions().