BibleTime
languageitem.h
Go to the documentation of this file.
1 /*********
2 *
3 * In the name of the Father, and of the Son, and of the Holy Spirit.
4 *
5 * This file is part of BibleTime's source code, https://bibletime.info/
6 *
7 * Copyright 1999-2021 by the BibleTime developers.
8 * The BibleTime source code is licensed under the GNU General Public License
9 * version 2.0.
10 *
11 **********/
12 
13 #pragma once
14 
15 #include "item.h"
16 
17 #include <Qt>
18 #include <QVariant>
19 #include <memory>
20 #include "../drivers/cswordmoduleinfo.h"
21 
22 
23 class Language;
24 
25 namespace BookshelfModel {
26 
27 class LanguageItem: public GroupItem<Item::ITEM_LANGUAGE> {
28 
29 public: // methods:
30 
32  : m_language(module.language()) {}
33 
34  QVariant data(int role = Qt::DisplayRole) const override;
35 
36  bool fitFor(CSwordModuleInfo const & module) const override
37  { return module.language() == m_language; }
38 
39 private: // fields:
40 
41  std::shared_ptr<Language const> m_language;
42 
43 };
44 
45 } // namespace BookshelfModel
bool fitFor(CSwordModuleInfo const &module) const override
Returns whether this item is fit to contain the given module.
Definition: languageitem.h:36
LanguageItem(CSwordModuleInfo const &module)
Definition: languageitem.h:31
QVariant data(int role=Qt::DisplayRole) const override
Returns data for this item.
std::shared_ptr< Language const > m_language
Definition: languageitem.h:41
std::shared_ptr< Language const > language() const