diff options
Diffstat (limited to 'bindings/objc/src/SwordModule.h')
-rw-r--r-- | bindings/objc/src/SwordModule.h | 74 |
1 files changed, 19 insertions, 55 deletions
diff --git a/bindings/objc/src/SwordModule.h b/bindings/objc/src/SwordModule.h index 9f1e0ad..4660b5f 100644 --- a/bindings/objc/src/SwordModule.h +++ b/bindings/objc/src/SwordModule.h @@ -30,8 +30,7 @@ #define SWPOS_TOP 1 -@class SwordManager, SwordModuleTextEntry, SwordKey; -@class SwordFilter; +@class SwordManager, SwordModuleTextEntry, SwordKey, SwordFilter; typedef enum { TextTypeStripped = 1, @@ -65,21 +64,8 @@ typedef enum { @interface SwordModule : NSObject { - NSMutableDictionary *configEntries; - ModuleType type; ModuleCategory category; - int status; - SwordManager *swManager; - NSRecursiveLock *moduleLock; - NSLock *indexLock; - - /** we store the name separately */ - NSString *typeString; - NSString *name; - NSString *descr; - NSString *lang; - /** yes, we have a delegate to report any action to */ id delegate; @@ -91,15 +77,10 @@ typedef enum { // ------------- properties --------------- @property (readwrite) ModuleType type; @property (readwrite) int status; -@property (retain, readwrite) NSRecursiveLock *moduleLock; -@property (retain, readwrite) NSLock *indexLock; -@property (retain, readwrite) SwordManager *swManager; - -// swmodule properties -@property (retain, readonly) NSString *name; -@property (retain, readonly) NSString *typeString; -@property (retain, readonly) NSString *descr; -@property (retain, readonly) NSString *lang; +@property (strong, readwrite) SwordManager *swManager; +@property (strong, readwrite) NSLock *indexLock; +@property (strong, readwrite) NSRecursiveLock *moduleLock; +@property (strong, readwrite) NSMutableDictionary *configEntries; #ifdef __cplusplus @@ -107,12 +88,11 @@ typedef enum { Convenience initializer */ + (id)moduleForSWModule:(sword::SWModule *)aModule; -+ (id)moduleForSWModule:(sword::SWModule *)aModule swordManager:(SwordManager *)aManager; /** Factory method that creates the correct module type instance for the given type */ -+ (id)moduleForType:(ModuleType)aType swModule:(sword::SWModule *)swModule swordManager:(SwordManager *)aManager; ++ (id)moduleForType:(ModuleType)aType swModule:(sword::SWModule *)swModule; /** Initialize this module with an the SWModule. @@ -121,12 +101,6 @@ typedef enum { - (id)initWithSWModule:(sword::SWModule *)aModule; /** - Initialize this module with an the SWModule and a SwordManager instance. - This initializer should normally not need to be used. - */ -- (id)initWithSWModule:(sword::SWModule *)aModule swordManager:(SwordManager *)aManager; - -/** Retrieve the underlying SWModule instance */ - (sword::SWModule *)swModule; @@ -149,12 +123,6 @@ typedef enum { // ------------- instance methods --------------- -/** - Initializes module with a given name and SwordManager. - The SwordManager is needed because the underlying SWModule is retrieved from SwordManager. - */ -- (id)initWithName:(NSString *)aName swordManager:(SwordManager *)aManager; - /** Adds a render filter to this module */ - (void)addRenderFilter:(SwordFilter *)aFilter; @@ -166,8 +134,16 @@ typedef enum { */ - (NSInteger)error; -// --------------- Conf entries -------------- +/** module name */ +- (NSString *)name; +/** module description */ +- (NSString *)descr; +/** module language */ +- (NSString *)lang; +/** module type string */ +- (NSString *)typeString; +// --------------- Conf entries -------------- /** Module category as string */ @@ -226,13 +202,6 @@ typedef enum { */ - (NSString *)configFileEntryForConfigKey:(NSString *)entryKey; -// ------------------ module unlocking ------------------ - -/** - Unlock this module with a cipher key, if it is encrypted. - */ -- (BOOL)unlock:(NSString *)unlockKey; - // ------------------ module access semaphores ----------------- /** @@ -303,19 +272,11 @@ typedef enum { - (NSString *)entryAttributeValueFootnoteOfType:(NSString *)fnType indexValue:(NSString *)index forKey:(SwordKey *)aKey; - (NSArray *)entryAttributeValuesLemma; +- (NSArray *)entryAttributeValuesLemmaNormalized; // ----------------- Module text access ---------------------- /** - Retrieves a text entry for a given key. - Type can be: "rendered" or "stripped" - */ -- (SwordModuleTextEntry *)textEntryForKey:(SwordKey *)aKey textType:(TextPullType)aType; -/** - Convenience method with a key-string - */ -- (SwordModuleTextEntry *)textEntryForKeyString:(NSString *)aKeyString textType:(TextPullType)aType; -/** Pulls all text entries for the given reference @return Array of SwordModuleTextEntry */ @@ -354,6 +315,9 @@ typedef enum { */ - (NSArray *)renderedTextEntriesForRef:(NSString *)reference; +- (SwordModuleTextEntry *)renderedTextEntryForRef:(NSString *)reference; +- (SwordModuleTextEntry *)strippedTextEntryForRef:(NSString *)reference; + /** number of entries abstract method, should be overriden by subclasses |