BibleTime
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CSwordVerseKey Class Referencefinal

CSwordKey implementation for Sword's VerseKey. More...

#include <cswordversekey.h>

Inheritance diagram for CSwordVerseKey:

Public Types

enum  JumpType { UseBook , UseChapter , UseVerse }
 
- Public Types inherited from CSwordKey
enum  TextRenderType { Normal , ProcessEntryAttributesOnly }
 

Public Member Functions

const BtSignalafterChangedSignaller ()
 
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
 
CSwordVerseKeycopy () const final override
 
 CSwordVerseKey (const CSwordModuleInfo *module)
 
 CSwordVerseKey (const CSwordVerseKey &copy)
 
 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
 
CSwordKeyoperator= (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 &copy)=default
 
 CSwordKey (CSwordModuleInfo const *const module=nullptr)
 

Private Attributes

QPointer< BtSignalm_afterChangedSignaller
 
sword::VerseKey m_key
 

Additional Inherited Members

- Protected Attributes inherited from CSwordKey
const CSwordModuleInfom_module
 
bool m_valid = true
 

Detailed Description

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

See also
NextBook()
PreviousBook()
NextChapter()
PreviousChapter()
NextVerse()
PreviousVerse().

Call the constructor only with valid verse based modules, otherwise this key will be invalid and the application will probably crash.

Version
Id
cswordversekey.h,v 1.26 2006/02/25 11:38:15 joachim Exp
Author
The BibleTime team

Definition at line 62 of file cswordversekey.h.

Member Enumeration Documentation

◆ JumpType

Enumerator
UseBook 
UseChapter 
UseVerse 

Definition at line 65 of file cswordversekey.h.

Constructor & Destructor Documentation

◆ CSwordVerseKey() [1/3]

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() [2/3]

CSwordVerseKey::CSwordVerseKey ( const CSwordVerseKey copy)

Definition at line 50 of file cswordversekey.cpp.

References m_key.

◆ CSwordVerseKey() [3/3]

CSwordVerseKey::CSwordVerseKey ( const sword::VerseKey *  k,
const CSwordModuleInfo module 
)

Constructs a CSwordVerseKey using the given module at the position given by the versekey.

Parameters
[in]kPosition to use.
[in]moduleModule to use.

Definition at line 55 of file cswordversekey.cpp.

◆ ~CSwordVerseKey()

CSwordVerseKey::~CSwordVerseKey ( )
override

Definition at line 61 of file cswordversekey.cpp.

References m_afterChangedSignaller.

Member Function Documentation

◆ afterChangedSignaller()

const BtSignal * CSwordVerseKey::afterChangedSignaller ( )

Definition at line 381 of file cswordversekey.cpp.

References m_afterChangedSignaller.

◆ asSwordKey()

sword::SWKey const & CSwordVerseKey::asSwordKey ( ) const
finaloverridevirtualnoexcept
Returns
a reference to this object as a sword::SWKey.

Implements CSwordKey.

Definition at line 63 of file cswordversekey.cpp.

References m_key.

◆ BibleTime_CSwordVerseKey_DEFINE_COMP()

CSwordVerseKey::BibleTime_CSwordVerseKey_DEFINE_COMP ( )

◆ book()

char CSwordVerseKey::book ( ) const
inline

Definition at line 162 of file cswordversekey.h.

References m_key.

Referenced by BtBibleKeyWidget::populateChapterMenu(), and CBibleReadWindow::saveChapter().

◆ bookName()

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 name 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().

◆ chapter()

int CSwordVerseKey::chapter ( ) const
inline

◆ copy()

CSwordVerseKey * CSwordVerseKey::copy ( ) const
finaloverridevirtual

Clones this object.

Implements CSwordKey.

Definition at line 67 of file cswordversekey.cpp.

References CSwordVerseKey().

◆ emitAfterChanged()

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().

◆ index()

long CSwordVerseKey::index ( ) const
inline

◆ isBoundSet()

bool CSwordVerseKey::isBoundSet ( ) const
inline

◆ key()

QString CSwordVerseKey::key ( ) const
finaloverridevirtual

◆ lowerBound()

CSwordVerseKey CSwordVerseKey::lowerBound ( ) const

◆ next()

bool CSwordVerseKey::next ( const JumpType  type = JumpType::UseVerse)

◆ normalizedKey()

QString CSwordVerseKey::normalizedKey ( ) const
finaloverridevirtual
Returns
the normalized (English) key.

Reimplemented from CSwordKey.

Definition at line 166 of file cswordversekey.cpp.

References key(), and m_key.

◆ positionToTop()

void CSwordVerseKey::positionToTop ( )
inline

Definition at line 172 of file cswordversekey.h.

References m_key.

Referenced by BibleTime::processCommandline().

◆ previous()

bool CSwordVerseKey::previous ( const JumpType  type = JumpType::UseVerse)

Jumps to the previous entry of the given type

Warning
Weird comment:

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().

◆ rawKey()

const char * CSwordVerseKey::rawKey ( ) const
finaloverrideprotectedvirtual
Returns
the encoded key appropriate for use directly with Sword.

Implements CSwordKey.

Definition at line 177 of file cswordversekey.cpp.

References m_key.

◆ setBook()

void CSwordVerseKey::setBook ( char  v)
inline

Definition at line 163 of file cswordversekey.h.

References m_key.

◆ setBookName()

void CSwordVerseKey::setBookName ( QString const &  newBookName)
inline

Definition at line 143 of file cswordversekey.h.

References m_key.

◆ setChapter()

void CSwordVerseKey::setChapter ( int  v)
inline

◆ setIndex()

void CSwordVerseKey::setIndex ( long  v)
inline

◆ setIntros()

void CSwordVerseKey::setIntros ( bool  v)
inline

◆ setKey() [1/2]

bool CSwordVerseKey::setKey ( const char *  key)
finaloverridevirtual

Set the key using a utf8-decoded c-string.

Parameters
[in]keyThe key which should be used to set the current one.
Todo:
Do we ALWAYS need to emit this signal

Implements CSwordKey.

Definition at line 183 of file cswordversekey.cpp.

References emitAfterChanged(), m_key, and CSwordKey::m_valid.

◆ setKey() [2/2]

bool CSwordVerseKey::setKey ( const QString &  key)
finaloverridevirtual

◆ setLocale()

void CSwordVerseKey::setLocale ( char const *const  locale)
inline

◆ setLowerBound()

void CSwordVerseKey::setLowerBound ( CSwordVerseKey const &  bound)

Definition at line 113 of file cswordversekey.cpp.

References m_key.

Referenced by CBibleReadWindow::copyDisplayedText(), and CBibleReadWindow::saveChapter().

◆ setModule()

void CSwordVerseKey::setModule ( const CSwordModuleInfo newModule)
finaloverridevirtual

◆ setSuffix()

void CSwordVerseKey::setSuffix ( char  v)
inline

Definition at line 169 of file cswordversekey.h.

References m_key.

◆ setTestament()

void CSwordVerseKey::setTestament ( char  v)
inline

Definition at line 161 of file cswordversekey.h.

References m_key.

◆ setUpperBound()

void CSwordVerseKey::setUpperBound ( CSwordVerseKey const &  bound)

Definition at line 119 of file cswordversekey.cpp.

References m_key.

Referenced by CBibleReadWindow::copyDisplayedText(), and CBibleReadWindow::saveChapter().

◆ setVerse()

void CSwordVerseKey::setVerse ( int  v)
inline

◆ setVersification()

void CSwordVerseKey::setVersification ( const char *  name)
inline

Definition at line 176 of file cswordversekey.h.

References m_key.

◆ shortText()

QString CSwordVerseKey::shortText ( ) const
inline

◆ suffix()

char CSwordVerseKey::suffix ( ) const
inline

Definition at line 168 of file cswordversekey.h.

References m_key.

◆ testament()

char CSwordVerseKey::testament ( ) const
inline

Definition at line 160 of file cswordversekey.h.

References m_key.

◆ upperBound()

CSwordVerseKey CSwordVerseKey::upperBound ( ) const

◆ verse()

int CSwordVerseKey::verse ( ) const
inline

◆ versification()

QString CSwordVerseKey::versification ( ) const
inline

Definition at line 173 of file cswordversekey.h.

References m_key.

Member Data Documentation

◆ m_afterChangedSignaller

QPointer<BtSignal> CSwordVerseKey::m_afterChangedSignaller
private

Definition at line 192 of file cswordversekey.h.

Referenced by afterChangedSignaller(), emitAfterChanged(), and ~CSwordVerseKey().

◆ m_key

sword::VerseKey CSwordVerseKey::m_key
private

The documentation for this class was generated from the following files: