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