//
//  CHStringExtensions.h
//  POBase
//
//  Created by Pieter Omvlee on 3/9/08.
//  Copyright 2008 Bohemian Coding. All rights reserved.
//

/*!
 * @header CHSheetController
 * @abstract Put down a sheet on top of a window
 */

#import <Cocoa/Cocoa.h>

/*!
 * @class CHSheetController
 * @abstract Put down a sheet on top of a window
 * Designated intializer is runForWindow or runForWindow:withobject:
 */
@interface CHSheetController : NSWindowController
{
  id object;
  id callbackObject;
  id delegate;
  
  SEL callback;
}
+ (id)runForWindow:(NSWindow *)aWindow;
+ (id)runForWindow:(NSWindow *)aWindow withObject:(id)obj;
+ (id)runForWindow:(NSWindow *)aWindow withObject:(id)obj delegate:(id)del;
+ (id)runForWindow:(NSWindow *)aWindow callback:(SEL)sel onObject:(id)anObject;
- (IBAction)confirm:(id)sender;
- (IBAction)cancel:(id)sender;

- (id)_init;

//overwrite in subclass to return a meaningful value
- (id)infoObject;

@property (retain) id object;
@property (retain) id callbackObject;
@property (assign) id delegate;
@property (assign) SEL callback;

@end

@interface NSObject (CHSheetControllerDelegate)
- (void)sheetControllerDidEnd:(CHSheetController *)sheet;
@end
