/*	TTextEditApp.h
 *
 *		Text editor application core
 */

/*  XT - An example text editor application built with the YAAF library
 *
 *	PUBLIC DOMAIN: The source kit of 'xt' has been placed into the
 *	public domain by the author, William Edward Woody, on the hope
 *	that the source kit will provide a useful example of using the
 *	YAAF Library.
 *  
 *  To contact the author, either e-mail me at woody@pandawave.com, 
 *	or write to
 *  
 *          William Edward Woody
 *          In Phase Consulting
 *          1545 Ard Eevin Avenue
 *          Glendale, CA 91202
 *
 *	Or visit us on the web at http://www.pandawave.com
 */

#ifndef PandaWave_TTEXTEDITAPP
#define PandaWave_TTEXTEDITAPP

#include <XApplication.h>

/************************************************************************/
/*																		*/
/*	Menus																*/
/*																		*/
/************************************************************************/

#define	KMenuFileNew			101
#define KMenuFileOpen			102
#define KMenuFilePageSetup		103
#define KMenuFilePrint			104

#define KMenuEditPrefs			201

#define KMenuSearchFind			301
#define KMenuSearchFindAgain	302
#define KMenuSearchReplace		303
#define KMenuSearchReplaceAndFind	304
#define KMenuSearchGoto			305

/************************************************************************/
/*																		*/
/*	Application Core													*/
/*																		*/
/************************************************************************/

/*	TTextEditApp
 *
 *		The core class which manages the text editor
 */

class TTextEditApp : public XGAppMultiWindow {
	public:
								TTextEditApp();
		virtual					~TTextEditApp();
		
		/*
		 *	Events
		 */
		
		DECLAREDISPATCH
		long					DoGetMenuStatus(long, void *);
		long					DoMenuCommand(long, void *);
		long					DoOpenApplication(long, void *);
		long					DoOpenDocument(long, void *);
		
	private:
		void					NewWindow();
		
#if OPT_MACOS
		void					OpenWindow(FSSpec *f = NULL);
#else
		void					OpenWindow(char *f = NULL);
#endif
};


#endif // PandaWave_TTEXTEDITAPP
