//
//  WFFilePicker.h
//
//  Created by Jesper on 2006-04-13.
//  Copyright 2006 waffle software. All rights reserved.
//
//  License: BSD
//

#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>

@class WFFilePickerIconView;

@interface WFFilePicker : NSView {
	NSButton *chooseButton;
	WFFilePickerIconView *iconView;
	NSTextField *nameView;
	
	NSURL *representedURL;
	FSRef representedFSRef;
	
	BOOL isDropping;
	
//	BOOL allowsMultipleSelection;
	BOOL canChooseDirectories;
	BOOL canChooseFiles;
	BOOL resolvesAliases;
	NSArray *allowedFileTypes;
	
	id filePathObserver;
	NSString *filePathObserverKeyPath;
	
	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;
- (void)setEmptyAndSaveAssignment;

- (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;
- (BOOL)filePicker:(WFFilePicker *)aFilePicker validateURL:(NSURL *)url error:(NSError **)anError;
@end
