// BWPageControl.h -- this is the bottom-of-the-window UI thingie. It has some
//		      eye-candy that looks kinda like some stacked pages,
//		      as well as a dog-ear page control that lets the
//		      user page forward and page backwards, as well as showing
//		      the current page number.
//		      BorkPad supports clicking the page number to open the
//		      'goto note' sheet, but that's actally implemented as
//		      as a transparent button in IB and not in code here

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

#import <Cocoa/Cocoa.h>


// this is a private enum, but I figured might as well declare it
// here and be able to use it in the object's structure.  These
// constants are used during mouse tracking to keep track of what
// part the mouse is currently in.

// Notifications of page actions uses a delegate.  That's kind of
// a strange thing to do (a bad decision made real early on, but it's not
// bad enough to warrant fixing.  It also shows folks how to implement
// a delegate.  yeah.  that's it.)  It should be changed to use
// IBActions

typedef enum {
    BWPageNoPart,
    BWPageForward,
    BWPageBackward
} BWPageControlPart;



@interface BWPageControl : NSView
{
    NSString	      	*pageNumber;

    NSTimer	     	*pagerTimer;	// auto-repeat page flipping if the holds

    BWPageControlPart	 hitPart;
    BWPageControlPart	 currentPart;

    IBOutlet 	id	 delegate; 	// whom to notify
}

// what to display in the 'page number' area of the control
- (void) setPageNumber: (int) number;

- (void) setDelegate: (id) delegate;

@end // BWPageControl



// These are the methods that the delegate should implement if they
// wish notification

@interface NSObject(BWPageControlDelegate)
- (void) pageForward;
- (void) pageBackward;
@end // BWPageControlDelegate


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

