/*	XInlineEdit.h
 *
 *		This contains the XGInlineEdit class, which is used for inline
 *	editing the contents of a view. To use this class, declare an instance
 *	of this object inside of a view, and use the external API to create,
 *	destroy, and get the contents of an edit view
 */

/*  YAAF - Yet another application framework
 *  Copyright (C) 1997, 1998 William Edward Woody
 *  
 *  This library is free software; you can redistribute it
 *  and/or modify it under the terms of the GNU Library
 *  General Public License as published by the Free Software
 *  Foundation; either version 2 of the License, or any
 *  later version.
 *  
 *  This library is distributed in the hope that it will be
 *  useful, but WITHOUT ANY WARRANTY; without even the implied
 *  warranty of MERCHANTABIILITY or FITNESS FOR A PARTICULAR
 *  PURPOSE. See the GNU Library General Public License for
 *  more details.
 *  
 *  You should have received a copy of the GNU Library General
 *  Public License along with this library; 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_XINLINEEDIT
#define PandaWave_XINLINEEDIT

#include <XConfig.h>
#include <XTextControls.h>

/************************************************************************/
/*																		*/
/*	Standard Classes													*/
/*																		*/
/************************************************************************/

/*	XGInlineEdit
 *
 *		This is an inline editing class. This basically knows how to
 *	self-destruct when it is deactivated or loses focus
 */

class XGInlineEdit : public XGEditText {
	public:
								XGInlineEdit(XGOwner *parent, XGSEditInitRecord &init);
		virtual					~XGInlineEdit();
		
		/*
		 *	Initialization support
		 */
		
		static XGInlineEdit		*Create(XGView *parent, 
										Rect &where, 
										short font, 
										char *text = NULL);
		
		/*
		 *	Delete me
		 */
		
		void					DoActivate(bool);
		bool					CanLoseFocus();
		void					LoseFocus();
		
		DECLAREDISPATCH
		long					DoKey(long,void *);
};


#endif // PandaWave_XINLINEEDIT
