-
Notifications
You must be signed in to change notification settings - Fork 94
/
CHMTableOfContent.h
76 lines (65 loc) · 1.89 KB
/
CHMTableOfContent.h
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
74
75
76
//
// CHMTableOfContent.h
// ichm
//
// Created by Robin Lu on 7/18/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class LinkItem;
@interface CHMTableOfContent : NSObject {
LinkItem *rootItems;
NSMutableArray *itemStack;
NSMutableArray *pageList;
LinkItem *curItem;
}
@property (readonly) LinkItem *rootItems;
@property (readonly) NSArray *pageList;
- (id)initWithData:(NSData *)data encodingName:(NSString*)encodingName;
- (id)initWithTOC:(CHMTableOfContent*)toc filterByPredicate:(NSPredicate*)predicate;
- (LinkItem *)curItem;
- (LinkItem *)itemForPath:(NSString*)path withStack:(NSMutableArray*)stack;
- (int)rootChildrenCount;
- (void)sort;
- (LinkItem*)getNextPage:(LinkItem*)item;
- (LinkItem*)getPrevPage:(LinkItem*)item;
@end
@interface CHMSearchResult : CHMTableOfContent
{
CHMTableOfContent* tableOfContent;
CHMTableOfContent* indexContent;
}
- (id)initwithTOC:(CHMTableOfContent*)toc withIndex:(CHMTableOfContent*)index;
- (void)addPath:(NSString*)path Score:(float)score;
@end
@interface LinkItem : NSObject
{
NSString *_name;
NSString *_path;
NSMutableArray *_children;
NSUInteger pageID;
}
@property (readonly) NSUInteger pageID;
- (id)initWithName:(NSString *)name Path:(NSString *)path;
- (int)numberOfChildren;
- (LinkItem *)childAtIndex:(int)n;
- (NSString *)name;
- (NSString *)uppercaseName;
- (NSString *)path;
- (NSMutableArray*)children;
- (void)purge;
- (void)setName:(NSString *)name;
- (void)setPath:(NSString *)path;
- (void)setPageID:(NSUInteger)pid;
- (void)appendChild:(LinkItem *)item;
- (LinkItem*)find_by_path:(NSString *)path withStack:(NSMutableArray*)stack;
- (void)enumerateItemsWithSEL:(SEL)selector ForTarget:(id)target;
- (void)sort;
@end
@interface ScoredLinkItem : LinkItem
{
float relScore;
}
@property (readwrite, assign) float relScore;
- (id)initWithName:(NSString *)name Path:(NSString *)path Score:(float)score;
@end