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

/*  YAAF Constructor - Rapid application development for YAAF
 *  Copyright (C) 1998 William Edward Woody
 *  
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *  
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 *  02111-1307, USA.
 *  
 *  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 KMenuFileExportMac		103
#define KMenuFileExportWin		104
#define KMenuFileExportUnix		105
#define KMenuFilePageSetup		106
#define KMenuFilePrint			107

#define KMenuEditPrefs			201

#define KMenuResourceCreate		301
#define KMenuResourceEdit		302
#define KMenuResourceGetInfo	303

#define KMenuWindowInspector	401

/************************************************************************/
/*																		*/
/*	Global Preferences													*/
/*																		*/
/************************************************************************/

extern bool		GSnapGridFlag;
extern short	GSnapGridSize;

/************************************************************************/
/*																		*/
/*	Forwards															*/
/*																		*/
/************************************************************************/

class XGDialog;

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

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

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


#endif // PandaWave_TTEXTEDITAPP
