/*

 Owner: Stefan Neumärker <stefan@boinx.com>
 Company: Boinx Software Ltd., Germany
 Projects: BXServices

 Abstract: This class hold BXAssistantSession, transfers its data to FileMaker on background thread and gives visual feedback.	

 Related: 

 Documentation: 

 */

#import "BXSubmissionWindowController.h"


@class BXAssistantController, BXAssistantSession;


typedef enum
{
	BXSuccessFeedbackOff = 0,
	BXSuccessFeedbackOn,
	BXSuccessFeedbackTimed,
} BXSubmissionControllerSuccessFeedback;

@interface BXSubmissionController : NSObject <BXSubmissionWindowControllerDelegate>
{
	BXAssistantController *_assistantController;
	
	BXSubmissionWindowController *_windowController;
	BXAssistantSession *_session;
	
	BXSubmissionControllerSuccessFeedback _feedbackOnSuccess;
	
	NSRect _windowFrame;
	NSImage *_backgroundImage;
	
	@private
		BOOL _registeredForNotifications;
		NSTimer *_feedbackSuccessTimer;
		NSWindow *_submissionWindow;
}

@property (assign) BXAssistantController *assistantController;
@property (retain) BXAssistantSession *session;
@property (assign) BXSubmissionControllerSuccessFeedback feedbackOnSuccess;
@property (nonatomic, retain) NSWindow *submissionWindow;
@property (assign) NSRect windowFrame;
@property (retain) NSImage *backgroundImage;

+ (id)submissionControllerForController:(BXAssistantController *)inController session:(BXAssistantSession *)inSession;

- (id)initWithController:(BXAssistantController *)inController session:(BXAssistantSession *)inSession;
- (id)initWithController:(BXAssistantController *)inController;
- (id)initWithSession:(BXAssistantSession *)inSession;

- (void)beginSubmission;

@end
