Plugin system for bible backends and various tweaks to plugin code included debug...
[kworship.git] / kworship / bible / biblegateway / KwBibleModuleBibleGateway.h
blob80a8609b1477eafa207e13f889ef6a0e986c0c55
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 _KwBibleModuleBibleGateway_h_
21 #define _KwBibleModuleBibleGateway_h_
23 /**
24 * @file KwBibleModuleBibleGateway.h
25 * @brief A BibleGateway bible module.
26 * @author James Hogan <james@albanarts.com>
29 #include "KwBibleModule.h"
31 #include <KUrl>
33 #include <QList>
35 /// A BibleGateway bible module.
36 class KwBibleModuleBibleGateway : public KwBibleModule
38 public:
41 * Constructors + destructor
44 /// Default constructor.
45 KwBibleModuleBibleGateway(int id);
47 /// Destructor.
48 virtual ~KwBibleModuleBibleGateway();
51 * Main interface
54 // Reimplemented
55 virtual QString name();
57 // Reimplemented
58 virtual QString description();
60 // Reimplemented
61 virtual QString managerId();
63 // Reimplemented
64 virtual int numChapters(int book);
66 // Reimplemented
67 virtual int numVerses(int book, int chapter);
69 // Reimplemented
70 virtual bool fillPassageVerse(int bookIndex, int chapterIndex, int verseIndex, KwBiblePassage* outPassage);
72 protected:
75 * Protected virtual interface
78 // Reimplemented
79 virtual void obtainBooks();
81 private:
84 * Private functions
87 struct Chapter;
89 /// Ensure chapter contents are fetched and return the chapter object.
90 struct Chapter* fetchChapter(int book, int chapter);
93 * Variables
96 /// The name of the publisher.
97 QString m_publisher;
99 /// The long version information.
100 QString m_versionInfo;
102 /// The long copyright information.
103 QString m_copyrightInfo;
105 /// Verse data.
106 struct Verse
108 /// Headings preceeding verse.
109 QString heading;
111 /// Content of verse.
112 QString content;
115 /// Chapter data.
116 struct Chapter
118 /// BibleGateway.com URL for this chapter.
119 KUrl url;
121 /// Whether the verses have been fetched.
122 bool fetched;
124 /// List of verse contents.
125 QList<Verse> verses;
128 /// Book data.
129 struct Book
131 /// Name of the book.
132 QString name;
134 /// List of chapter information.
135 QList<Chapter> chapters;
138 /// List of books.
139 QList<Book> m_bookList;
142 #endif // _KwBibleModuleBibleGateway_h_