1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
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. *
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. *
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 ***************************************************************************/
24 * @brief An abstract presentation manager.
25 * @author James Hogan <james@albanarts.com>
30 #include <QStringList>
36 /** An abstract presentation manager.
37 * Inherit from this class to implement each backend.
39 class UpBackend
: public QObject
45 * Constructors + destructor
48 /// Primary constructor.
49 UpBackend(QObject
* parent
= 0);
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;
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;
98 /// Fired when the backend is activated.
101 /// Fired when the backend is 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_