Now saves using KwKWorshipFilter instead of KwDocument
[kworship.git] / kworship / kworship.h
blobbbb6772d370472fc232208502d4892450baf4f63
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>
30 #include <kdemacros.h>
32 #include <QModelIndex>
34 class kworshipView;
35 class KwLocalDisplay;
36 class KwLocalDisplayPreview;
37 class KwDisplayManager;
38 class KwPlaylistList;
39 class KwPlaylistModel;
40 class KwMediaManager;
41 class KwDocument;
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 KDE_EXPORT 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);
88 * Accessors
91 /// Get the main display manager.
92 KwDisplayManager* displayManager();
94 /// Get the current document.
95 KwDocument* document();
97 /// Get the playlist model.
98 KwPlaylistModel* playlistModel();
100 private slots:
101 void settingsChanged();
102 void toggleMainDisplay(bool checked);
103 void mainDisplayClosed();
104 void displayClear();
105 bool askToSave();
106 void fileNew();
107 void fileOpen();
108 void fileSave();
109 void fileSaveAs();
110 void toggleFullscreen(bool checked);
111 void optionsPreferences();
112 void playlist_doubleClicked(QModelIndex);
113 void playlistReset();
115 /// Add the new docker to the interface.
116 void newDocker(QDockWidget* docker);
118 void presentationDelete();
119 void presentationSelected(int);
120 void presentationToggled(bool);
121 void presentationPreviousSlide();
122 void presentationNextSlide();
123 void presentationPreviousStep();
124 void presentationNextStep();
125 void slide_doubleClicked(QModelIndex);
127 // Custom slideshows
128 void presentationComboReset();
129 void changeSlideshowCombo(QString name);
130 void changeSlideshowExternal(QString name);
131 void refreshSlideshows();
132 void refreshSlides();
133 void addSlideshowLinkToPlaylist();
134 void addSlideshowCopyToPlaylist();
136 // From current presentation
137 void slideshowStarted(int numSlides);
138 void slideshowStopped();
139 void slideshowSlideChanged(int slide, int numSteps);
140 void slideshowStepChanged(int step);
142 private:
143 void setupActions();
144 int getCorrectDisplayScreen();
145 int getCurrentDisplayScreen();
147 // Documents
148 void clearDocument();
149 // Presentations
150 void setPresentation(UpPresentation* presentation, bool alreadyDestroyed = false);
152 private:
153 Ui::prefs_base ui_prefs_base ;
154 Ui::prefsPresentations_base ui_prefsPresentations_base ;
155 kworshipView *m_view;
157 KwMediaManager* m_mediaManager;
158 KwDisplayManager* m_displayManager;
159 KwLocalDisplayController m_displayController;
160 KwLocalDisplay* m_mainDisplay;
161 KwLocalDisplayPreview* m_previewDisplay;
163 KwDocument* m_document;
164 KwPlaylistModel* m_playlistModel;
166 UpManager* m_presentationManager;
167 QTreeView* m_selectPresTree;
168 QTextEdit* m_slideNotes;
169 KAction* m_slideshowPrevSlideAction;
170 KAction* m_slideshowPrevStepAction;
171 KAction* m_slideshowNextStepAction;
172 KAction* m_slideshowNextSlideAction;
173 KToggleAction* m_slideshowAction;
174 UpPresentation* m_currentPresentation;
176 KPrinter *m_printer;
177 KToggleAction* m_mainDisplayAction;
178 KToggleAction *m_toolbarAction;
179 KToggleAction *m_statusbarAction;
182 #endif // _kworship_h_