Make presentation selection drop down display presentations from backend
[kworship.git] / unipresent / common / UpBackend.h
blob83e3e6e1bfe672ce084da042928ed0ecf519dc09
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 3 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, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
19 #ifndef _UpBackend_h_
20 #define _UpBackend_h_
22 /**
23 * @file UpBackend.h
24 * @brief An abstract presentation manager.
25 * @author James Hogan <james@albanarts.com>
28 #include <QObject>
29 #include <QString>
30 #include <QStringList>
31 #include <QUrl>
32 #include <QIcon>
34 class UpPresentation;
36 /** An abstract presentation manager.
37 * Inherit from this class to implement each backend.
39 class UpBackend : public QObject
41 Q_OBJECT
42 public:
45 * Constructors + destructor
48 /// Primary constructor.
49 UpBackend(QObject* parent = 0);
51 /// Destructor.
52 virtual ~UpBackend();
55 * General meta information
58 /// Get the name of the backend.
59 virtual QString name() const = 0;
61 /// Get a description of the backend.
62 virtual QString description() const = 0;
64 /// Get a list of supported mime types.
65 virtual QStringList mimeTypes() const = 0;
67 /// Get an icon for this backend.
68 virtual QIcon icon() const = 0;
71 * Activation
74 /** Ensure that the backend is active and ready.
75 * @return Whether the activation worked.
77 virtual bool activate() = 0;
79 /// Deactivate the backend.
80 virtual void deactivate() = 0;
83 * Presentation management
86 /// Get a list of presentations.
87 virtual QList<UpPresentation*> presentations() = 0;
89 /// Open a new presentation.
90 virtual UpPresentation* openPresentation(const QUrl& url) = 0;
92 signals:
95 * Signals
98 /// Fired when the backend is activated.
99 void activated();
101 /// Fired when the backend is deactivated.
102 void deactivated();
104 /// Fired when a new presentation is created or loaded.
105 void loadedPresentation(UpPresentation*);
107 /// Fired when a presentation is saved under a new name.
108 void savedAsPresentation(UpPresentation*);
110 /// Fired when a presentation is about to be closed.
111 void unloadedPresentation(UpPresentation*);
114 #endif // _UpBackend_h_