/******************************************************************************
 GMChooseSaveFile.h

	Interface for the GMChooseSaveFile class.

	Written by John Lindal.

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

#ifndef _H_GMChooseSaveFile
#define _H_GMChooseSaveFile

#include <JXChooseSaveFile.h>
#include <JPrefObject.h>	

class GMSaveFileDialog;
class GMChooseFileDialog;

class GMChooseSaveFile : public JXChooseSaveFile, public JPrefObject
{

public:

	GMChooseSaveFile(JPrefsManager* prefsMgr, const JPrefID& id);

	virtual ~GMChooseSaveFile();
	
	void		ShouldSaveHeaders(const JBoolean save);
	JBoolean	IsSavingHeaders() const;

protected:

	virtual JXSaveFileDialog*
	CreateSaveFileDialog(JXDirector* supervisor, JUNIXDirInfo* dirInfo,
						 const JCharacter* fileFilter, const JCharacter* origName,
						 const JCharacter* prompt, const JCharacter* message);

	virtual JXChooseFileDialog*
	CreateChooseFileDialog(JXDirector* supervisor, JUNIXDirInfo* dirInfo,
						   const JCharacter* fileFilter, const JCharacter* origName, 
						   const JBoolean allowSelectMultiple, const JCharacter* message);

	virtual void	Receive(JBroadcaster* sender, const Message& message);

	virtual void	ReadPrefs(istream& input);
	virtual void	WritePrefs(ostream& output) const;

private:

	GMSaveFileDialog*	itsSaveDialog;
	GMChooseFileDialog*	itsChooseDialog;
	JBoolean			itsSaveHeaders;

private:

	// not allowed

	GMChooseSaveFile(const GMChooseSaveFile& source);
	const GMChooseSaveFile& operator=(const GMChooseSaveFile& source);
};

#endif
