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 2 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, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
25 * @brief An abstract presentation manager.
26 * @author James Hogan <james@albanarts.com>
33 #include <QStringList>
39 /** An abstract presentation manager.
40 * Inherit from this class to implement each backend.
42 class UNIPRESENT_EXPORT UpBackend
: public QObject
48 * Constructors + destructor
51 /// Primary constructor.
52 UpBackend(QObject
* parent
= 0, const QStringList
& params
= QStringList());
58 * General meta information
61 /// Get the internal name of the backend.
62 virtual QString
id() const = 0;
64 /// Get the name of the backend.
65 virtual QString
name() const = 0;
67 /// Get a description of the backend.
68 virtual QString
description() const = 0;
70 /// Get a list of supported mime types.
71 virtual QStringList
mimeTypes() const = 0;
73 /// Get an icon for this backend.
74 virtual QIcon
icon() const = 0;
80 /** Find whether the backend is active and ready.
81 * @return Whether activated.
83 virtual bool isActive() = 0;
85 /** Ensure that the backend is active and ready.
86 * @return Whether the activation worked.
88 virtual bool activate() = 0;
90 /// Deactivate the backend.
91 virtual void deactivate() = 0;
94 * Presentation management
97 /// Get a list of presentations.
98 virtual QList
<UpPresentation
*> presentations() = 0;
100 /// Open a new presentation.
101 virtual bool openPresentation(const QUrl
& url
) = 0;
109 /// Emitted when the backend is activated.
112 /// Emitted when the backend is deactivated.
115 /// Emitted when a new presentation is created or loaded.
116 void loadedPresentation(UpPresentation
*);
118 /// Emitted when a presentation is about to be closed.
119 void unloadedPresentation(UpPresentation
*);
122 #endif // _UpBackend_h_