Restructured main with new KwApplication and plugin manager to use it
[kworship.git] / kworship / kworship.h
blob62be6b32daa587ee1a93655160e41ed77ef0e8df
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 KwSongdbModel;
42 class KwSongdbTree;
44 class UpManager;
45 class UpPresentation;
47 class KPrinter;
48 class KToggleAction;
49 class KUrl;
50 class KAction;
51 class KActionMenu;
52 class KToggleAction;
54 class QTreeView;
55 class QTextEdit;
57 /**
58 * This class serves as the main window for kworship. It handles the
59 * menus, toolbars, and status bars.
61 * @short Main window class
62 * @author Andreas Pakulat <apaku@gmx.de>
63 * @version 0.1
65 class kworship : public KXmlGuiWindow
67 Q_OBJECT
68 public:
69 /**
70 * Default Constructor
72 kworship();
74 /**
75 * Default Destructor
77 virtual ~kworship();
80 * Public interface
83 /// Load a specified playlist.
84 void loadPlaylist(const KUrl& url);
87 * Accessors
90 /// Get the main display manager.
91 KwDisplayManager* displayManager();
93 /// Get the current document.
94 KwDocument* document();
96 /// Get the playlist model.
97 KwPlaylistModel* playlistModel();
99 private slots:
100 void settingsChanged();
101 void toggleMainDisplay(bool checked);
102 void mainDisplayClosed();
103 void displayClear();
104 bool askToSave();
105 void fileNew();
106 void fileOpen();
107 void fileSave();
108 void fileSaveAs();
109 void toggleFullscreen(bool checked);
110 void optionsPreferences();
111 void playlist_doubleClicked(QModelIndex);
112 void playlistReset();
114 /// Add the new docker to the interface.
115 void newDocker(QDockWidget* docker);
117 void presentationDelete();
118 void presentationSelected(int);
119 void presentationToggled(bool);
120 void presentationPreviousSlide();
121 void presentationNextSlide();
122 void presentationPreviousStep();
123 void presentationNextStep();
124 void slide_doubleClicked(QModelIndex);
126 // Custom slideshows
127 void presentationComboReset();
128 void changeSlideshowCombo(QString name);
129 void changeSlideshowExternal(QString name);
130 void refreshSlideshows();
131 void refreshSlides();
132 void addSlideshowLinkToPlaylist();
133 void addSlideshowCopyToPlaylist();
135 // From current presentation
136 void slideshowStarted(int numSlides);
137 void slideshowStopped();
138 void slideshowSlideChanged(int slide, int numSteps);
139 void slideshowStepChanged(int step);
141 // Song DB
142 void songdbUnlock();
143 void songdbLock();
144 void songdbAdd();
145 void songdbEdit();
146 void songdbEditSongBooks();
148 private:
149 void setupActions();
150 int getCorrectDisplayScreen();
151 int getCurrentDisplayScreen();
153 // Documents
154 void setDocument(KUrl url = KUrl());
155 // Presentations
156 void setPresentation(UpPresentation* presentation, bool alreadyDestroyed = false);
158 private:
159 Ui::prefs_base ui_prefs_base ;
160 Ui::prefsPresentations_base ui_prefsPresentations_base ;
161 kworshipView *m_view;
163 KwMediaManager* m_mediaManager;
164 KwDisplayManager* m_displayManager;
165 KwLocalDisplayController m_displayController;
166 KwLocalDisplay* m_mainDisplay;
167 KwLocalDisplayPreview* m_previewDisplay;
169 KwDocument* m_document;
170 KwPlaylistModel* m_playlistModel;
172 KwSongdbModel* m_songDbModel;
173 KwSongdbTree* m_songDbTree;
174 KAction* m_unlockSongDbAction;
175 KAction* m_lockSongDbAction;
176 KActionMenu* m_groupSongsByAction;
177 KAction* m_addSongAction;
178 KAction* m_editSongAction;
179 KAction* m_editSongBooksAction;
181 UpManager* m_presentationManager;
182 QTreeView* m_selectPresTree;
183 QTextEdit* m_slideNotes;
184 KAction* m_slideshowPrevSlideAction;
185 KAction* m_slideshowPrevStepAction;
186 KAction* m_slideshowNextStepAction;
187 KAction* m_slideshowNextSlideAction;
188 KToggleAction* m_slideshowAction;
189 UpPresentation* m_currentPresentation;
191 KPrinter *m_printer;
192 KToggleAction* m_mainDisplayAction;
193 KToggleAction *m_toolbarAction;
194 KToggleAction *m_statusbarAction;
197 #endif // _kworship_h_