/******************************************************************************
 SyGSet.h

	Interface for the SyGSet class

	Copyright © 1996 by John Lindal. All rights reserved.

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

#ifndef _H_SyGSet
#define _H_SyGSet

#include <JXWidgetSet.h>

class JXHorizPartition;
class JString;
class SyGTreeSet;
class GXFMListSet;
class JXTextMenu;
class JXMenuBar;
class ifstream;
class ofstream;
class ostrstream;
class JXToolBar;

enum
{
	kGFM_NewDirCmd = 1, 
	kGFM_OpenCmd,
	kGFM_Duplicate,
	kGFM_HomeWindow,
	kGFM_OpenTrash,
	kGFM_EmptyTrash,
	kGFM_MoveToTrash,
	kGFM_Delete,
	kGFM_EditBindings,
	kGFM_TreeDir,
	kGFM_Tree,
	kGFM_Dir,
	kGFM_Quit
};

class SyGSet : public JXWidgetSet
{
public:

	SyGSet(ifstream& is, const JCharacter* pathName, 
			JBoolean isMain, JCoordinate part1Width, JXContainer* enclosure,
			const HSizingOption hSizing, const VSizingOption vSizing,
			const JCoordinate x, const JCoordinate y,
			const JCoordinate w, const JCoordinate h);

	virtual ~SyGSet();
	
	const JString& GetCurrentPath();
	void SavePreferences(ofstream& os);
	void SavePartitionSize(ostrstream& os);
	void SelectName(const JString& selectName);
	void SelectAll();
	void SaveMainPrefs();

	JBoolean 	FilterVisible();
	void		ToggleFilter();
	void		SaveFilterPref();

	void		WindowIconified();
	void		WindowDeiconified();

protected:

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

private:

	JXHorizPartition* 	itsPartition;
	SyGTreeSet* 		itsTreeSet;
	GXFMListSet* 		itsListSet;
	JXTextMenu* 		itsFileMenu;
	JXTextMenu* 		itsWindowsMenu;
	JXTextMenu*			itsHelpMenu;
	JXTextMenu*			itsPrefsMenu;
	JBoolean 			itsIsMainWindow;
	JXMenuBar* 			itsMenuBar;
	JXToolBar*			itsToolBar;

private:

	void HandleFileMenu(const JIndex index);
	void UpdateFileMenu();

	void UpdateWindowsMenu();
	void HandleWindowsMenu(const JIndex index);

	void HandleHelpMenu(const JIndex index);
	void HandlePrefsMenu(const JIndex index);

	void AdjustPartitions();

private:

	// not allowed

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

#endif
