// BWBorkPadModel.h -- interface to the sheets of notes BorkPad keeps

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

#import <Foundation/Foundation.h>


// This structure represents the result from invoking the method
// findString:startingAt:justOneNote.  It also indicates to that
// method where to start searching (for supporting "search from this point"
// kinds of functionality)
// foundRange.location being set to NSNotFound is the indicator for a
// search that didn't find anything

typedef struct BWBorkPadFindResult {
    int 	noteNumber;
    NSRange	foundRange;
} BWBorkPadFindResult;



// handy extern for initializing a find result variable to an empty
// value.  I wish NSRange had one of these

extern BWBorkPadFindResult BWZeroResult;



@interface BWBorkPadModel : NSObject
{
    // since we're not gonna support styles, just keep an nsarray
    // of NSStrings.  The UI will get/put them as necessary
    NSMutableArray	*notes;
}

// most of this parallels the NSArray API

- (int) count;

- (NSString *) noteAtIndex: (int) index;

- (void) addNote;
- (void) deleteNoteAtIndex: (int) index;

- (void) replaceNoteAtIndex: (int) idnex  withString: (NSString *) string;

// write the notes to the user preferences
- (BOOL) saveNotes;

// searching.  Full details can be found in BWBorkPadModel.m
- (BWBorkPadFindResult) findString: (NSString *) string
			startingAt: (BWBorkPadFindResult) initialLocation
		       justOneNote: (BOOL) justOneNote;

@end // BWBorkPadModel


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