Database: sqlite default to appdata kworship.db
[kworship.git] / unipresent / common / UpPresentation.h
blobc68b6551636b5b3a0e7bfe6584aad365f4d784ac
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 _UpPresentation_h_
21 #define _UpPresentation_h_
23 /**
24 * @file UpPresentation.h
25 * @brief An abstract presentation document.
26 * @author James Hogan <james@albanarts.com>
29 #include "UpExport.h"
31 #include <QObject>
32 #include <QUrl>
34 class UpSlide;
35 class UpBackend;
37 /** An abstract presentation document.
38 * Inherit from this class to implement each backend's presentation.
40 class UNIPRESENT_EXPORT UpPresentation : public QObject
42 Q_OBJECT
43 public:
46 * Constructors + destructor
49 /// Primary constructor.
50 UpPresentation(UpBackend* backend, QObject* parent = 0);
52 /// Destructor.
53 virtual ~UpPresentation();
56 * Accessors
59 /// Get the backend.
60 UpBackend* backend();
63 * Main interface
66 /// Close this presentation.
67 virtual void close() = 0;
69 /// Get the url.
70 virtual QUrl url() const = 0;
73 * Custom slideshows
76 /// Get the current slideshow name.
77 virtual QString currentSlideshow() = 0;
79 /// Get a list of slideshow names.
80 virtual QStringList slideshows() = 0;
82 /// Set the current slideshow.
83 virtual void setSlideshow(QString slideshow) = 0;
85 /// Get the number of slides in the current slideshow.
86 virtual int numSlides() = 0;
88 /// Get a specific slide from the current slideshow.
89 virtual UpSlide* slide(int index) = 0;
92 * Slideshow accessors
95 /// Find whether the slideshow is running.
96 virtual bool isSlideshowRunning() = 0;
98 /// Find the number of slides in the slideshow.
99 virtual int numSlidesInSlideshow() = 0;
101 /// Find the current slide number.
102 virtual int currentSlideshowSlide() = 0;
104 /// Find the number of steps in the current slide.
105 virtual int stepsInCurrentSlideshowSlide() = 0;
107 /// Find the current step within the slide.
108 virtual int currentSlideshowStep() = 0;
111 * Slideshow control
114 /// Start the slideshow.
115 virtual void startSlideshow() = 0;
117 /// Stop the slideshow.
118 virtual void stopSlideshow() = 0;
120 /// Go to a specific slide.
121 virtual void goToSlide(int index) = 0;
123 /// Go back to the previous slide.
124 virtual void previousSlide() = 0;
126 /// Go on to the next slide.
127 virtual void nextSlide() = 0;
129 /// Go back to the previous step.
130 virtual void previousStep() = 0;
132 /// Trigger the next step.
133 virtual void nextStep() = 0;
135 signals:
138 * Signals
141 /// Fired when the current slideshow is changed.
142 void currentSlideshowChanged(QString slideshow);
144 /// Fired when custom slideshows have been modified.
145 void customSlideshowsModified();
148 /// Fired when the slideshow starts.
149 void slideshowStarted(int numSlides);
151 /// Fired when the slideshow stops.
152 void slideshowStopped();
154 /// Fired when the current slide changes.
155 void slideshowSlideChanged(int slide, int numSteps);
157 /// Fired when the current step changes.
158 void slideshowStepChanged(int step);
160 private:
163 * Variables
166 /// Backend this presentation is associated with.
167 UpBackend* m_backend;
170 #endif // _UpPresentation_h_