BibleTime
cbooktreechooser.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-2025 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 "ckeychooser.h"
16
17#include <QList>
18#include <QObject>
19#include <QString>
20#include "../../backend/drivers/btmodulelist.h"
21#include "../../backend/keys/cswordtreekey.h"
22
23
25class CSwordKey;
26class QTreeWidget;
27class QTreeWidgetItem;
28class QWidget;
29
30class CBookTreeChooser final : public CKeyChooser {
31
32 Q_OBJECT
33
34public: // methods:
35
36 CBookTreeChooser(BtConstModuleList const & modules,
37 CSwordKey * key = nullptr,
38 QWidget * parent = nullptr);
39
40 void refreshContent() final override;
41 void setModules(BtConstModuleList const & modules,
42 bool refresh = true) final override;
43
44 CSwordKey * key() final override { return m_key; }
45 void setKey(CSwordKey * key) final override;
46
47protected: // Methods:
48
49 void showEvent(QShowEvent * const showEvent) override;
50
51public Q_SLOTS:
52
53 void updateKey(CSwordKey *) final override;
54
55private: // methods:
56
57 /** \brief Creates the first level of the tree structure. */
58 void setupTree();
59 void addKeyChildren(CSwordTreeKey * key, QTreeWidgetItem * item);
60 void adjustFont();
61
62private Q_SLOTS:
63
64 void itemActivated(QTreeWidgetItem * item);
65
66private: // fields:
67
68 QList<CSwordBookModuleInfo const *> m_modules;
71
72}; /* class CBookTreeChooser */
QList< CSwordModuleInfo const * > BtConstModuleList
QList< CSwordBookModuleInfo const * > m_modules
CSwordTreeKey * m_key
void updateKey(CSwordKey *) final override
void setKey(CSwordKey *key) final override
void showEvent(QShowEvent *const showEvent) override
QTreeWidget * m_treeView
void addKeyChildren(CSwordTreeKey *key, QTreeWidgetItem *item)
void setupTree()
Creates the first level of the tree structure.
CSwordKey * key() final override
void setModules(BtConstModuleList const &modules, bool refresh=true) final override
void itemActivated(QTreeWidgetItem *item)
void refreshContent() final override
Class for generic book support.
CSwordKey implementation for Sword's TreeKey.