BibleTime
Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Rendering::CTextRendering Class Reference

Text rendering based on trees. More...

#include <ctextrendering.h>

Inheritance diagram for Rendering::CTextRendering:

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
 

Detailed Description

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.

Author
The BibleTime team

Definition at line 34 of file ctextrendering.h.

Member Typedef Documentation

◆ KeyTree

Definition at line 40 of file ctextrendering.h.

Constructor & Destructor Documentation

◆ CTextRendering() [1/2]

CTextRendering::CTextRendering ( bool  addText)

Definition at line 135 of file ctextrendering.cpp.

◆ CTextRendering() [2/2]

CTextRendering::CTextRendering ( bool  addText,
DisplayOptions const &  displayOptions,
FilterOptions const &  filterOptions 
)

Definition at line 141 of file ctextrendering.cpp.

◆ ~CTextRendering()

CTextRendering::~CTextRendering ( )
virtualdefault

Member Function Documentation

◆ collectModules()

BtConstModuleList CTextRendering::collectModules ( KeyTree const &  tree)
staticprotected

◆ displayOptions()

DisplayOptions const& Rendering::CTextRendering::displayOptions ( ) const
inlinenoexcept

◆ entryLink()

QString CTextRendering::entryLink ( KeyTreeItem const &  item,
CSwordModuleInfo const &  module 
) const
protectedvirtual

◆ filterOptions()

FilterOptions const& Rendering::CTextRendering::filterOptions ( ) const
inlinenoexcept

Definition at line 126 of file ctextrendering.h.

References m_filterOptions.

Referenced by setFilterOptions(), and BtModuleTextModel::setFilterOptions().

◆ finishText()

QString CTextRendering::finishText ( QString const &  text,
KeyTree const &  tree 
) const
protectedvirtual

◆ renderEntry()

QString CTextRendering::renderEntry ( KeyTreeItem const &  item,
CSwordKey key = nullptr 
) const
protectedvirtual

◆ renderKeyRange()

QString CTextRendering::renderKeyRange ( CSwordVerseKey const &  lowerBound,
CSwordVerseKey const &  upperBound,
const BtConstModuleList modules,
const QString &  hightlightKey = QString(),
const KeyTreeItem::Settings settings = KeyTreeItem::Settings() 
)
Todo:
We need to take care of linked verses if we render one or (esp) more modules. If the verses 2,3,4,5 are linked to 1, it should be displayed as one entry with the caption 1-5.
Todo:
Notify the user about this failure.

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().

◆ renderKeyTree()

QString CTextRendering::renderKeyTree ( KeyTree const &  tree) const

◆ renderSingleKey()

QString CTextRendering::renderSingleKey ( const QString &  key,
const BtConstModuleList modules,
const KeyTreeItem::Settings settings = KeyTreeItem::Settings() 
)

◆ setDisplayOptions()

void Rendering::CTextRendering::setDisplayOptions ( DisplayOptions const &  displayOptions)
inlinenoexcept

◆ setFilterOptions()

void Rendering::CTextRendering::setFilterOptions ( FilterOptions const &  filterOptions)
inlinenoexcept

Member Data Documentation

◆ m_addText

bool const Rendering::CTextRendering::m_addText
protected

◆ m_displayOptions

DisplayOptions Rendering::CTextRendering::m_displayOptions
protected

Definition at line 168 of file ctextrendering.h.

Referenced by displayOptions(), renderEntry(), and setDisplayOptions().

◆ m_filterOptions

FilterOptions Rendering::CTextRendering::m_filterOptions
protected

Definition at line 169 of file ctextrendering.h.

Referenced by filterOptions(), renderEntry(), renderKeyTree(), and setFilterOptions().


The documentation for this class was generated from the following files: