BibleTime
src
backend
bookshelfmodel
indexingitem.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 "../drivers/cswordmoduleinfo.h"
20
21
22
namespace
BookshelfModel
{
23
24
class
IndexingItem
:
public
GroupItem
<Item::ITEM_INDEXING> {
25
26
public
:
// methods:
27
28
IndexingItem
(
CSwordModuleInfo
const
& module)
29
:
m_indexed
(module.hasIndex()) {}
30
31
QVariant
data
(
int
role = Qt::DisplayRole)
const override
;
32
33
bool
fitFor
(
CSwordModuleInfo
const
& module)
const override
34
{
return
module.
hasIndex
() ==
m_indexed
; }
35
36
private
:
// fields:
37
38
bool
m_indexed
;
39
40
};
41
42
}
// namespace BookshelfModel
BookshelfModel::GroupItem
Definition:
item.h:159
BookshelfModel::IndexingItem
Definition:
indexingitem.h:24
BookshelfModel::IndexingItem::m_indexed
bool m_indexed
Definition:
indexingitem.h:38
BookshelfModel::IndexingItem::fitFor
bool fitFor(CSwordModuleInfo const &module) const override
Returns whether this item is fit to contain the given module.
Definition:
indexingitem.h:33
BookshelfModel::IndexingItem::IndexingItem
IndexingItem(CSwordModuleInfo const &module)
Definition:
indexingitem.h:28
BookshelfModel::IndexingItem::data
QVariant data(int role=Qt::DisplayRole) const override
Returns data for this item.
Definition:
indexingitem.cpp:21
CSwordModuleInfo
Definition:
cswordmoduleinfo.h:49
CSwordModuleInfo::hasIndex
bool hasIndex() const
Definition:
cswordmoduleinfo.cpp:352
item.h
BookshelfModel
Definition:
btbookshelftreemodel.h:32
Generated by
1.9.1