BibleTime
|
CSwordKey implementation for Sword's VerseKey. More...
#include <cswordversekey.h>
Public Types | |
enum | JumpType { UseBook , UseChapter , UseVerse } |
Public Types inherited from CSwordKey | |
enum | TextRenderType { Normal , ProcessEntryAttributesOnly } |
Public Member Functions | |
const BtSignal * | afterChangedSignaller () |
sword::SWKey const & | asSwordKey () const noexcept final override |
BibleTime_CSwordVerseKey_DEFINE_COMP (<) BibleTime_CSwordVerseKey_DEFINE_COMP(< | |
char | book () const |
QString | bookName () const |
int | chapter () const |
CSwordVerseKey * | copy () const final override |
CSwordVerseKey (const CSwordModuleInfo *module) | |
CSwordVerseKey (const CSwordVerseKey ©) | |
CSwordVerseKey (const sword::VerseKey *k, const CSwordModuleInfo *module) | |
void | emitAfterChanged () |
long | index () const |
bool | isBoundSet () const |
QString | key () const final override |
CSwordVerseKey | lowerBound () const |
bool | next (const JumpType type=JumpType::UseVerse) |
QString | normalizedKey () const final override |
void | positionToTop () |
bool | previous (const JumpType type=JumpType::UseVerse) |
void | setBook (char v) |
void | setBookName (QString const &newBookName) |
void | setChapter (int v) |
void | setIndex (long v) |
void | setIntros (bool v) |
bool | setKey (const char *key) final override |
bool | setKey (const QString &key) final override |
void | setLocale (char const *const locale) |
void | setLowerBound (CSwordVerseKey const &bound) |
void | setModule (const CSwordModuleInfo *newModule) final override |
void | setSuffix (char v) |
void | setTestament (char v) |
void | setUpperBound (CSwordVerseKey const &bound) |
void | setVerse (int v) |
void | setVersification (const char *name) |
QString | shortText () const |
char | suffix () const |
char | testament () const |
CSwordVerseKey | upperBound () const |
int | verse () const |
QString | versification () const |
~CSwordVerseKey () override | |
Public Member Functions inherited from CSwordKey | |
bool | isValid () const |
CSwordModuleInfo const * | module () const |
CSwordKey & | operator= (CSwordKey const &)=delete |
QString | rawText () |
QString | renderedText (const CSwordKey::TextRenderType mode=CSwordKey::Normal) |
QString | strippedText () |
virtual | ~CSwordKey () noexcept |
Protected Member Functions | |
const char * | rawKey () const final override |
Protected Member Functions inherited from CSwordKey | |
CSwordKey (CSwordKey const ©)=default | |
CSwordKey (CSwordModuleInfo const *const module=nullptr) | |
Private Attributes | |
QPointer< BtSignal > | m_afterChangedSignaller |
sword::VerseKey | m_key |
Additional Inherited Members | |
Protected Attributes inherited from CSwordKey | |
const CSwordModuleInfo * | m_module |
bool | m_valid = true |
CSwordKey implementation for Sword's VerseKey.
The CSwordKey implementation for verse based modules (Bibles and Commentaries)
This class is the implementation of CKey for verse based modules like Bibles and commentaries. This class provides the special functions to work with the verse based modules.
Useful functions are
Call the constructor only with valid verse based modules, otherwise this key will be invalid and the application will probably crash.
Definition at line 62 of file cswordversekey.h.
Enumerator | |
---|---|
UseBook | |
UseChapter | |
UseVerse |
Definition at line 65 of file cswordversekey.h.
CSwordVerseKey::CSwordVerseKey | ( | const CSwordModuleInfo * | module | ) |
Constructs a versekey with the current module position and setups the m_module members.
Definition at line 37 of file cswordversekey.cpp.
References m_key, CSwordKey::module(), and setKey().
Referenced by copy().
CSwordVerseKey::CSwordVerseKey | ( | const CSwordVerseKey & | copy | ) |
Definition at line 50 of file cswordversekey.cpp.
References m_key.
CSwordVerseKey::CSwordVerseKey | ( | const sword::VerseKey * | k, |
const CSwordModuleInfo * | module | ||
) |
Constructs a CSwordVerseKey using the given module at the position given by the versekey.
[in] | k | Position to use. |
[in] | module | Module to use. |
Definition at line 55 of file cswordversekey.cpp.
|
override |
Definition at line 61 of file cswordversekey.cpp.
References m_afterChangedSignaller.
const BtSignal * CSwordVerseKey::afterChangedSignaller | ( | ) |
Definition at line 381 of file cswordversekey.cpp.
References m_afterChangedSignaller.
|
finaloverridevirtualnoexcept |
Implements CSwordKey.
Definition at line 63 of file cswordversekey.cpp.
References m_key.
CSwordVerseKey::BibleTime_CSwordVerseKey_DEFINE_COMP | ( | ) |
|
inline |
Definition at line 162 of file cswordversekey.h.
References m_key.
Referenced by BtBibleKeyWidget::populateChapterMenu(), and CBibleReadWindow::saveChapter().
QString CSwordVerseKey::bookName | ( | ) | const |
This functions returns the current book as localised text, not as book numer.
Use "char Book()" to retrieve the book number of the current book.
Returns the current book as Text, not as integer.
Definition at line 123 of file cswordversekey.cpp.
References CSwordBibleModuleInfo::hasOldTestament(), m_key, and CSwordKey::module().
Referenced by CSwordBibleModuleInfo::books(), CBibleReadWindow::copyDisplayedText(), Rendering::CDisplayRendering::entryLink(), BtBibleKeyWidget::populateVerseMenu(), BtModelViewReadDisplay::print(), CExportManager::saveKey(), and BtModuleTextModel::verseData().
|
inline |
Definition at line 164 of file cswordversekey.h.
References m_key.
Referenced by CBibleReadWindow::copyDisplayedText(), Rendering::CDisplayRendering::entryLink(), BtBibleKeyWidget::populateVerseMenu(), BtModelViewReadDisplay::print(), Rendering::CDisplayRendering::renderDisplayEntry(), CBibleReadWindow::saveChapter(), CExportManager::saveKey(), Search::BtSearchResultArea::updatePreview(), and BtModuleTextModel::verseData().
|
finaloverridevirtual |
Clones this object.
Implements CSwordKey.
Definition at line 67 of file cswordversekey.cpp.
References CSwordVerseKey().
void CSwordVerseKey::emitAfterChanged | ( | ) |
This is called after a key change to emit a signal.
Definition at line 389 of file cswordversekey.cpp.
References m_afterChangedSignaller.
Referenced by next(), previous(), setKey(), and setModule().
|
inline |
Definition at line 170 of file cswordversekey.h.
References m_key.
Referenced by CSwordModuleInfo::buildIndex(), BibleTime::processCommandline(), BtModuleTextModel::reloadModules(), and BtModuleTextModel::verseKeyToIndex().
|
inline |
Definition at line 158 of file cswordversekey.h.
References m_key.
Referenced by CExportManager::copyKey(), Rendering::CDisplayRendering::entryLink(), and CExportManager::saveKey().
|
finaloverridevirtual |
Sets the key we use to the parameter.
Implements CSwordKey.
Definition at line 160 of file cswordversekey.cpp.
References m_key.
Referenced by CSwordBibleModuleInfo::books(), Rendering::CDisplayRendering::entryLink(), Rendering::CrossRefRendering::entryLink(), BtPrinter::entryLink(), BtQmlInterface::getRawText(), BtModuleTextModel::indexToKeyName(), Rendering::CTextRendering::KeyTreeItem::KeyTreeItem(), next(), normalizedKey(), ReferenceManager::parseVerseReference(), previous(), BtModelViewReadDisplay::print(), BibleTime::processCommandline(), Rendering::CDisplayRendering::renderDisplayEntry(), Rendering::CTextRendering::renderKeyRange(), BtBibleKeyWidget::setKey(), BtBibleKeyWidget::updateText(), and BtModuleTextModel::verseData().
CSwordVerseKey CSwordVerseKey::lowerBound | ( | ) | const |
Definition at line 110 of file cswordversekey.cpp.
References m_key, and CSwordKey::module().
Referenced by CExportManager::copyKey(), Rendering::CDisplayRendering::entryLink(), and CExportManager::saveKey().
bool CSwordVerseKey::next | ( | const JumpType | type = JumpType::UseVerse | ) |
Jumps to the next entry of the given type
Definition at line 201 of file cswordversekey.cpp.
References emitAfterChanged(), key(), m_key, CSwordKey::m_module, CSwordKey::module(), setKey(), CSwordModuleInfo::swordModule(), UseBook, UseChapter, and UseVerse.
Referenced by CSwordBibleModuleInfo::books(), BtBibleKeyWidget::BtBibleKeyWidget(), Rendering::CTextRendering::KeyTreeItem::KeyTreeItem(), and Search::BtSearchResultArea::updatePreview().
|
finaloverridevirtual |
Reimplemented from CSwordKey.
Definition at line 166 of file cswordversekey.cpp.
|
inline |
Definition at line 172 of file cswordversekey.h.
References m_key.
Referenced by BibleTime::processCommandline().
bool CSwordVerseKey::previous | ( | const JumpType | type = JumpType::UseVerse | ) |
Jumps to the previous entry of the given type
Definition at line 294 of file cswordversekey.cpp.
References emitAfterChanged(), key(), m_key, CSwordKey::m_module, CSwordKey::module(), setKey(), CSwordModuleInfo::swordModule(), UseBook, UseChapter, and UseVerse.
Referenced by BtBibleKeyWidget::BtBibleKeyWidget(), and Search::BtSearchResultArea::updatePreview().
|
finaloverrideprotectedvirtual |
Implements CSwordKey.
Definition at line 177 of file cswordversekey.cpp.
References m_key.
|
inline |
Definition at line 163 of file cswordversekey.h.
References m_key.
|
inline |
Definition at line 143 of file cswordversekey.h.
References m_key.
|
inline |
Definition at line 165 of file cswordversekey.h.
References m_key.
Referenced by Rendering::CDisplayRendering::renderDisplayEntry(), and Search::BtSearchResultArea::updatePreview().
|
inline |
Definition at line 171 of file cswordversekey.h.
References m_key.
Referenced by BtModuleTextModel::indexToVerse(), BtModuleTextModel::indexToVerseKey(), BibleTime::processCommandline(), and Rendering::CTextRendering::renderEntry().
|
inline |
Definition at line 159 of file cswordversekey.h.
References m_key.
Referenced by Rendering::CDisplayRendering::entryLink(), BtModuleTextModel::indexToVerse(), BtModuleTextModel::indexToVerseKey(), Rendering::CDisplayRendering::renderDisplayEntry(), Rendering::CTextRendering::renderEntry(), and Search::BtSearchResultArea::updatePreview().
|
finaloverridevirtual |
Set the key using a utf8-decoded c-string.
[in] | key | The key which should be used to set the current one. |
Implements CSwordKey.
Definition at line 183 of file cswordversekey.cpp.
References emitAfterChanged(), m_key, and CSwordKey::m_valid.
|
finaloverridevirtual |
Sets the current key using a utf8 enabled QString.
[in] | key | The key which should be used to set the current one. |
Implements CSwordKey.
Definition at line 179 of file cswordversekey.cpp.
Referenced by CSwordBibleModuleInfo::books(), CSwordVerseKey(), Rendering::CDisplayRendering::entryLink(), Rendering::CrossRefRendering::entryLink(), BtPrinter::entryLink(), BtQmlInterface::getRawText(), Rendering::CTextRendering::KeyTreeItem::KeyTreeItem(), next(), ReferenceManager::parseVerseReference(), previous(), Rendering::CDisplayRendering::renderDisplayEntry(), BtBibleKeyWidget::setKey(), setModule(), Search::BtSearchResultArea::updatePreview(), and BtModuleTextModel::verseData().
|
inline |
Definition at line 157 of file cswordversekey.h.
References m_key.
Referenced by ReferenceManager::parseVerseReference(), CBibleReadWindow::reload(), and CCommentaryReadWindow::reload().
void CSwordVerseKey::setLowerBound | ( | CSwordVerseKey const & | bound | ) |
Definition at line 113 of file cswordversekey.cpp.
References m_key.
Referenced by CBibleReadWindow::copyDisplayedText(), and CBibleReadWindow::saveChapter().
|
finaloverridevirtual |
Sets the module for this key
Remap key position to new versification
Limit to Bible bounds
Reimplemented from CSwordKey.
Definition at line 71 of file cswordversekey.cpp.
References CSwordModuleInfo::Bible, BT_ASSERT, CSwordModuleInfo::Commentary, emitAfterChanged(), CSwordBibleModuleInfo::lowerBound(), m_key, CSwordKey::m_module, CSwordKey::m_valid, setKey(), CSwordModuleInfo::swordModule(), CSwordModuleInfo::type(), and CSwordBibleModuleInfo::upperBound().
Referenced by BtBibleKeyWidget::setModule().
|
inline |
Definition at line 169 of file cswordversekey.h.
References m_key.
|
inline |
Definition at line 161 of file cswordversekey.h.
References m_key.
void CSwordVerseKey::setUpperBound | ( | CSwordVerseKey const & | bound | ) |
Definition at line 119 of file cswordversekey.cpp.
References m_key.
Referenced by CBibleReadWindow::copyDisplayedText(), and CBibleReadWindow::saveChapter().
|
inline |
Definition at line 167 of file cswordversekey.h.
References m_key.
Referenced by CBibleReadWindow::copyDisplayedText(), BtModelViewReadDisplay::print(), Rendering::CDisplayRendering::renderDisplayEntry(), CBibleReadWindow::saveChapter(), and Search::BtSearchResultArea::updatePreview().
|
inline |
Definition at line 176 of file cswordversekey.h.
References m_key.
|
inline |
Definition at line 154 of file cswordversekey.h.
References m_key.
Referenced by Rendering::CDisplayRendering::entryLink(), Rendering::CrossRefRendering::entryLink(), and BtPrinter::entryLink().
|
inline |
Definition at line 168 of file cswordversekey.h.
References m_key.
|
inline |
Definition at line 160 of file cswordversekey.h.
References m_key.
CSwordVerseKey CSwordVerseKey::upperBound | ( | ) | const |
Definition at line 116 of file cswordversekey.cpp.
References m_key, and CSwordKey::module().
Referenced by CExportManager::copyKey(), Rendering::CDisplayRendering::entryLink(), and CExportManager::saveKey().
|
inline |
Definition at line 166 of file cswordversekey.h.
References m_key.
Referenced by Rendering::CDisplayRendering::entryLink(), Rendering::CrossRefRendering::entryLink(), BtPrinter::entryLink(), BtModuleTextModel::indexToVerse(), Rendering::CDisplayRendering::renderDisplayEntry(), Search::BtSearchResultArea::updatePreview(), and BtModuleTextModel::verseData().
|
inline |
Definition at line 173 of file cswordversekey.h.
References m_key.
|
private |
Definition at line 192 of file cswordversekey.h.
Referenced by afterChangedSignaller(), emitAfterChanged(), and ~CSwordVerseKey().
|
private |
Definition at line 191 of file cswordversekey.h.
Referenced by asSwordKey(), book(), bookName(), chapter(), CSwordVerseKey(), index(), isBoundSet(), key(), lowerBound(), next(), normalizedKey(), positionToTop(), previous(), rawKey(), setBook(), setBookName(), setChapter(), setIndex(), setIntros(), setKey(), setLocale(), setLowerBound(), setModule(), setSuffix(), setTestament(), setUpperBound(), setVerse(), setVersification(), shortText(), suffix(), testament(), upperBound(), verse(), and versification().