Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Sources/DictionaryKit/TTTDictionary.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions Sources/DictionaryKit/include/DictionaryKit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// DictionaryKit.h
//
//
// Copyright (c) 2014 Mattt Thompson
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -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
Expand All @@ -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"
Expand Down
37 changes: 2 additions & 35 deletions Sources/DictionaryKit/include/TTTDictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,59 +22,26 @@

#import <Foundation/Foundation.h>

/**

*/
@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<TTTDictionary *> *)availableDictionaries;

/**

*/
+ (nullable instancetype)dictionaryNamed:(nonnull NSString *)name;

/**

*/
- (nonnull NSArray<TTTDictionaryEntry *> *)entriesForSearchTerm:(nonnull NSString *)term;

@end

/// @name Constants
Expand Down