BibleTime
|
CSwordKey implementation for Sword's TreeKey. More...
#include <cswordtreekey.h>
Public Types | |
using | Offset = decltype(std::declval< sword::TreeKeyIdx const & >().getOffset()) |
Public Types inherited from CSwordKey | |
enum | TextRenderType { Normal , ProcessEntryAttributesOnly } |
Public Member Functions | |
sword::TreeKeyIdx const & | asSwordKey () const noexcept final override |
BibleTime_CSwordTreeKey_DEFINE_COMP (<) BibleTime_CSwordTreeKey_DEFINE_COMP(< | |
CSwordTreeKey * | copy () const final override |
CSwordTreeKey (const CSwordTreeKey &k) | |
CSwordTreeKey (const sword::TreeKeyIdx *k, const CSwordModuleInfo *module) | |
QString | getLocalNameUnicode () |
bool | hasChildren () |
QString | key () const final override |
Offset | offset () const |
bool | positionToFirstChild () |
bool | positionToNextSibling () |
bool | positionToParent () |
void | positionToRoot () |
bool | setKey (const char *key) final override |
bool | setKey (const QString &key) final override |
void | setModule (const CSwordModuleInfo *newModule) final override |
void | setOffset (Offset value) |
Public Member Functions inherited from CSwordKey | |
bool | isValid () const |
CSwordModuleInfo const * | module () const |
virtual QString | normalizedKey () 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 | |
sword::TreeKeyIdx | m_key |
Additional Inherited Members | |
Protected Attributes inherited from CSwordKey | |
const CSwordModuleInfo * | m_module |
bool | m_valid = true |
CSwordKey implementation for Sword's TreeKey.
BibleTime's implementation of Sword's TreeKeyIdx class.
Definition at line 43 of file cswordtreekey.h.
using CSwordTreeKey::Offset = decltype(std::declval<sword::TreeKeyIdx const &>().getOffset()) |
Definition at line 47 of file cswordtreekey.h.
CSwordTreeKey::CSwordTreeKey | ( | const sword::TreeKeyIdx * | k, |
const CSwordModuleInfo * | module | ||
) |
k | The Sword tree key which belongs to this key |
module | The module which belongs to this key |
Definition at line 31 of file cswordtreekey.cpp.
Referenced by copy().
CSwordTreeKey::CSwordTreeKey | ( | const CSwordTreeKey & | k | ) |
Definition at line 26 of file cswordtreekey.cpp.
|
finaloverridevirtualnoexcept |
Implements CSwordKey.
Definition at line 37 of file cswordtreekey.cpp.
References m_key.
CSwordTreeKey::BibleTime_CSwordTreeKey_DEFINE_COMP | ( | ) |
|
finaloverridevirtual |
Implements CSwordKey.
Definition at line 40 of file cswordtreekey.cpp.
References CSwordTreeKey().
QString CSwordTreeKey::getLocalNameUnicode | ( | ) |
Returns the TreeKeyIdx::getLocalKey value in unicode. Local key is the last part of the tree key, for example "Subsection1" from "/Section1/Subsection1". Use this instead of getLocalKey() to avoid encoding problems.
Definition at line 83 of file cswordtreekey.cpp.
References BT_ASSERT, CSwordModuleInfo::isUnicode(), m_key, CSwordKey::m_module, and util::cp1252::toUnicode().
Referenced by CBookKeyChooser::setKey(), and CBookKeyChooser::setupCombo().
|
inline |
Definition at line 98 of file cswordtreekey.h.
References m_key.
Referenced by CBookKeyChooser::setKey().
|
finaloverridevirtual |
Sets the key of this instance
Implements CSwordKey.
Definition at line 45 of file cswordtreekey.cpp.
References BT_ASSERT, CSwordModuleInfo::isUnicode(), m_key, CSwordKey::m_module, and util::cp1252::toUnicode().
Referenced by BtModuleTextModel::bookData(), BtModuleTextModel::indexToKeyName(), BtModelViewReadDisplay::print(), CBookTreeChooser::setKey(), CBookKeyChooser::setKey(), and setModule().
|
inline |
Definition at line 103 of file cswordtreekey.h.
References m_key.
Referenced by BtQmlInterface::getCurrentModelIndex(), CBookKeyChooser::setKey(), CBookTreeChooser::setModules(), and CBookTreeChooser::setupTree().
|
inline |
Definition at line 101 of file cswordtreekey.h.
References m_key.
Referenced by CBookKeyChooser::setKey(), setModule(), and CBookKeyChooser::setupCombo().
|
inline |
Definition at line 102 of file cswordtreekey.h.
References m_key.
Referenced by CBookKeyChooser::setKey(), and CBookKeyChooser::setupCombo().
|
inline |
Definition at line 100 of file cswordtreekey.h.
References m_key.
Referenced by CBookKeyChooser::setupCombo().
|
inline |
Definition at line 99 of file cswordtreekey.h.
References m_key.
Referenced by BtQmlInterface::getCurrentModelIndex(), setKey(), CBookKeyChooser::setKey(), setModule(), and CBookTreeChooser::setupTree().
|
finaloverrideprotectedvirtual |
Implements CSwordKey.
Definition at line 56 of file cswordtreekey.cpp.
References m_key.
|
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 70 of file cswordtreekey.cpp.
References BT_ASSERT, m_key, and positionToRoot().
|
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 58 of file cswordtreekey.cpp.
References BT_ASSERT, util::cp1252::fromUnicode(), CSwordModuleInfo::isUnicode(), and CSwordKey::m_module.
Referenced by BtQmlInterface::getCurrentModelIndex(), CBookTreeChooser::itemActivated(), CBookKeyChooser::keyChooserChanged(), CBookKeyChooser::setKey(), setModule(), and CBookKeyChooser::setupCombo().
|
finaloverridevirtual |
Sets the module which belongs to this key.
[in] | newModule | the module to set. |
Reimplemented from CSwordKey.
Definition at line 95 of file cswordtreekey.cpp.
References BT_ASSERT, CSwordModuleInfo::GenericBook, key(), m_key, CSwordKey::m_module, positionToFirstChild(), positionToRoot(), setKey(), and CSwordModuleInfo::type().
|
inline |
Definition at line 104 of file cswordtreekey.h.
References m_key.
Referenced by BtModuleTextModel::bookData(), BtModuleTextModel::indexToBookKey(), CBookKeyChooser::setKey(), CBookTreeChooser::setModules(), and CBookTreeChooser::setupTree().
|
private |
Definition at line 112 of file cswordtreekey.h.
Referenced by asSwordKey(), getLocalNameUnicode(), hasChildren(), key(), offset(), positionToFirstChild(), positionToNextSibling(), positionToParent(), positionToRoot(), rawKey(), setKey(), setModule(), and setOffset().