Database: sqlite default to appdata kworship.db
[kworship.git] / unipresent / okular / UpOkProcess.h
blobc09568e198fada9034e7fc8aeaf5f3a977bb193e
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 _UpOkProcess_h_
21 #define _UpOkProcess_h_
23 /**
24 * @file UpOkProcess.h
25 * @brief Okular process.
26 * @author James Hogan <james@albanarts.com>
29 #include <QObject>
30 #include <QHash>
32 class UpPresentation;
33 class UpOkBackend;
34 class UpOkPresentation;
36 /** Okular process.
37 * This corresponds to a KPresenter dbus service.
39 class UpOkProcess : public QObject
41 Q_OBJECT
43 public:
46 * Constructors + destructor
49 /// Primary constructor.
50 UpOkProcess(QString serviceName, UpOkBackend* parent = 0);
52 /// Destructor.
53 virtual ~UpOkProcess();
56 * Basic accessors
59 /// Get the service name.
60 QString serviceName() const;
62 /// Get a list of presentations.
63 QList<UpOkPresentation*> presentations();
65 signals:
68 * Signals
71 /// Emitted when a new presentation is created or loaded.
72 void loadedPresentation(UpOkPresentation*);
74 /// Emitted when a presentation is about to be closed.
75 void unloadedPresentation(UpOkPresentation*);
77 private slots:
80 * Private slots
83 /// Indicates that a new presentation has been made available.
84 void dbusPresentationOpened(QString docName);
86 /// Indicates that an old presentation is no longer available.
87 void dbusPresentationClosed(QString docName);
89 private:
92 * Variables
95 /// Backend object.
96 UpOkBackend* m_backend;
98 /// DBus service name.
99 QString m_serviceName;
101 typedef QHash<QString, UpOkPresentation*> StringHashPresentation;
102 /// Presentations by name.
103 StringHashPresentation m_presentations;
107 #endif // _UpOkProcess_h_