-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBCSearchController.h
110 lines (70 loc) · 2.52 KB
/
BCSearchController.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
//
// BCSearchController.h
// Caravan
//
// Created by Tom Houpt on 15/9/27.
// Copyright (c) 2015 Tom Houpt. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
typedef NS_ENUM(NSInteger, BCSearchOptionsType) {
kContainsSearchTerm = 0,
kStartsWithSearchTerm = 1,
kEndsWithSearchTerm = 2,
kFullWordSearchTerm = 3
};
#define kBCSearchTermPositionKey @"BCSearchTermPositionKey"
#define kBCSearchIgnoreCaseKey @"BCSearchIgnoreCaseKey"
#define kBCSearchUsingRegexKey @"BCSearchUsingRegexKey"
#define kDefaultSearchTermPosition @0
#define kDefaultSearchIgnoreCase @YES
#define kDefaultSearchUsingRegex @NO
@class CaravanSourceFile;
@class CaravanSourceListDocument;
@interface BCFindResult: NSObject
@property CaravanSourceFile *file;
@property NSRange resultRange;
@property NSMutableAttributedString *resultString;
@end
@interface BCSearchTableView: NSTableView
-(void)handleDoubleClick:(id)sender;
@end
@interface BCSearchController : NSObject <NSTableViewDataSource, NSTableViewDelegate> {
NSDictionary *insertDictionary;
NSCharacterSet *controlChars;
NSDictionary *boldAttribute;
NSString *regexPattern;
NSInteger searchOptions;
NSInteger regexOptions;
NSRegularExpression *regExp;
}
@property CaravanSourceListDocument *document;
@property NSMutableArray *results;
@property IBOutlet BCSearchTableView *resultsTable;
@property IBOutlet NSButton *find;
@property IBOutlet NSButton *replace;
@property IBOutlet NSButton *replaceAll;
@property IBOutlet NSButton *ignoreCase;
@property IBOutlet NSButton *regex;
@property IBOutlet NSMatrix *position;
@property IBOutlet NSTextField *findString;
@property IBOutlet NSTextField *replaceString;
@property IBOutlet NSButton *deleteFind;
@property IBOutlet NSButton *deleteReplace;
@property IBOutlet NSPopUpButton *insertFind;
@property IBOutlet NSPopUpButton *insertReplace;
@property IBOutlet NSButton *okButton;
@property IBOutlet NSWindow *dialog;
-(NSArray *)dialogForWindow:(NSWindow *)ownerWindow;
-(void)handleRowDoubleClick:(BCSearchTableView*)table;
-(IBAction)OKButtonPressed:(id)sender;
-(IBAction)regexPressed:(id)sender;
-(IBAction)deleteFindPressed:(id)sender;
-(IBAction)deleteReplacePressed:(id)sender;
-(IBAction)insertFindPressed:(id)sender;
-(IBAction)insertReplacePressed:(id)sender;
-(IBAction)findStringEntered:(id)sender;
-(IBAction)replacePressed:(id)sender;
-(IBAction)replaceAllPressed:(id)sender;
-(BOOL) replaceFindResult:(BCFindResult *)result;
@end