2 Smultron version 3.1, 2007-05-19
3 Written by Peter Borg, pgw3@mac.com
4 Find the latest version at http://smultron.sourceforge.net
6 Copyright 2004-2007 Peter Borg
8 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
15 #import <Cocoa/Cocoa.h>
16 //#import "SMLStandardHeader.h"
17 #import <Carbon/Carbon.h>
19 #import <SyncServices/SyncServices.h>
21 #import <SystemConfiguration/SCNetwork.h>
23 #import <ApplicationServices/ApplicationServices.h>
24 #import "SCTextView.h"
27 SMLCurrentDocumentScope
= 0,
28 SMLCurrentProjectScope
,
30 } SMLAdvancedFindScope
;
32 #define OKBUTTON NSLocalizedString(@"OK", @"OK-button")
33 #define DELETEBUTTON NSLocalizedString(@"Delete", @"Delete-button")
35 @interface SMLAdvancedFindController
: NSObject
37 IBOutlet NSWindow
*advancedFindWindow
;
38 IBOutlet NSSearchField
*findSearchField
;
39 IBOutlet NSSearchField
*replaceSearchField
;
40 IBOutlet NSTextField
*findResultTextField
;
41 IBOutlet NSOutlineView
*findResultsOutlineView
;
42 // IBOutlet NSView *resultDocumentContentView;
43 IBOutlet NSTreeController
*findResultsTreeController
;
45 IBOutlet NSSplitView
*advancedFindSplitView
;
47 IBOutlet NSButton
*currentDocumentScope
;
48 IBOutlet NSButton
*currentProjectScope
;
49 IBOutlet NSButton
*allDocumentsScope
;
51 IBOutlet NSTextView
*mTextView
;
52 IBOutlet NSButton
*setUseRegularExpressionsButton
;
53 IBOutlet NSButton
*setSearchInSelectionButton
;
54 IBOutlet NSButton
*setIgnoreCaseButton
;
56 IBOutlet NSScrollView
* mScrollView
;
58 id currentlyDisplayedDocumentInAdvancedFind
;
60 NSMutableArray
*mContents
; //search results
62 IBOutlet NSPanel
*regularExpressionsHelpPanel
;
64 SMLAdvancedFindScope mSearchScope
;
65 NSDocument
*mCurrentDocument
;
67 NSWindowController
* myWindowController
;
70 + (SMLAdvancedFindController
*)sharedInstance
;
72 - (IBAction
)findAction
:(id
)sender
;
73 - (IBAction
)replaceAction
:(id
)sender
;
75 - (void)performNumberOfReplaces
:(NSInteger
)numberOfReplaces
;
77 - (void)showAdvancedFindWindow
;
79 - (NSEnumerator
*)scopeEnumerator
;
81 - (id
)currentlyDisplayedDocumentInAdvancedFind
;
82 - (void)removeCurrentlyDisplayedDocumentInAdvancedFind
;
84 //- (NSView *)resultDocumentContentView;
86 //- (NSManagedObjectContext *)managedObjectContext;
88 - (NSMutableDictionary
*)preparedResultDictionaryFromString
:(NSString
*)completeString searchStringLength
:(NSInteger
)searchStringLength range
:(NSRange
)foundRange lineNumber
:(NSInteger
)lineNumber document
:(id
)document
;
90 - (void)alertThatThisIsNotAValidRegularExpression
:(NSString
*)string
;
92 - (IBAction
)searchScopeChanged
:(id
)sender
;
94 - (NSWindow
*)advancedFindWindow
;
95 - (NSOutlineView
*)findResultsOutlineView
;
97 - (IBAction
)showRegularExpressionsHelpPanelAction
:(id
)sender
;
99 - (NSMutableArray
*) contents
;
101 - (void) setContents
: (NSArray
*)newContents
;
103 - (void)insertDocumentIntoFourthContentView
:(id
)document selectRange
: (NSRange
) selectRange
;
104 - (void*) getSCObject
;
106 - (void)showRegularExpressionsHelpPanel
;