forked from NSGod/ichm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHMDocument.h
157 lines (103 loc) · 3.76 KB
/
CHMDocument.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
//
// CHMDocument.h
// ichm
//
// Created by Robin Lu on 7/16/08.
// Copyright __MyCompanyName__ 2008 . All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#import <AvailabilityMacros.h>
#import <PSMTabBarControl/PSMTabBarControl.h>
#import <CHMKit/CHMKit.h>
#import "CHMExporter.h"
@class CHMConsole;
@class CHMBookmark;
enum {
CHMDocumentViewTableOfContents = 1,
CHMDocumentViewIndex = 2,
};
typedef NSUInteger CHMDocumentViewMode;
#ifdef MAC_OS_X_VERSION_10_11
@interface CHMDocument : NSDocument <NSToolbarDelegate, NSMenuDelegate, NSSplitViewDelegate, NSOutlineViewDelegate, NSOutlineViewDataSource, PSMTabBarControlDelegate, CHMDocumentFileSearchDelegate, CHMExporterDelegate, WebPolicyDelegate, WebResourceLoadDelegate, WebFrameLoadDelegate, WebUIDelegate> {
#else
@interface CHMDocument : NSDocument <NSToolbarDelegate, NSMenuDelegate, NSSplitViewDelegate, NSOutlineViewDelegate, NSOutlineViewDataSource, PSMTabBarControlDelegate, CHMDocumentFileSearchDelegate, CHMExporterDelegate> {
#endif
IBOutlet PSMTabBarControl *tabBar;
IBOutlet NSTabView *docTabView;
IBOutlet NSOutlineView *outlineView;
IBOutlet NSWindow *documentWindow;
IBOutlet NSSegmentedControl *historyControl;
IBOutlet NSButton *homeButton;
IBOutlet NSSegmentedControl *textSizeControl;
IBOutlet NSButton *toggleSidebarButton;
IBOutlet NSSearchField *searchField;
IBOutlet NSSplitView *splitView;
IBOutlet NSView *tabViewView;
IBOutlet NSView *sidebarView;
IBOutlet NSMenu *sidebarViewMenu;
IBOutlet NSWindow *exportProgressSheet;
IBOutlet NSProgressIndicator *exportProgressIndicator;
IBOutlet NSTextField *exportNoticeLabel;
NSString *filePath;
NSMutableArray *searchResults;
CHMDocumentFileSearchMode searchMode;
CHMDocumentViewMode viewMode;
BOOL isSearching;
CGFloat sidebarWidth;
BOOL isSidebarRestored;
NSMutableArray *webViews;
WebView *curWebView;
CHMConsole *console;
CHMDocumentFile *documentFile;
CHMLinkItem *currentLinkItem;
BOOL ignoreOutlineViewSelectionChanges;
CHMBookmark *pendingBookmarkToLoad;
CHMExporter *exporter;
}
@property (readonly) NSString *filePath;
@property (nonatomic, assign) CHMDocumentFileSearchMode searchMode;
@property (nonatomic, assign) CHMDocumentViewMode viewMode;
@property (nonatomic, retain) CHMDocumentFile *documentFile;
@property (nonatomic, retain) CHMLinkItem *currentLinkItem;
@property (nonatomic, retain) CHMBookmark *pendingBookmarkToLoad;
- (NSString *)currentURL;
- (NSString *)currentTitle;
- (void)loadURL:(NSURL *)url;
- (IBAction)changeTopic:(id)sender;
- (IBAction)openInNewTab:(id)sender;
- (IBAction)goForward:(id)sender;
- (IBAction)goBack:(id)sender;
- (IBAction)goHistory:(id)sender;
- (IBAction)goHome:(id)sender;
- (IBAction)gotoNextPage:(id)sender;
- (IBAction)gotoPrevPage:(id)sender;
// dump to pdf
- (IBAction)exportToPDF:(id)sender;
// search
- (IBAction)changeSearchMode:(id)sender;
- (IBAction)search:(id)sender;
- (IBAction)focusOnSearch:(id)sender;
// sidebar view
- (IBAction)changeViewMode:(id)sender;
- (IBAction)toggleSidebar:(id)sender;
- (IBAction)zoom:(id)sender;
- (IBAction)zoomIn:(id)sender;
- (IBAction)zoomOut:(id)sender;
// find panel
- (IBAction)showFindPanel:(id)sender;
- (IBAction)beginFind:(id)sender;
- (IBAction)findNext:(id)sender;
- (IBAction)findPrev:(id)sender;
- (IBAction)findInFile:(id)sender;
- (IBAction)doneFind:(id)sender;
// bookmark
- (IBAction)showAddBookmark:(id)sender;
// tab
- (IBAction)addNewTab:(id)sender;
- (IBAction)closeTab:(id)sender;
- (IBAction)chmDocumentSelectNextTabViewItem:(id)sender;
- (IBAction)chmDocumentSelectPreviousTabViewItem:(id)sender;
//text encoding
- (IBAction)changeEncoding:(id)sender;
@end