BibleTime
|
#include <cdisplaytemplatemgr.h>
Classes | |
struct | Settings |
Public Member Functions | |
QStringList const & | availableTemplates () const |
CDisplayTemplateMgr (QString &errorMessage) | |
QString | fillTemplate (const QString &name, const QString &content, const Settings &settings) const |
Fills the template. More... | |
void | setMultiModuleHeadersVisible (bool visible) |
Turn on or off displaying module names during parallel text rendering. More... | |
Static Public Member Functions | |
static QString | activeTemplateName () |
static CDisplayTemplateMgr * | instance () |
Private Member Functions | |
void | loadCSSTemplate (const QString &filename) |
void | loadTemplate (const QString &filename) |
Private Attributes | |
QStringList | m_availableTemplateNamesCache |
QHash< QString, QString > | m_cssMap |
bool | m_multiModuleHeaders |
QHash< QString, QString > | m_templateMap |
Static Private Attributes | |
static CDisplayTemplateMgr * | m_instance = nullptr |
Manages the display templates used in the filters and display classes.
Definition at line 27 of file cdisplaytemplatemgr.h.
|
explicit |
[out] | errorMessage | Set to error string on error, otherwise set to QString(). |
Definition at line 50 of file cdisplaytemplatemgr.cpp.
References BT_ASSERT, CSSTEMPLATEBASE, anonymous_namespace{cdisplaytemplatemgr.cpp}::defaultTemplateName, anonymous_namespace{btbookshelfworkspage.cpp}::filter(), util::directory::getDisplayTemplatesDir(), util::directory::getUserDisplayTemplatesDir(), loadCSSTemplate(), loadTemplate(), m_availableTemplateNamesCache, m_cssMap, m_instance, and m_templateMap.
|
static |
Definition at line 262 of file cdisplaytemplatemgr.cpp.
References btConfig(), anonymous_namespace{cdisplaytemplatemgr.cpp}::defaultTemplateName, instance(), m_availableTemplateNamesCache, and BtConfigCore::value().
Referenced by CDisplaySettingsPage::CDisplaySettingsPage(), Rendering::CTextRendering::finishText(), Rendering::CDisplayRendering::finishText(), BtPrinter::finishText(), Rendering::formatInfo(), ColorManager::getBackgroundColor(), ColorManager::getBackgroundHighlightColor(), ColorManager::getCrossRefColor(), ColorManager::getForegroundColor(), and ColorManager::replaceColors().
|
inline |
Definition at line 69 of file cdisplaytemplatemgr.h.
References m_availableTemplateNamesCache.
Referenced by CDisplaySettingsPage::CDisplaySettingsPage().
QString CDisplayTemplateMgr::fillTemplate | ( | const QString & | name, |
const QString & | content, | ||
const Settings & | settings | ||
) | const |
Fills the template.
Fills rendered content into the template given by the name.
name | The name of the template to fill. |
content | The content which should be filled into the template. |
settings | The settings which are used to process the templating process. |
Definition at line 106 of file cdisplaytemplatemgr.cpp.
References CSwordBackend::availableLanguages(), CSwordModuleInfo::Bible, BT_ASSERT, btConfig(), CSwordModuleInfo::Commentary, CSSTEMPLATEBASE, CSwordModuleInfo::GenericBook, BtConfig::getDefaultFont(), util::directory::getDisplayTemplatesDir(), BtConfig::getFontForLanguage(), CSwordBackend::instance(), CDisplayTemplateMgr::Settings::langAbbrev, CSwordModuleInfo::Lexicon, m_cssMap, m_multiModuleHeaders, m_templateMap, CDisplayTemplateMgr::Settings::modules, CDisplayTemplateMgr::Settings::pageCSS_ID, CDisplayTemplateMgr::Settings::textDirectionAsHtmlDirAttr(), and CDisplayTemplateMgr::Settings::title.
Referenced by Rendering::CTextRendering::finishText(), Rendering::CDisplayRendering::finishText(), BtPrinter::finishText(), and Rendering::formatInfo().
|
inlinestatic |
Definition at line 96 of file cdisplaytemplatemgr.h.
References BT_ASSERT, and m_instance.
Referenced by activeTemplateName(), CDisplaySettingsPage::CDisplaySettingsPage(), Rendering::CTextRendering::finishText(), Rendering::CDisplayRendering::finishText(), BtPrinter::finishText(), Rendering::formatInfo(), and BibleTimeApp::~BibleTimeApp().
|
private |
Definition at line 280 of file cdisplaytemplatemgr.cpp.
References BT_ASSERT, m_cssMap, and anonymous_namespace{cdisplaytemplatemgr.cpp}::readFileToString().
Referenced by CDisplayTemplateMgr().
|
private |
Preloads a single template from disk:
Definition at line 272 of file cdisplaytemplatemgr.cpp.
References BT_ASSERT, m_templateMap, and anonymous_namespace{cdisplaytemplatemgr.cpp}::readFileToString().
Referenced by CDisplayTemplateMgr().
void CDisplayTemplateMgr::setMultiModuleHeadersVisible | ( | bool | visible | ) |
Turn on or off displaying module names during parallel text rendering.
visible | display module names |
Definition at line 288 of file cdisplaytemplatemgr.cpp.
References m_multiModuleHeaders.
|
private |
Definition at line 119 of file cdisplaytemplatemgr.h.
Referenced by activeTemplateName(), availableTemplates(), and CDisplayTemplateMgr().
|
private |
Definition at line 117 of file cdisplaytemplatemgr.h.
Referenced by CDisplayTemplateMgr(), fillTemplate(), and loadCSSTemplate().
|
staticprivate |
Definition at line 118 of file cdisplaytemplatemgr.h.
Referenced by CDisplayTemplateMgr(), and instance().
|
private |
Definition at line 115 of file cdisplaytemplatemgr.h.
Referenced by fillTemplate(), and setMultiModuleHeadersVisible().
|
private |
Definition at line 116 of file cdisplaytemplatemgr.h.
Referenced by CDisplayTemplateMgr(), fillTemplate(), and loadTemplate().