BibleTime
Classes | Enumerations | Functions
ReferenceManager Namespace Reference

Classes

struct  DecodedHyperlink
 
struct  ParseOptions
 

Enumerations

enum  Type {
  Unknown , Bible , Commentary , Lexicon ,
  GenericBook , MorphHebrew , MorphGreek , StrongsHebrew ,
  StrongsGreek
}
 

Functions

std::optional< DecodedHyperlinkdecodeHyperlink (QString const &hyperlink)
 
QString encodeHyperlink (CSwordModuleInfo const &module, QString const &key)
 
QString parseVerseReference (QString const &ref, ParseOptions const &options)
 

Detailed Description

Contains functions to work with references used for Drag & Drop and for hyperlinks used in our rendered HTML code.

Enumeration Type Documentation

◆ Type

Enumerator
Unknown 

Unknown

Bible 

Bibles

Commentary 

Commentary

Lexicon 

Lexicon

GenericBook 

Generic Book

MorphHebrew 

Module for hebrew morphology

MorphGreek 

Module for greek morphology

StrongsHebrew 

Module for hebrew strongs

StrongsGreek 

Module for greek strongs

Definition at line 24 of file referencemanager.h.

Function Documentation

◆ decodeHyperlink()

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.

Parameters
hyperlinkThe hyperlink to decode
moduleThe string which will contain the module name after decoding
keyThe string which will contain the key after decoding
typeThe 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().

◆ encodeHyperlink()

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

Parameters
moduleThe module to which to link.
keyThe key which is used to encode the hyperlink
Returns
The encoded 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().

◆ parseVerseReference()

QString ReferenceManager::parseVerseReference ( QString const &  ref,
ReferenceManager::ParseOptions const &  options 
)

Parses the given verse references using the given language and the module.

Parameters
moduleNameThe name of the module to use. Required for the language checking before parsing the key.
refThe verse reference.
langThe language of the verse reference
newLangThe 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().