Database: sqlite default to appdata kworship.db
[kworship.git] / unipresent / kpresenter2 / UpKpr2Process.h
blobfb5738517816b7038587cce85aef9fce16567e88
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 _UpKpr2Process_h_
21 #define _UpKpr2Process_h_
23 /**
24 * @file UpKpr2Process.h
25 * @brief KPresenter 2 process.
26 * @author James Hogan <james@albanarts.com>
29 #include <QObject>
30 #include <QHash>
32 class UpPresentation;
33 class UpKpr2Backend;
34 class UpKpr2Presentation;
36 /** KPresenter 2 process.
37 * This corresponds to a KPresenter dbus service.
39 class UpKpr2Process : public QObject
41 Q_OBJECT
43 public:
46 * Constructors + destructor
49 /// Primary constructor.
50 UpKpr2Process(QString serviceName, UpKpr2Backend* parent = 0);
52 /// Destructor.
53 virtual ~UpKpr2Process();
56 * Basic accessors
59 /// Get the service name.
60 QString serviceName() const;
62 /// Get a list of presentations.
63 QList<UpKpr2Presentation*> presentations();
65 signals:
68 * Signals
71 /// Emitted when a new presentation is created or loaded.
72 void loadedPresentation(UpKpr2Presentation*);
74 /// Emitted when a presentation is about to be closed.
75 void unloadedPresentation(UpKpr2Presentation*);
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 UpKpr2Backend* m_backend;
98 /// DBus service name.
99 QString m_serviceName;
101 typedef QHash<QString, UpKpr2Presentation*> StringHashPresentation;
102 /// Presentations by name.
103 StringHashPresentation m_presentations;
107 #endif // _UpKpr2Process_h_