BibleTime
Public Member Functions | Private Attributes | List of all members
CSwordLexiconModuleInfo Class Referencefinal

#include <cswordlexiconmoduleinfo.h>

Inheritance diagram for CSwordLexiconModuleInfo:

Public Member Functions

CSwordKeycreateKey () const final override
 
 CSwordLexiconModuleInfo (sword::SWModule &module, CSwordBackend &backend)
 
const QStringList & entries () const
 
bool hasStrongsKeys () const
 
QString normalizeStrongsKey (const QString &key) const
 
bool snap () const final override
 
- Public Member Functions inherited from CSwordModuleInfo
QString aboutText () const
 
void buildIndex ()
 
CSwordModuleInfo::Category category () const
 
QString config (const CSwordModuleInfo::ConfigEntry entry) const
 
 CSwordModuleInfo (CSwordModuleInfo &&)=delete
 
 CSwordModuleInfo (CSwordModuleInfo const &)=delete
 
void deleteEntry (CSwordKey *const key)
 
void deleteIndex ()
 
QString getModuleBaseIndexLocation () const
 
QString getModuleStandardIndexLocation () const
 
QString getUnlockInfo ()
 
std::shared_ptr< Language const > glossaryTargetlanguage () const
 
bool has (CSwordModuleInfo::Feature const feature) const noexcept
 
bool has (CSwordModuleInfo::FilterOption const &) const
 
bool hasIndex () const
 
bool hasVersion () const
 
::qint64 indexSize () const
 
bool isEncrypted () const
 
bool isHidden () const
 
bool isLocked () const
 
bool isUnicode () const noexcept
 
virtual bool isWritable () const
 
std::shared_ptr< Language const > language () const
 
sword::SWVersion minimumSwordVersion () const
 
QIcon moduleIcon () const
 
QString const & name () const
 
CSwordModuleInfooperator= (CSwordModuleInfo &&)=delete
 
CSwordModuleInfooperator= (CSwordModuleInfo const &)=delete
 
CSwordModuleSearch::ModuleResultList searchIndexed (QString const &searchedText, sword::ListKey const &scope) const
 
bool setHidden (bool hide)
 
sword::SWModule & swordModule () const
 
CSwordModuleInfo::TextDirection textDirection () const
 
char const * textDirectionAsHtml () const
 
ModuleType type () const
 
bool unlock (const QString &unlockKey)
 
bool unlockKeyIsValid () const
 
void write (CSwordKey *key, const QString &newText)
 

Private Attributes

QStringList m_entries
 
bool m_hasLeadingStrongsLetter = false
 
bool m_hasStrongsKeys = false
 
int m_strongsDigitsLength = 0
 

Additional Inherited Members

- Public Types inherited from CSwordModuleInfo
enum  Category {
  UnknownCategory = 0x0 , NoCategory = 0x0 , Bibles = 0x01 , Commentaries = 0x02 ,
  Books = 0x04 , Lexicons = 0x08 , Glossary = 0x10 , DailyDevotional = 0x20 ,
  Images = 0x40 , Cult = 0x80 , AllCategories = 0xff
}
 
enum  ConfigEntry {
  AboutInformation , AbsoluteDataPath , CipherKey , DataPath ,
  Description , ModuleVersion , MinimumSwordVersion , TextDir ,
  DisplayLevel , GlossaryFrom , GlossaryTo , DistributionLicense ,
  DistributionSource , DistributionNotes , TextSource , CopyrightNotes ,
  CopyrightHolder , CopyrightDate , CopyrightContactName , CopyrightContactAddress ,
  CopyrightContactEmail , Markup
}
 
enum  Feature {
  FeatureStrongsNumbers = 1 , FeatureGreekDef = 1 << 1 , FeatureHebrewDef = 1 << 2 , FeatureGreekParse = 1 << 3 ,
  FeatureHebrewParse = 1 << 4 , FeatureDailyDevotion = 1 << 5 , FeatureGlossary = 1 << 6 , FeatureImages = 1 << 7 ,
  FeatureNoParagraphs = 1 << 8
}
 
enum  ModuleType {
  Unknown , Bible , Commentary , Lexicon ,
  GenericBook
}
 
enum  TextDirection { LeftToRight , RightToLeft }
 
enum  UnlockErrorCode { noError , wrongUnlockKey , notLocked , noPermission }
 
- Public Slots inherited from CSwordModuleInfo
void cancelIndexing (std::memory_order const memoryOrder=std::memory_order_relaxed) noexcept
 
- Signals inherited from CSwordModuleInfo
void hasIndexChanged (bool hasIndex)
 
void hiddenChanged (bool hidden)
 
void indexingFinished ()
 
void indexingProgress (int)
 
void unlockedChanged (bool unlocked)
 
- Static Public Member Functions inherited from CSwordModuleInfo
static QIcon const & categoryIcon (CSwordModuleInfo::Category category)
 
static QString categoryName (const CSwordModuleInfo::Category &category)
 
static void deleteIndexForModule (const QString &name)
 
static QString getGlobalBaseIndexLocation ()
 
static QIcon const & moduleIcon (CSwordModuleInfo const &module)
 
- Static Public Attributes inherited from CSwordModuleInfo
static FilterOption const footnotes
 
static FilterOption const greekAccents
 
static FilterOption const headings
 
static FilterOption const hebrewCantillation
 
static FilterOption const hebrewPoints
 
static FilterOption const lemmas
 
static FilterOption const morphSegmentation
 
static FilterOption const morphTags
 
static FilterOption const redLetterWords
 
static FilterOption const scriptureReferences
 
static FilterOption const strongNumbers
 
static FilterOption const textualVariants
 
- Protected Member Functions inherited from CSwordModuleInfo
CSwordBackendbackend () const
 
 CSwordModuleInfo (sword::SWModule &module, CSwordBackend &backend, ModuleType type)
 
QString getFormattedConfigEntry (const QString &name) const
 
QString getSimpleConfigEntry (const QString &name) const
 
bool hasImportantFilterOption () const
 
void setImportantFilterOptions (bool enable)
 

Detailed Description

The implementation of CModuleInfo for the Sword lexiccons and citionaries.

Definition at line 28 of file cswordlexiconmoduleinfo.h.

Constructor & Destructor Documentation

◆ CSwordLexiconModuleInfo()

CSwordLexiconModuleInfo::CSwordLexiconModuleInfo ( sword::SWModule &  module,
CSwordBackend backend 
)

See if module keys are consistent with Strong's references and determine if keys start with "G" or "H" and the number of digits in the keys.

Definition at line 47 of file cswordlexiconmoduleinfo.cpp.

References m_hasLeadingStrongsLetter, m_hasStrongsKeys, and m_strongsDigitsLength.

Member Function Documentation

◆ createKey()

CSwordKey * CSwordLexiconModuleInfo::createKey ( ) const
finaloverridevirtual

Implements CSwordModuleInfo.

Definition at line 194 of file cswordlexiconmoduleinfo.cpp.

References CSwordModuleInfo::swordModule().

◆ entries()

const QStringList & CSwordLexiconModuleInfo::entries ( ) const

This method returns the entries of the modules represented by this object. If this function is called for the first time the list is load from disk and stored in a list which cahes it. If the function is called again, the cached list is returned so we have a major speed improvement.

Returns
the list of lexicon entries in the module.
Todo:
Document why the following code is here:

Definition at line 73 of file cswordlexiconmoduleinfo.cpp.

References CACHE_FORMAT, CSwordModuleInfo::config(), util::directory::getUserCacheDir(), CSwordModuleInfo::isUnicode(), m_entries, CSwordModuleInfo::ModuleVersion, CSwordModuleInfo::name(), snap(), CSwordModuleInfo::swordModule(), and util::cp1252::toUnicode().

Referenced by BtModuleTextModel::lexiconData().

◆ hasStrongsKeys()

bool CSwordLexiconModuleInfo::hasStrongsKeys ( ) const

Return true if this lexicon has Strong's keys

Definition at line 163 of file cswordlexiconmoduleinfo.cpp.

References m_hasStrongsKeys.

◆ normalizeStrongsKey()

QString CSwordLexiconModuleInfo::normalizeStrongsKey ( const QString &  key) const

Takes a Strong's key string and formats it consistent with the key strings of this module.

Definition at line 167 of file cswordlexiconmoduleinfo.cpp.

References m_hasLeadingStrongsLetter, and m_strongsDigitsLength.

◆ snap()

bool CSwordLexiconModuleInfo::snap ( ) const
finaloverridevirtual

Jumps to the closest entry in the module.

Reimplemented from CSwordModuleInfo.

Definition at line 160 of file cswordlexiconmoduleinfo.cpp.

References CSwordModuleInfo::swordModule().

Referenced by entries().

Member Data Documentation

◆ m_entries

QStringList CSwordLexiconModuleInfo::m_entries
mutableprivate

This is the list which caches the entres of the module.

Definition at line 70 of file cswordlexiconmoduleinfo.h.

Referenced by entries().

◆ m_hasLeadingStrongsLetter

bool CSwordLexiconModuleInfo::m_hasLeadingStrongsLetter = false
private

Definition at line 64 of file cswordlexiconmoduleinfo.h.

Referenced by CSwordLexiconModuleInfo(), and normalizeStrongsKey().

◆ m_hasStrongsKeys

bool CSwordLexiconModuleInfo::m_hasStrongsKeys = false
private

Definition at line 63 of file cswordlexiconmoduleinfo.h.

Referenced by CSwordLexiconModuleInfo(), and hasStrongsKeys().

◆ m_strongsDigitsLength

int CSwordLexiconModuleInfo::m_strongsDigitsLength = 0
private

Definition at line 65 of file cswordlexiconmoduleinfo.h.

Referenced by CSwordLexiconModuleInfo(), and normalizeStrongsKey().


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