BibleTime
|
Classes | |
struct | DecodedHyperlink |
struct | ParseOptions |
Enumerations | |
enum | Type { Unknown , Bible , Commentary , Lexicon , GenericBook , MorphHebrew , MorphGreek , StrongsHebrew , StrongsGreek } |
Functions | |
std::optional< DecodedHyperlink > | decodeHyperlink (QString const &hyperlink) |
QString | encodeHyperlink (CSwordModuleInfo const &module, QString const &key) |
QString | parseVerseReference (QString const &ref, ParseOptions const &options) |
Contains functions to work with references used for Drag & Drop and for hyperlinks used in our rendered HTML code.
Definition at line 24 of file referencemanager.h.
std::optional< ReferenceManager::DecodedHyperlink > ReferenceManager::decodeHyperlink | ( | QString const & | hyperlink | ) |
Turn a hyperlink into module, key and type. Decodes the given hyperlink into module, key and type.
hyperlink | The hyperlink to decode |
module | The string which will contain the module name after decoding |
key | The string which will contain the key after decoding |
type | The type param will contain the reference type after decoding |
Decodes the given hyperlink.
Definition at line 52 of file referencemanager.cpp.
References Bible, btConfig(), Commentary, CSwordBackend::findModuleByName(), GenericBook, BtConfig::getDefaultSwordModuleByType(), CSwordBackend::instance(), ReferenceManager::DecodedHyperlink::key, Lexicon, ReferenceManager::DecodedHyperlink::module, MorphGreek, MorphHebrew, RET_CASE, StrongsGreek, StrongsHebrew, ReferenceManager::DecodedHyperlink::type, and Unknown.
Referenced by InfoDisplay::CInfoDisplay::CInfoDisplay(), BtTextBrowser::mouseMoveEvent(), CExportManager::printByHyperlink(), and BtModelViewReadDisplay::text().
QString ReferenceManager::encodeHyperlink | ( | CSwordModuleInfo const & | module, |
QString const & | key | ||
) |
Returns a hyperlink used to be embedded in the display windows. At the moment the format is sword://module/key
module | The module to which to link. |
key | The key which is used to encode the hyperlink |
Returns a hyperlink used to be imbedded in the display windows. At the moment the format is sword://module/key
Definition at line 26 of file referencemanager.cpp.
References CSwordModuleInfo::Bible, BT_ASSERT, CSwordModuleInfo::Commentary, CSwordModuleInfo::GenericBook, CSwordModuleInfo::Lexicon, CSwordModuleInfo::name(), and CSwordModuleInfo::type().
Referenced by Rendering::CDisplayRendering::entryLink(), Rendering::CrossRefRendering::entryLink(), Filters::ThmlToHtml::handleToken(), anonymous_namespace{osistohtml.cpp}::renderReference(), Filters::TeiToHtml::renderReference(), and Filters::TeiToHtml::renderTargetReference().
QString ReferenceManager::parseVerseReference | ( | QString const & | ref, |
ReferenceManager::ParseOptions const & | options | ||
) |
Parses the given verse references using the given language and the module.
moduleName | The name of the module to use. Required for the language checking before parsing the key. |
ref | The verse reference. |
lang | The language of the verse reference |
newLang | The language of the reference, which will be returned. For example: If BibleTime using an english environment parses a spanish ref (lang=es) the returned ref should be in english (newLang=en), because his english standard module only understands en. |
Parses the given verse references using the given language and the module.
Definition at line 162 of file referencemanager.cpp.
References BtInstallBackend::backend(), CSwordModuleInfo::Bible, BT_ASSERT, CSwordModuleInfo::Commentary, CSwordBackend::instance(), BtLocaleMgr::internalSwordLocales(), CSwordVerseKey::key(), ReferenceManager::ParseOptions::refBase, ReferenceManager::ParseOptions::refDestinationModule, CSwordVerseKey::setKey(), CSwordVerseKey::setLocale(), and ReferenceManager::ParseOptions::sourceLanguage.
Referenced by Filters::ThmlToHtml::handleToken(), anonymous_namespace{osistohtml.cpp}::renderReference(), and Filters::TeiToHtml::renderReference().