/******************************************************************************
 SyGTreeSet.h

	Interface for the SyGTreeSet class

	Copyright © 1996 by John Lindal. All rights reserved.

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

#ifndef _H_SyGTreeSet
#define _H_SyGTreeSet

#include <JXWidgetSet.h>
#include <JString.h>

class SyGFileTreeTable;
class SyGSet;
class SyGFilterInput;
class SyGPathInput;
class SyGFileTree;

class JXMenuBar;
class JXTextButton;
class JXStaticText;
class JXScrollbarSet;
class JXContainer;
class JXStringHistoryMenu;

class istream;
class ostream;

class SyGTreeSet : public JXWidgetSet
{
public:

	SyGTreeSet(istream& is, const int type, 
			JXMenuBar* menuBar, 
			const JCharacter* pathName, SyGSet* set,
			JXContainer* enclosure,
			const HSizingOption hSizing, const VSizingOption vSizing,
			const JCoordinate x, const JCoordinate y,
			const JCoordinate w, const JCoordinate h);

	SyGTreeSet(JXMenuBar* menuBar, 
			const JCharacter* pathName, SyGSet* set,
			JXContainer* enclosure,
			const HSizingOption hSizing, const VSizingOption vSizing,
			const JCoordinate x, const JCoordinate y,
			const JCoordinate w, const JCoordinate h);

	virtual ~SyGTreeSet();
	SyGFileTreeTable* GetTable();
	
	void GoToItsPath();
	void SetDirectoryFilter(const JString& filter);
	void SavePreferences(ostream& os);

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

protected:

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

private:

	SyGFileTreeTable*		itsTable;
	SyGFilterInput* 		itsFilterInput;
	JXStringHistoryMenu*	itsFilterHistory;
	SyGPathInput* 			itsPathInput;
	JString 				itsFilter;
	SyGFileTree*				itsFileTree;
	JXStaticText*			itsFilterLabel;
	JXScrollbarSet*			itsScrollbarSet;
	JXTextButton*			itsHomeButton;
	JXTextButton*			itsUpButton;

private:


private:

	void SyGTreeSetX(JXMenuBar* menuBar, 
				const JCharacter* pathName, SyGSet* set,
				JXContainer* enclosure,
				const HSizingOption hSizing, const VSizingOption vSizing,
				const JCoordinate x, const JCoordinate y,
				const JCoordinate w, const JCoordinate h);

	// not allowed

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

/******************************************************************************
 GetTable

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

inline SyGFileTreeTable*
SyGTreeSet::GetTable()
{
	return itsTable;
}

#endif
