Simple plugin system and added bibles docker to it
[kworship.git] / kworship / kworship.h
blob236e3c374ba97ccc250ad7124075ff0f2875376a
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 _kworship_h_
21 #define _kworship_h_
23 #include "ui_prefs_base.h"
24 #include "ui_prefsDisplay_base.h"
25 #include "ui_prefsSongDB_base.h"
26 #include "ui_prefsPresentations_base.h"
27 #include "KwLocalDisplayController.h"
29 #include <kxmlguiwindow.h>
31 #include <QModelIndex>
33 class kworshipView;
34 class KwLocalDisplay;
35 class KwLocalDisplayPreview;
36 class KwDisplayManager;
37 class KwPlaylistList;
38 class KwPlaylistModel;
39 class KwMediaManager;
40 class KwDocument;
41 class KwPluginManager;
42 class KwSongdbModel;
43 class KwSongdbTree;
45 class UpManager;
46 class UpPresentation;
48 class KPrinter;
49 class KToggleAction;
50 class KUrl;
51 class KAction;
52 class KActionMenu;
53 class KToggleAction;
55 class QTreeView;
56 class QTextEdit;
58 /**
59 * This class serves as the main window for kworship. It handles the
60 * menus, toolbars, and status bars.
62 * @short Main window class
63 * @author Andreas Pakulat <apaku@gmx.de>
64 * @version 0.1
66 class kworship : public KXmlGuiWindow
68 Q_OBJECT
69 public:
70 /**
71 * Default Constructor
73 kworship();
75 /**
76 * Default Destructor
78 virtual ~kworship();
81 * Public interface
84 /// Load a specified playlist.
85 void loadPlaylist(const KUrl& url);
87 private slots:
88 void settingsChanged();
89 void toggleMainDisplay(bool checked);
90 void mainDisplayClosed();
91 void displayClear();
92 bool askToSave();
93 void fileNew();
94 void fileOpen();
95 void fileSave();
96 void fileSaveAs();
97 void toggleFullscreen(bool checked);
98 void optionsPreferences();
99 void playlist_doubleClicked(QModelIndex);
100 void playlistReset();
102 /// Add the new docker to the interface.
103 void newDocker(QDockWidget* docker);
105 void presentationDelete();
106 void presentationSelected(int);
107 void presentationToggled(bool);
108 void presentationPreviousSlide();
109 void presentationNextSlide();
110 void presentationPreviousStep();
111 void presentationNextStep();
112 void slide_doubleClicked(QModelIndex);
114 // Custom slideshows
115 void presentationComboReset();
116 void changeSlideshowCombo(QString name);
117 void changeSlideshowExternal(QString name);
118 void refreshSlideshows();
119 void refreshSlides();
120 void addSlideshowLinkToPlaylist();
121 void addSlideshowCopyToPlaylist();
123 // From current presentation
124 void slideshowStarted(int numSlides);
125 void slideshowStopped();
126 void slideshowSlideChanged(int slide, int numSteps);
127 void slideshowStepChanged(int step);
129 // Song DB
130 void songdbUnlock();
131 void songdbLock();
132 void songdbAdd();
133 void songdbEdit();
134 void songdbEditSongBooks();
136 private:
137 void setupActions();
138 int getCorrectDisplayScreen();
139 int getCurrentDisplayScreen();
141 // Documents
142 void setDocument(KUrl url = KUrl());
143 // Presentations
144 void setPresentation(UpPresentation* presentation, bool alreadyDestroyed = false);
146 private:
147 Ui::prefs_base ui_prefs_base ;
148 Ui::prefsPresentations_base ui_prefsPresentations_base ;
149 kworshipView *m_view;
151 KwMediaManager* m_mediaManager;
152 KwDisplayManager* m_displayManager;
153 KwLocalDisplayController m_displayController;
154 KwLocalDisplay* m_mainDisplay;
155 KwLocalDisplayPreview* m_previewDisplay;
157 KwDocument* m_document;
158 KwPlaylistModel* m_playlistModel;
160 // Plugins
161 KwPluginManager* m_plugins;
163 KwSongdbModel* m_songDbModel;
164 KwSongdbTree* m_songDbTree;
165 KAction* m_unlockSongDbAction;
166 KAction* m_lockSongDbAction;
167 KActionMenu* m_groupSongsByAction;
168 KAction* m_addSongAction;
169 KAction* m_editSongAction;
170 KAction* m_editSongBooksAction;
172 UpManager* m_presentationManager;
173 QTreeView* m_selectPresTree;
174 QTextEdit* m_slideNotes;
175 KAction* m_slideshowPrevSlideAction;
176 KAction* m_slideshowPrevStepAction;
177 KAction* m_slideshowNextStepAction;
178 KAction* m_slideshowNextSlideAction;
179 KToggleAction* m_slideshowAction;
180 UpPresentation* m_currentPresentation;
182 KPrinter *m_printer;
183 KToggleAction* m_mainDisplayAction;
184 KToggleAction *m_toolbarAction;
185 KToggleAction *m_statusbarAction;
188 #endif // _kworship_h_