BibleTime
bibletimeapp.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 <QApplication>
16 
17 #include "../backend/managers/cswordbackend.h"
18 #include <optional>
19 #include <QObject>
20 #include <QString>
21 
22 
23 class BtIcons;
24 
25 /**
26  The BibleTimeApp class is used to clean up all instances of the backend and to
27  delete all created module objects.
28 */
29 class BibleTimeApp : public QApplication {
30 
31  Q_OBJECT
32 
33 public: // methods:
34 
35  BibleTimeApp(int &argc, char **argv);
36  ~BibleTimeApp() override;
37 
38  void startInit() { m_init = true; }
39 
40  bool initBtConfig();
41  void initLightDarkPalette();
43  void initIcons();
44  void initBackends();
45 
46  bool debugMode() const noexcept { return m_debugMode; }
47  void setDebugMode(bool const debugMode) noexcept
48  { m_debugMode = debugMode; }
49 
50 private: // fields:
51 
52  bool m_init;
55  std::optional<CSwordBackend> m_backend;
56 
57 };
58 
59 #define btApp (static_cast<BibleTimeApp *>(BibleTimeApp::instance()))
void startInit()
Definition: bibletimeapp.h:38
bool initDisplayTemplateManager()
std::optional< CSwordBackend > m_backend
Definition: bibletimeapp.h:55
bool debugMode() const noexcept
Definition: bibletimeapp.h:46
BibleTimeApp(int &argc, char **argv)
void setDebugMode(bool const debugMode) noexcept
Definition: bibletimeapp.h:47
void initLightDarkPalette()
void initBackends()
BtIcons * m_icons
Definition: bibletimeapp.h:54
bool initBtConfig()
~BibleTimeApp() override
bool m_debugMode
Definition: bibletimeapp.h:53