diff --git a/Sources/DictionaryKit/TTTDictionary.m b/Sources/DictionaryKit/TTTDictionary.m index 0748aa6..b73671e 100644 --- a/Sources/DictionaryKit/TTTDictionary.m +++ b/Sources/DictionaryKit/TTTDictionary.m @@ -55,7 +55,7 @@ typedef NS_ENUM(NSInteger, TTTDictionaryRecordVersion) { extern CFStringRef DCSDictionaryGetName(DCSDictionaryRef dictionary); extern CFStringRef DCSDictionaryGetShortName(DCSDictionaryRef dictionary); extern DCSDictionaryRef DCSDictionaryCreate(CFURLRef url); -extern CFStringRef DCSDictionaryGetName(DCSDictionaryRef dictionary); +extern CFStringRef DCSDictionaryGetIdentifier(DCSDictionaryRef dictionary); extern CFArrayRef DCSCopyRecordsForSearchString(DCSDictionaryRef dictionary, CFStringRef string, void *, void *); extern CFDictionaryRef DCSCopyDefinitionMarkup(DCSDictionaryRef dictionary, CFStringRef record); @@ -91,7 +91,7 @@ - (instancetype)initWithRecordRef:(CFTypeRef)record if (self.headword) { self.text = (__bridge_transfer NSString*)DCSRecordCopyData(record, TTTDictionaryVersionText); } - + self.HTML = (__bridge_transfer NSString *)DCSRecordCopyData(record, (long)TTTDictionaryVersionHTMLWithPopoverCSS); return self; @@ -101,6 +101,7 @@ - (instancetype)initWithRecordRef:(CFTypeRef)record @interface TTTDictionary () @property (readwrite, nonatomic, assign) DCSDictionaryRef dictionary; +@property (readwrite, nonatomic, copy) NSString *identifier; @property (readwrite, nonatomic, copy) NSString *name; @property (readwrite, nonatomic, copy) NSString *shortName; @end @@ -145,6 +146,7 @@ - (instancetype)initWithDictionaryRef:(DCSDictionaryRef)dictionary { } self.dictionary = dictionary; + self.identifier = (__bridge NSString *)DCSDictionaryGetIdentifier(self.dictionary); self.name = (__bridge NSString *)DCSDictionaryGetName(self.dictionary); self.shortName = (__bridge NSString *)DCSDictionaryGetShortName(self.dictionary); diff --git a/Sources/DictionaryKit/include/DictionaryKit.h b/Sources/DictionaryKit/include/DictionaryKit.h index 796c64a..2fb4d20 100644 --- a/Sources/DictionaryKit/include/DictionaryKit.h +++ b/Sources/DictionaryKit/include/DictionaryKit.h @@ -1,5 +1,5 @@ // DictionaryKit.h -// +// // Copyright (c) 2014 Mattt Thompson // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -8,10 +8,10 @@ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef _DICTIONARY_KIT_ +#ifndef _DICTIONARY_KIT_ #define _DICTIONARY_KIT_ #import "TTTDictionary.h" diff --git a/Sources/DictionaryKit/include/TTTDictionary.h b/Sources/DictionaryKit/include/TTTDictionary.h index cb8a7f0..4fc2e21 100644 --- a/Sources/DictionaryKit/include/TTTDictionary.h +++ b/Sources/DictionaryKit/include/TTTDictionary.h @@ -22,59 +22,26 @@ #import -/** - - */ @interface TTTDictionaryEntry : NSObject -/** - - */ @property (readonly, nonatomic, copy, nullable) NSString *headword; - -/** - - */ @property (readonly, nonatomic, copy, nullable) NSString *text; - -/** - - */ @property (readonly, nonatomic, copy, nullable) NSString *HTML; @end #pragma mark - -/** - - */ @interface TTTDictionary : NSObject -/** - - */ +@property (readonly, nonatomic, copy, nullable) NSString *identifier; @property (readonly, nonatomic, copy, nullable) NSString *name; - -/** - - */ @property (readonly, nonatomic, copy, nullable) NSString *shortName; -/** - - */ + (nonnull NSSet *)availableDictionaries; - -/** - - */ + (nullable instancetype)dictionaryNamed:(nonnull NSString *)name; - -/** - - */ - (nonnull NSArray *)entriesForSearchTerm:(nonnull NSString *)term; + @end /// @name Constants