// BWBorkPadController.h -- the application controller for BorkPad

// Copyright (C) 2003 Borkware
// We use the BSD License.  Check out http://borkware.com/license


// one thing to note is that this class is also the controller for two sheets
// ('goto note', and 'find').  It's mainly to reduce the class count so we
// have a very fast launch, plus the actual work done for those two sheets
// is very minor, so it was easier to keep things all glommed together
// here than to construct some kind of protocol so the sheets could talk
// back to the controller class here.


#import <Cocoa/Cocoa.h>
#import "BWBorkPadModel.h"

// random forward references.  We have to incldue BWBorkPadModel.h because
// it defines the BWBorkPadFindResult type we use here

@class BWPageControl;
@class BWBorkPadPrefController;


@interface BWBorkPadController : NSObject
{
    // basic UI jazz
    IBOutlet	BWPageControl	*pageControl;
    IBOutlet	NSTextView	*textView;
    IBOutlet	NSWindow	*window;
    IBOutlet	NSButton	*gotoNoteShortcutButton;

    // goto note sheet stuff
    IBOutlet	NSTextField	*gotoNoteNoteCount;
    IBOutlet	NSTextField	*gotoNoteField;
    IBOutlet    NSButton	*gotoNoteOk;
    IBOutlet	NSWindow	*gotoNoteSheet;

    // find sheet stuff
    IBOutlet	NSTextField	*findField;
    IBOutlet	NSButton	*findOk;
    IBOutlet	NSMatrix	*findRadioMatrix;
    IBOutlet	NSWindow	*findSheet;
    		NSString 	*findText;
    		BOOL 		 findInAllNotes;
    		BWBorkPadFindResult lastFind;

    		// font / size prefs
    		BWBorkPadPrefController *prefController;
    
    		// the model class
    		BWBorkPadModel	*notes;

    		// the current page being shown.  this is zero based.  the UI
    		// is one-based, so we do some +1's and -1's in the code
    		int		 currentNote;

   		// how to change currentNote after the swoop is done
    		int 		 postSwoopDelta; // != 0 implies a swoop in action
}

// main UI actions

- (IBAction) newNote: (id) sender;
- (IBAction) openPrefs: (id) sender;
- (IBAction) gotoNote: (id) sender;
- (IBAction) deleteNote: (id) sender;
- (IBAction) find: (id) sender;
- (IBAction) findAgain: (id) sender;
- (IBAction) save: (id) sender;


// goto note sheet actions

- (IBAction) cancelGotoSheet: (id) sender;
- (IBAction) acceptGotoSheet: (id) sender;

// find sheet actions

- (IBAction) cancelFindSheet: (id) sender;
- (IBAction) acceptFindSheet: (id) sender;

@end // BWBorkPadController


/* $Id: BWBorkPadController.h,v 1.10 2003/01/02 21:29:20 markd Exp $ */

