/******************************************************************************
 BindingsDir.h

	Interface for the BindingsDir class

	Copyright © 1997 by Glenn Bach. 

 ******************************************************************************/

#ifndef _H_BindingsDir
#define _H_BindingsDir

#include <JXWindowDirector.h>
#include <JPtrArray.h>
#include <JString.h>

class JXTextButton;
class BindingsList;
class BindingsTable;

class BindingsDir : public JXWindowDirector
{
public:
	
	static JBoolean Create(JXDirector* supervisor, BindingsDir** dir);
	virtual ~BindingsDir();

	void Save();
	void NeedsSave();
	void Reverted();
	void TryToClose();
	
	void SetHelpSection(const JCharacter* section);
	
	void ReadSetup(istream& is);
	void WriteSetup(ostream& os);

protected:

	BindingsDir(JXDirector* supervisor, BindingsList* list);
	virtual void	Receive(JBroadcaster* sender,
								const JBroadcaster::Message& message);
private:

// begin JXLayout

    JXTextButton* itsSaveButton;
    JXTextButton* itsCloseButton;
    JXTextButton* itsNewButton;
    JXTextButton* itsDeleteButton;
    JXTextButton* itsRevertButton;
    JXTextButton* itsHelpButton;

// end JXLayout

	JBoolean		itsNeedsSave;
	BindingsList* 	itsList;
	BindingsTable*	itsTable;

	JString			itsHelpSection;

private:
	

	void		BuildWindow();
	
	// not allowed

	BindingsDir(const BindingsDir& source);
	const BindingsDir& operator=(const BindingsDir& source);

public:

	static const JCharacter* kEditorClosing;
	
	class EditorClosing : public JBroadcaster::Message
		{
		public:
			EditorClosing()
			:
			JBroadcaster::Message(kEditorClosing)
			{ };
		};

};

#endif
