-
Notifications
You must be signed in to change notification settings - Fork 11
/
WFFilePicker.h
86 lines (64 loc) · 1.99 KB
/
WFFilePicker.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
//
// WFFilePicker.h
//
// Created by Jesper on 2006-04-13.
// Copyright 2006-2012 waffle software. All rights reserved.
// BSD licensed - see license.txt for more information.
//
#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>
@class WFFilePickerIconView, WFFilePickerLabelView;
@interface WFFilePicker : NSView {
NSButton *chooseButton;
NSButton *emptyButton;
WFFilePickerIconView *iconView;
WFFilePickerLabelView *nameView;
NSURL *representedURL;
FSRef representedFSRef;
NSImage *currentFileIcon;
BOOL isDropping;
BOOL enabled;
BOOL showsEmptyButton;
// BOOL allowsMultipleSelection;
BOOL canChooseDirectories;
BOOL canChooseFiles;
BOOL resolvesAliases;
NSArray *allowedFileTypes;
id filePathObserver;
NSString *filePathObserverKeyPath;
NSValueTransformer *filePathVT;
id enabledObserver;
NSString *enabledObserverKeyPath;
NSValueTransformer *enabledVT;
IBOutlet id delegate;
}
- (void)setRepresentedURL:(NSURL *)u;
- (NSURL *)representedURL;
- (void)setFilePath:(NSString *)s;
- (NSString *)filePath;
- (void)setRepresentedFSRef:(FSRef)r;
- (FSRef)representedFSRef;
- (BOOL)isEmpty;
- (void)setEmpty;
- (BOOL)showsEmptyButton;
- (void)setShowsEmptyButton:(BOOL)set;
- (BOOL)isEnabled;
- (void)setEnabled:(BOOL)en;
- (void)setEnabledWithoutKVO:(BOOL)en;
- (IBAction)beginChooseSheet:(id)sender;
- (id)delegate;
- (void)setDelegate:(id)del;
- (BOOL)resolvesAliases;
- (void)setResolvesAliases:(BOOL)flag;
- (BOOL)canChooseDirectories;
- (void)setCanChooseDirectories:(BOOL)flag;
- (BOOL)canChooseFiles;
- (void)setCanChooseFiles:(BOOL)flag;
- (NSArray *)allowedFileTypes;
- (void)setAllowedFileTypes:(NSArray *)types;
@end
@interface NSObject (WFFilePickerDelegateMethods)
- (NSOpenPanel *)filePicker:(WFFilePicker *)aFilePicker willShowOpenPanel:(NSOpenPanel *)openPanel;
- (void)filePicker:(WFFilePicker *)aFilePicker openPanelDismissedWithReturnCode:(int)returnCode;
- (BOOL)filePicker:(WFFilePicker *)aFilePicker validateURL:(NSURL *)url error:(NSError **)anError;
@end