mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
932b88f743
* opt: refactor dictionary logic to seperate class --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
35 lines
927 B
C++
35 lines
927 B
C++
/* Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
#ifndef DICTIONARYGROUP_HH_INCLUDED
|
|
#define DICTIONARYGROUP_HH_INCLUDED
|
|
|
|
#include "sptr.hh"
|
|
#include "dict/dictionary.hh"
|
|
#include "instances.hh"
|
|
|
|
class DictionaryGroup
|
|
{
|
|
public:
|
|
DictionaryGroup( std::vector< sptr< Dictionary::Class > > const & allDictionaries_,
|
|
Instances::Groups const & groups_ ):
|
|
allDictionaries( allDictionaries_ ),
|
|
groups( groups_ )
|
|
{
|
|
}
|
|
|
|
sptr< Dictionary::Class > getDictionaryByName( QString const & dictionaryName );
|
|
|
|
const std::vector< sptr< Dictionary::Class > > * getActiveDictionaries( unsigned groupId );
|
|
|
|
sptr< Dictionary::Class > getDictionaryById( const std::string & dictId );
|
|
|
|
Instances::Group const * getGroupById( unsigned groupId );
|
|
|
|
|
|
private:
|
|
std::vector< sptr< Dictionary::Class > > const & allDictionaries;
|
|
Instances::Groups const & groups;
|
|
};
|
|
|
|
#endif // DICTIONARYGROUP_HH_INCLUDED
|