5 // Copyright (c) 2005 A. Karl Keller (http://karlk.net)
7 // This code is open-source, free software, made available without warranty under
8 // the terms of the GNU General Public License, either version 2 or later (see
9 // http://www.gnu.org/licenses/gpl.html or included copy); as such, it may be
10 // redistributed and/or modified in accordance with that document.
15 #import <Cocoa/Cocoa.h>
17 #define RTK_CHANGED_REVISION @"RTKChangedRevision"
21 @interface RTKVerse
: NSObject
24 NSString
* preUSFMType
; // maintained for previous versions
28 NSMutableArray
*revisions
;
29 int currentRevisionIndex
;
31 // Lossless forwards/backwards compatibility
32 NSDictionary
* dictionary
;
35 - (id
)initWithDictionary
:(NSDictionary
*)dict
;
36 - (id
)initWithString
:(NSString
*)string
;
37 - (id
)initWithSFMString
:(NSString
*)string
38 andStateDict
:(NSMutableDictionary
*)dict
;
40 + (RTKVerse
*)verseWithSFMString
:string
42 - (void)updateTypeFieldToUSFM
;
43 - (void)appendLine
:(NSString
*)line
;
45 - (NSString
*)sfmString
;
46 - (NSMutableAttributedString
*)mutableAttributedString
:(BOOL
)romanString
;
48 - (void)setLocked
:(BOOL
)state
;
51 - (void)setReference
:(NSString
*)theReference
;
52 - (NSString
*)reference
;
54 - (void)setPreUSFMType
:(NSString
*)theType
;
55 - (NSString
*)preUSFMType
;
56 - (void)setType
:(NSString
*)theType
;
60 - (BOOL
)matchesString
:(NSString
*)string
;
61 - (void)setDictionary
:(NSDictionary
*)theDictionary
;
62 - (NSDictionary
*)dictionary
;
64 - (BOOL
)updateWithAttributedString
:(NSAttributedString
*)string
65 atIndex
:(NSUInteger
)index
;
67 #pragma mark - revision management
69 - (void)setRevisions
:(NSMutableArray
*)theRevisions
;
70 - (NSMutableArray
*)revisions
;
72 - (void)setCurrentRevisionIndex
:(int)index
;
73 - (int)currentRevisionIndex
;
74 - (RTKRevision
*)currentRevision
;