summaryrefslogtreecommitdiff
path: root/bindings/objc/src/SwordBible.h
blob: f57d32201dea124e012074b3ae4c22b408918e7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*	SwordBible.h - Sword API wrapper for Biblical Texts.

    Copyright 2008 Manfred Bergmann
    Based on code by Will Thimbleby

	This program is free software; you can redistribute it and/or modify it under the terms of the
	GNU General Public License as published by the Free Software Foundation version 2.

	This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
	even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
	General Public License for more details. (http://www.gnu.org/licenses/gpl.html)
*/

#import <Foundation/Foundation.h>

#ifdef __cplusplus
#import "versekey.h"
#endif

@class SwordModule, SwordManager, SwordBibleBook, SwordModuleTextEntry, SwordBibleTextEntry;
@class SwordKey;

typedef enum {
	OldTestament = 1,
	NewTestament
}Testament;

@interface SwordBible : SwordModule {
    NSMutableDictionary *books;
}

@property (retain, readwrite) NSMutableDictionary *books;

// ----------- class methods -------------
+ (void)decodeRef:(NSString *)ref intoBook:(NSString **)bookName book:(int *)book chapter:(int *)chapter verse:(int *)verse;
+ (NSString *)firstRefName:(NSString *)abbr;
+ (NSString *)context:(NSString *)abbr;
#ifdef __cplusplus
+ (int)bookIndexForSWKey:(sword::VerseKey *)key;
#endif


- (BOOL)hasReference:(NSString *)ref;
- (int)numberOfVerseKeysForReference:(NSString *)aReference;

// book lists
- (NSArray *)bookList;

- (NSString *)bookIntroductionFor:(SwordBibleBook *)aBook;
- (NSString *)chapterIntroductionFor:(SwordBibleBook *)aBook chapter:(int)chapter;
- (NSString *)moduleIntroduction;

// some numbers
- (SwordBibleBook *)bookForLocalizedName:(NSString *)bookName;
- (int)chaptersForBookName:(NSString *)bookName;
- (int)versesForChapter:(int)chapter bookName:(NSString *)bookName;
- (int)versesForBible;

// Text pulling

/**
* @return SwordBibleTextEntry
*/
- (SwordModuleTextEntry *)textEntryForKey:(SwordKey *)aKey textType:(TextPullType)aType;
- (NSArray *)strippedTextEntriesForRef:(NSString *)reference context:(int)context;
- (NSArray *)renderedTextEntriesForRef:(NSString *)reference context:(int)context;
/**
 Override from super class
 @return Array of SwordBibleTextEntry
 */
- (NSArray *)textEntriesForReference:(NSString *)aReference textType:(TextPullType)textType;

@end