Database: sqlite default to appdata kworship.db
[kworship.git] / unipresent / common / UpBackend.h
blob873ba86fca76691cded6bcf3ce8d1da8654a2117
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 _UpBackend_h_
21 #define _UpBackend_h_
23 /**
24 * @file UpBackend.h
25 * @brief An abstract presentation manager.
26 * @author James Hogan <james@albanarts.com>
29 #include "UpExport.h"
31 #include <QObject>
32 #include <QString>
33 #include <QStringList>
34 #include <QUrl>
35 #include <QIcon>
37 class UpPresentation;
39 /** An abstract presentation manager.
40 * Inherit from this class to implement each backend.
42 class UNIPRESENT_EXPORT UpBackend : public QObject
44 Q_OBJECT
45 public:
48 * Constructors + destructor
51 /// Primary constructor.
52 UpBackend(QObject* parent = 0, const QStringList& params = QStringList());
54 /// Destructor.
55 virtual ~UpBackend();
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;
77 * Activation
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;
103 signals:
106 * Signals
109 /// Emitted when the backend is activated.
110 void activated();
112 /// Emitted when the backend is deactivated.
113 void 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_