1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
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. *
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. *
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 _KwBibleModuleSword_h_
21 #define _KwBibleModuleSword_h_
24 * @file KwBibleModuleSword.h
25 * @brief A SWORD bible module.
26 * @author James Hogan <james@albanarts.com>
29 #include "KwBibleModule.h"
36 /// A SWORD bible module.
37 class KwBibleModuleSword
: public KwBibleModule
42 * Constructors + destructor
45 /// Default constructor.
46 KwBibleModuleSword(sword::SWText
* module
);
49 virtual ~KwBibleModuleSword();
56 virtual QString
name();
59 virtual QString
description();
62 virtual int numChapters(int book
);
65 virtual int numVerses(int book
, int chapter
);
68 virtual QString
renderText(const KwBibleModule::Key
& key
);
73 * Protected virtual interface
77 virtual void obtainBooks();
83 /// Find whether the module has a given testament.
84 bool hasTestament(int testament
);
86 /// Find the testament and index of the book within the testament.
87 int bookInTestament(int& book
);
89 /// Find the book index from testament and book id.
90 int toBookIndex(int testament
, int book
);
98 /// SWORD module object.
99 sword::SWText
* m_module
;
101 /// Whether the module has each testament.
102 int m_hasTestament
[2];
105 #endif // _KwBibleModuleSword_h_