Database: sqlite default to appdata kworship.db
[kworship.git] / unipresent / kpresenter1 / UpKpr1PresentationDcop.cpp
blob2b17accf55f67c90d61a66674269c9e12606e3d8
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 /**
21 * @file UpKpr1PresentationDcop.cpp
22 * @brief DCOP interface for a kpresenter document.
23 * @author James Hogan <james@albanarts.com>
26 #include "UpKpr1PresentationDcop.h"
29 * Constructors + destructor
32 /// Primary constructor.
33 UpKpr1PresentationDcop::UpKpr1PresentationDcop(const UpKpr1Dcop& interface)
34 : UpKpr1Dcop(interface)
38 /// Destructor.
39 UpKpr1PresentationDcop::~UpKpr1PresentationDcop()
44 * Main interface
47 /// Get the document url.
48 QUrl UpKpr1PresentationDcop::url() const
50 bool error;
51 QString result = eval(&error, QStringList() << "url()");
52 if (!error)
54 return QUrl(result);
56 else
58 return QUrl();
62 /// Get the number of slides.
63 int UpKpr1PresentationDcop::numPages() const
65 return evalInt(QStringList() << "numPages()", 0);
68 /// Get a particular slide by id.
69 UpKpr1SlideDcop UpKpr1PresentationDcop::slide(int index) const
71 QString num;
72 num.setNum(index);
73 return evalRef(QStringList() << "page(int)" << num);
76 /// Get the view for this presentation.
77 UpKpr1ViewDcop UpKpr1PresentationDcop::view(int index) const
79 QString num;
80 num.setNum(index);
81 return evalRef(QStringList() << "view(int)" << num);