BibleTime
src
frontend
displaywindow
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-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 <QWidget>
16
17
#include <QList>
18
#include "../../backend/drivers/cswordmoduleinfo.h"
19
#include "../../backend/drivers/btmodulelist.h"
20
21
22
class
BtTextWindowHeaderWidget
;
23
24
class
BtTextWindowHeader
final:
public
QWidget
{
25
26
Q_OBJECT
27
28
public
:
/* Methods: */
29
30
BtTextWindowHeader
(
CSwordModuleInfo::ModuleType
modtype,
31
BtModuleList
modules,
32
QWidget
* window =
nullptr
);
33
34
public
Q_SLOTS:
35
36
void
setModules
(
BtModuleList
newModules);
37
38
Q_SIGNALS:
39
40
void
moduleAdded
(
int
index,
CSwordModuleInfo
* module);
41
void
moduleReplaced
(
int
index,
CSwordModuleInfo
* newModule);
42
void
moduleRemoved
(
int
index);
43
44
private
:
/* 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. */
59
BtTextWindowHeaderWidget
*
addWidget
();
60
61
private
:
/* Fields: */
62
63
QList<BtTextWindowHeaderWidget *>
m_widgetList
;
64
CSwordModuleInfo::ModuleType
const
m_moduleType
;
65
66
};
BtModuleList
QList< CSwordModuleInfo * > BtModuleList
Definition:
btmodulelist.h:20
BtTextWindowHeaderWidget
Definition:
bttextwindowheaderwidget.h:36
BtTextWindowHeader
Definition:
bttextwindowheader.h:24
BtTextWindowHeader::moduleAdded
void moduleAdded(int index, CSwordModuleInfo *module)
BtTextWindowHeader::moduleReplaced
void moduleReplaced(int index, CSwordModuleInfo *newModule)
BtTextWindowHeader::addWidget
BtTextWindowHeaderWidget * addWidget()
Definition:
bttextwindowheader.cpp:66
BtTextWindowHeader::adjustWidgetCount
void adjustWidgetCount(int const numWidgets)
Ensures exactly numModules widgets.
Definition:
bttextwindowheader.cpp:49
BtTextWindowHeader::setModules
void setModules(BtModuleList newModules)
Definition:
bttextwindowheader.cpp:44
BtTextWindowHeader::initMenus
void initMenus()
BtTextWindowHeader::updateWidgets
void updateWidgets(BtModuleList const &modules)
Definition:
bttextwindowheader.cpp:79
BtTextWindowHeader::m_moduleType
CSwordModuleInfo::ModuleType const m_moduleType
Definition:
bttextwindowheader.h:64
BtTextWindowHeader::BtTextWindowHeader
BtTextWindowHeader(CSwordModuleInfo::ModuleType modtype, BtModuleList modules, QWidget *window=nullptr)
Definition:
bttextwindowheader.cpp:26
BtTextWindowHeader::moduleRemoved
void moduleRemoved(int index)
BtTextWindowHeader::m_widgetList
QList< BtTextWindowHeaderWidget * > m_widgetList
Definition:
bttextwindowheader.h:63
CSwordModuleInfo
Definition:
cswordmoduleinfo.h:49
CSwordModuleInfo::ModuleType
ModuleType
Definition:
cswordmoduleinfo.h:87
QList
QWidget
Generated by
1.9.1