Restructured main with new KwApplication and plugin manager to use it
[kworship.git] / kworship / KwBiblePlugin.h
blob0590c2103bbfda11be1527d880de28688d596e82
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * KWorship is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _KwBiblePlugin_h_
21 #define _KwBiblePlugin_h_
23 /**
24 * @file KwBiblePlugin.h
25 * @brief Bibles plugin.
26 * @author James Hogan <james@albanarts.com>
29 #include "KwPlugin.h"
31 class KwBibleManager;
33 class KAction;
35 class QDockWidget;
36 class QTabWidget;
37 class QComboBox;
38 class QLineEdit;
39 class QTextEdit;
40 class QToolBar;
42 /// Bibles plugin.
43 class KwBiblePlugin : public KwPlugin
45 Q_OBJECT
47 public:
50 * Constructors + destructor
53 /// Default constructor.
54 KwBiblePlugin();
56 /// Destructor.
57 virtual ~KwBiblePlugin();
59 private slots:
62 * Private slots
65 /// Fired when the connect to bible button is pressed.
66 void slotConnect();
68 /// Fired when the bible is changed.
69 void slotBibleChanged();
71 /// Fired when the bible book is changed.
72 void slotBookChanged();
74 /// Fired when the bible text needs to be retrieved.
75 void slotVerseRange();
77 /// Fired by the insert into playlist action.
78 void slotInsertIntoPlaylist();
80 /// Fired by the show now action.
81 void slotShowNow();
83 protected:
86 * Loading and unloading virtual interface
89 // Reimplemented
90 virtual void _load();
92 // Reimplemented
93 virtual void _unload();
95 private:
98 * Types
101 struct BibleManager
103 KwBibleManager* manager;
104 QComboBox* comboBibles;
105 QToolBar* toolBar;
109 * Private functions
112 /// Fill up the bibles list for a manager.
113 void fillBiblesList(BibleManager* mgr);
116 * Variables
119 /// The list of bible managers.
120 QList<BibleManager> m_managers;
123 * Actions
126 /// Action for inserting the current passage into the playlist.
127 KAction* m_insertIntoPlaylistAction;
129 /// Action for showing the current passage on the screen.
130 KAction* m_showNowAction;
133 * Widgets
136 /// Bible docker.
137 QDockWidget* m_docker;
139 /// Tabs for each bible manager.
140 QTabWidget* m_managerTabs;
142 /// Book of bible selector.
143 QComboBox* m_comboBook;
145 /// Chapter of bible book selector.
146 QComboBox* m_comboChapter;
148 /// Verse range box.
149 QLineEdit* m_editRange;
151 /// Main bible text display.
152 QTextEdit* m_textPassage;
155 #endif // _KwBiblePlugin_h_