BibleTime
|
#include <cswordldkey.h>
Public Member Functions | |
sword::SWKey const & | asSwordKey () const noexcept final override |
CSwordLDKey * | copy () const final override |
CSwordLDKey (const CSwordLDKey ©) | |
CSwordLDKey (const CSwordModuleInfo *module) | |
CSwordLDKey (const sword::SWKey *k, const CSwordModuleInfo *module) | |
QString | key () const final override |
CSwordLDKey * | NextEntry () |
CSwordLDKey & | operator= (CSwordLDKey const &)=delete |
CSwordLDKey * | PreviousEntry () |
bool | setKey (const char *key) final override |
bool | setKey (const QString &newKey) final override |
void | setModule (const CSwordModuleInfo *module) final override |
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::SWKey | m_key |
Additional Inherited Members | |
Public Types inherited from CSwordKey | |
enum | TextRenderType { Normal , ProcessEntryAttributesOnly } |
Protected Attributes inherited from CSwordKey | |
const CSwordModuleInfo * | m_module |
bool | m_valid = true |
This class is the implementation of CSwordKey used for dictionaries and lexicons.
CSwordLDKey is the implementation of CKey for Lexicons and dictionaries. It provides a simple interface to set the current key, to get the text for the key and functions to get the next and previous items of the used module in comparision to the current key.
Here's an example how to use this class:
Please not, that the result will be invalid if use the operator const char* on the adress of the object, use something like this
Definition at line 58 of file cswordldkey.h.
CSwordLDKey::CSwordLDKey | ( | const CSwordModuleInfo * | module | ) |
Definition at line 37 of file cswordldkey.cpp.
References m_key.
Referenced by copy().
CSwordLDKey::CSwordLDKey | ( | const CSwordLDKey & | copy | ) |
No descriptions
Definition at line 42 of file cswordldkey.cpp.
CSwordLDKey::CSwordLDKey | ( | const sword::SWKey * | k, |
const CSwordModuleInfo * | module | ||
) |
|
finaloverridevirtualnoexcept |
Implements CSwordKey.
Definition at line 53 of file cswordldkey.cpp.
References m_key.
|
finaloverridevirtual |
Clones this object by copying the members.
Implements CSwordKey.
Definition at line 56 of file cswordldkey.cpp.
References CSwordLDKey().
|
finaloverridevirtual |
Implements CSwordKey.
Definition at line 71 of file cswordldkey.cpp.
References BT_ASSERT, CSwordModuleInfo::isUnicode(), m_key, CSwordKey::m_module, and util::cp1252::toUnicode().
Referenced by CLexiconKeyChooser::CLexiconKeyChooser(), setModule(), and CLexiconKeyChooser::updateKey().
CSwordLDKey * CSwordLDKey::NextEntry | ( | ) |
Uses the parameter to returns the next entry afer this key.
Definition at line 112 of file cswordldkey.cpp.
References m_key, CSwordKey::m_module, setKey(), and CSwordModuleInfo::swordModule().
|
delete |
CSwordLDKey * CSwordLDKey::PreviousEntry | ( | ) |
Uses the parameter to returns the previous entry afer this key.
Uses the parameter to returns the next entry afer this key.
Definition at line 128 of file cswordldkey.cpp.
References m_key, CSwordKey::m_module, and CSwordModuleInfo::swordModule().
|
finaloverrideprotectedvirtual |
Implements CSwordKey.
Definition at line 82 of file cswordldkey.cpp.
References m_key.
|
finaloverridevirtual |
Sets the key of this instance
Implements CSwordKey.
Definition at line 99 of file cswordldkey.cpp.
References BT_ASSERT, m_key, CSwordKey::m_module, CSwordModuleInfo::snap(), and CSwordModuleInfo::swordModule().
|
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 86 of file cswordldkey.cpp.
References BT_ASSERT, util::cp1252::fromUnicode(), CSwordModuleInfo::isUnicode(), and CSwordKey::m_module.
Referenced by CLexiconKeyChooser::CLexiconKeyChooser(), NextEntry(), and setModule().
|
finaloverridevirtual |
Sets the module of this key.
Reimplemented from CSwordKey.
Definition at line 61 of file cswordldkey.cpp.
References BT_ASSERT, key(), CSwordModuleInfo::Lexicon, CSwordKey::m_module, setKey(), and CSwordModuleInfo::type().
|
private |
Definition at line 102 of file cswordldkey.h.
Referenced by asSwordKey(), CSwordLDKey(), key(), NextEntry(), PreviousEntry(), rawKey(), and setKey().