/******************************************************************************
 SyGFileTree.h

	Interface for the SyGFileTree class

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

#ifndef _H_GFileTree
#define _H_GFileTree

#include "GSimpleFileTree.h"
#include "SyGColUtils.h"

#include <JString.h>

class SyGFileTree : public GSimpleFileTree
{
public:

	SyGFileTree(GSimpleFileTreeNode* root);
	
	virtual ~SyGFileTree();
	
	void ShowHiddenEntries(const JBoolean show);
	void ShowFiles(const JBoolean show);
	void BroadcastPathChanged();

	void TurnOnFilter(const JCharacter* filter);
	void ReApplyFilter();

	void ChangeSortByType(GFMColType type);
	void ReApplySort();

	const JString& GetFilter();
	
	JBoolean HiddenEntriesVisible();
	JBoolean FilesVisible();

	
private:
	
	JBoolean 		itsShowHiddenEntries;
	JBoolean 		itsShowFiles;
	JString	 		itsFilter;
	GFMColType		itsSortType;
	JBoolean		itsIsChangingSort;
	
private:

	// not allowed

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

public:

	static const JCharacter* kHiddenStatusChanged;
	static const JCharacter* kTreeReSorted;
	static const JCharacter* kPathChanged;

	class HiddenStatusChanged : public JBroadcaster::Message
		{
		public:
			HiddenStatusChanged()
			:
			JBroadcaster::Message(kHiddenStatusChanged)
			{};
		};
		
	class TreeReSorted : public JBroadcaster::Message
		{
		public:
			TreeReSorted()
			:
			JBroadcaster::Message(kTreeReSorted)
			{};
		};

	class PathChanged : public JBroadcaster::Message
		{
		public:
			PathChanged()
			:
			JBroadcaster::Message(kPathChanged)
			{};
		};

};

/******************************************************************************
 HiddenEntriesVisible

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

inline JBoolean
SyGFileTree::HiddenEntriesVisible()
{
	return itsShowHiddenEntries;
}

/******************************************************************************
 FilesVisible

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

inline JBoolean
SyGFileTree::FilesVisible()
{
	return itsShowFiles;
}



#endif
