Database: sqlite default to appdata kworship.db
[kworship.git] / unipresent / okular / UpOkBackend.h
blob7f242d7f71fd214e53185f54ddea991b9b9c1df3
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008-2009 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 _UpOkBackend_h_
21 #define _UpOkBackend_h_
23 /**
24 * @file UpOkBackend.h
25 * @brief Okular presentation manager.
26 * @author James Hogan <james@albanarts.com>
29 #include "UpBackend.h"
31 #include <QHash>
33 class UpOkProcess;
34 class UpOkPresentation;
36 /** Okular presentation manager.
37 * This uses a nice dbus interface.
39 class UpOkBackend : public UpBackend
41 Q_OBJECT
43 public:
46 * Constructors + destructor
49 /// Primary constructor.
50 UpOkBackend(QObject* parent = 0, const QStringList& params = QStringList());
52 /// Destructor.
53 virtual ~UpOkBackend();
56 * General meta information
59 virtual QString id() const;
60 virtual QString name() const;
61 virtual QString description() const;
62 virtual QStringList mimeTypes() const;
63 virtual QIcon icon() const;
66 * Activation
69 virtual bool isActive();
70 virtual bool activate();
71 virtual void deactivate();
74 * Presentation management
77 virtual QList<UpPresentation*> presentations();
78 virtual bool openPresentation(const QUrl& url);
80 private slots:
83 * Private slots
86 /// DBus service ownership change.
87 void dbusServiceOwnerChange(const QString& name, const QString& oldOwner, const QString& newOwner);
89 // Slots for UpOkProcess signals
90 void dbusLoadedPresentation(UpOkPresentation*);
91 void dbusUnloadedPresentation(UpOkPresentation*);
93 private:
96 * Variables
99 typedef QHash<QString,UpOkProcess*> QStringHashProcess;
100 /// The okular processes.
101 QStringHashProcess m_processes;
103 /// List of presentations.
104 QList<UpPresentation*> m_presentations;
108 #endif // _UpOkBackend_h_