BibleTime
bttextwindowheader.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 <QWidget>
16
17#include <QList>
18#include "../../backend/drivers/cswordmoduleinfo.h"
19#include "../../backend/drivers/btmodulelist.h"
20
21
23
24class BtTextWindowHeader final: public QWidget {
25
26 Q_OBJECT
27
28public: /* Methods: */
29
31 BtModuleList modules,
32 QWidget * window = nullptr);
33
34public Q_SLOTS:
35
36 void setModules(BtModuleList newModules);
37
38Q_SIGNALS:
39
40 void moduleAdded(int index, CSwordModuleInfo * module);
41 void moduleReplaced(int index, CSwordModuleInfo * newModule);
42 void moduleRemoved(int index);
43
44private: /* Methods: */
45
46 /** Called when backend has changed and menus must be created from scratch.*/
47 void initMenus();
48
49 /** Updates all widgets without recreating them. */
50 void updateWidgets(BtModuleList const & modules);
51
52 /**
53 \brief Ensures exactly numModules widgets.
54 \param[in] numWidgets The exact number of widgets required.
55 */
56 void adjustWidgetCount(int const numWidgets);
57
58 /** Adds an empty widget to the header. */
60
61private: /* Fields: */
62
63 QList<BtTextWindowHeaderWidget *> m_widgetList;
65
66};
QList< CSwordModuleInfo * > BtModuleList
void moduleAdded(int index, CSwordModuleInfo *module)
void moduleReplaced(int index, CSwordModuleInfo *newModule)
BtTextWindowHeaderWidget * addWidget()
void adjustWidgetCount(int const numWidgets)
Ensures exactly numModules widgets.
void setModules(BtModuleList newModules)
void updateWidgets(BtModuleList const &modules)
CSwordModuleInfo::ModuleType const m_moduleType
void moduleRemoved(int index)
QList< BtTextWindowHeaderWidget * > m_widgetList