diff options
Diffstat (limited to 'src/backend/drivers/cswordlexiconmoduleinfo.h')
-rw-r--r-- | src/backend/drivers/cswordlexiconmoduleinfo.h | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/src/backend/drivers/cswordlexiconmoduleinfo.h b/src/backend/drivers/cswordlexiconmoduleinfo.h index 36d30fb..d75e106 100644 --- a/src/backend/drivers/cswordlexiconmoduleinfo.h +++ b/src/backend/drivers/cswordlexiconmoduleinfo.h @@ -2,7 +2,7 @@ * * This file is part of BibleTime's source code, http://www.bibletime.info/. * -* Copyright 1999-2008 by the BibleTime developers. +* Copyright 1999-2011 by the BibleTime developers. * The BibleTime source code is licensed under the GNU General Public License version 2.0. * **********/ @@ -16,55 +16,46 @@ /** - * The implementation of CModuleInfo for the Sword lexiccons and citionaries. - * @author The BibleTime team - * @version $Id: cswordlexiconmoduleinfo.h,v 1.12 2006/02/25 11:38:15 joachim Exp $ - */ + The implementation of CModuleInfo for the Sword lexiccons and citionaries. +*/ +class CSwordLexiconModuleInfo: public CSwordModuleInfo { + Q_OBJECT -class CSwordLexiconModuleInfo : public CSwordModuleInfo { + public: /* Methods: */ + inline CSwordLexiconModuleInfo(sword::SWModule *module, + CSwordBackend * const backend) + : CSwordModuleInfo(module, backend, Lexicon) {} + + inline CSwordLexiconModuleInfo(const CSwordLexiconModuleInfo ©) + : CSwordModuleInfo(copy), m_entries(copy.m_entries) {} + + /* Reimplementation of CSwordModuleInfo::clone(). */ + virtual inline CSwordModuleInfo *clone() const { + return new CSwordLexiconModuleInfo(*this); + } - public: - /** - * The standard constructor fot this object. - * A default constructor doesn't exist. Use this one. - */ - CSwordLexiconModuleInfo( sword::SWModule* module, CSwordBackend* const ); - /** - * The copy constructor - */ - CSwordLexiconModuleInfo( const CSwordLexiconModuleInfo& m ); - /** Reimplementation to return a valid clone. - */ - virtual CSwordModuleInfo* clone(); - /** Destructor. - */ - virtual ~CSwordLexiconModuleInfo(); - /** - * Returns the entries of the module. - * This function 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. - * @return The list of lexicon entries - */ - QStringList* entries(); /** - * Reimplementation, to return the right type for this lexicon. + 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. */ - virtual CSwordModuleInfo::ModuleType type() const; + const QStringList &entries() const; + /** - * Jumps to the closest entry in the module. + Jumps to the closest entry in the module. */ - bool snap(); + virtual inline bool snap() const { + return module()->getRawEntry(); + } - private: + private: /* Fields: */ /** - * This is the list which caches the entres of the module. + This is the list which caches the entres of the module. */ - QStringList* m_entryList; + mutable QStringList m_entries; }; -inline CSwordModuleInfo::ModuleType CSwordLexiconModuleInfo::type() const { - return CSwordModuleInfo::Lexicon; -} - #endif |