BibleTime
btmodulechooserbar.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 <QToolBar>
16
17#include <QList>
18#include <optional>
19#include "../../backend/drivers/btmodulelist.h"
20#include "../../backend/drivers/cswordmoduleinfo.h"
21
22
23class CDisplayWindow;
25
26class BtModuleChooserBar final: public QToolBar {
27
28 Q_OBJECT
29
30public:
31
33
34 /** Initialize with module list.*/
36
37private Q_SLOTS:
38
39 void setModules(BtModuleList newModules);
40
41private: /* Methods: */
42
43 /**
44 \brief Adds an empty button to the toolbar.
45 \param[in] window The display window to connect the button with.
46 */
48
49 /** Updates every button's menu without recreating it.*/
50 void updateButtonMenus(BtModuleList const & modules);
51
52 /**
53 \brief Ensures exactly numButtons buttons..
54 \param[in] numButtons The exact number of buttons required.
55 \param[in] window The display window to connect the buttons with.
56 */
57 void adjustButtonCount(int const numButtons,
58 CDisplayWindow * const window);
59
60private: /* Fields: */
61
62 QList<BtModuleChooserButton *> m_buttonList;
63 std::optional<CSwordModuleInfo::ModuleType> m_moduleType;
64
65};
QList< CSwordModuleInfo * > BtModuleList
void updateButtonMenus(BtModuleList const &modules)
void associateWithWindow(CDisplayWindow *window)
QList< BtModuleChooserButton * > m_buttonList
void adjustButtonCount(int const numButtons, CDisplayWindow *const window)
Ensures exactly numButtons buttons..
void setModules(BtModuleList newModules)
BtModuleChooserButton * addButton(CDisplayWindow *const window)
Adds an empty button to the toolbar.
std::optional< CSwordModuleInfo::ModuleType > m_moduleType
The base class for all display windows of BibleTime.