/* 
Copyright (c) 1991-2000 UserLand Software, Inc. 

Permission is hereby granted, free of charge, to any person obtaining a 
copy of this software and associated documentation files (the 
"Software"), to deal in the Software without restriction, including 
without limitation the rights to use, copy, modify, merge, publish, 
distribute, sublicense, and/or sell copies of the Software, and to 
permit persons to whom the Software is furnished to do so, subject to the 
following conditions: 

The above copyright notice and this permission notice shall be 
included in all copies or substantial portions of the Software. 

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
*/ 


#ifndef texteditinclude
#define texteditinclude /*so other includes can tell if we've been loaded*/


#ifndef appletdefsinclude

	#include <appletdefs.h>
	
#endif



#define textvertinset 2
#define texthorizinset 2
#define mintextwidth 25


typedef struct tyeditrecord {
	
	TEHandle macbuffer;
	
	boolean flwindowbased; /*set this true if the text is displayed in its own window*/
	
	boolean flscrolled; /*true if a clicking operation resulted in a scroll*/
	
	boolean flselectall; /*on idle, select all the text*/
	
	short vertcurrent, horizcurrent; /*allows app to maintain scrollbars*/
	} tyeditrecord, *ptreditrecord, **hdleditrecord;
	


void editrewrap (hdleditrecord);

boolean editvisiselection (hdleditrecord);

void editgetsize (Handle, short *, short *);

boolean editnewbuffer (Rect, boolean, bigstring, hdleditrecord *);

void editsetrect (hdleditrecord, Rect);

void editdispose (hdleditrecord);
	
void editidle (hdleditrecord);
	
void editautoscroll (hdleditrecord);

void editpaste (hdleditrecord);

void editcut (hdleditrecord);

void editcopy (hdleditrecord);

boolean editgettext (hdleditrecord, bigstring);

void editkeystroke (char, hdleditrecord);

void editclick (Point, boolean, hdleditrecord);

void editcleartextchanged (hdleditrecord);

void editupdate (hdleditrecord hbuffer);

void editupdateport (hdleditrecord, Rect, WindowPtr);

void editactivate (hdleditrecord, boolean);

void editsetwordwrap (hdleditrecord, boolean);

void editselectall (hdleditrecord);

boolean editpointinrect (Point, hdleditrecord);

boolean editreplace (bigstring, hdleditrecord);

void editsetjustification (tyjustification, hdleditrecord);

void editdrawtext (bigstring, Rect, tyjustification);

boolean editgettexthandle (hdleditrecord, Handle *);

void editdrawtexthandle (Handle, Rect, tyjustification);

boolean editnewbufferfromhandle (Rect, boolean, Handle, hdleditrecord *);

boolean editsettexthandle (hdleditrecord, Handle, boolean);

boolean editgettexthandlecopy (hdleditrecord, Handle *);

boolean editreplacehandle (Handle, hdleditrecord);

boolean editgetselectedtexthandle (hdleditrecord, Handle *);

void editgetbuffersize (hdleditrecord, short *, short *);

boolean edithaveselection (hdleditrecord);

boolean editscroll (hdleditrecord, short, short);

void editscrollto (hdleditrecord, short, short);

boolean editgetselection (hdleditrecord, short *, short *);

boolean editsetselection (hdleditrecord, short, short);

void editsetfont (hdleditrecord, short, short);

#endif /*texteditinclude*/