/******************************************************************************
 SyGFileTreeNode.h

	Interface for SyGFileTreeNode class.

	Copyright <A9> 1997 by Glenn W. Bach. All rights reserved.

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

#ifndef _H_SyGFileTreeNode
#define _H_SyGFileTreeNode

#include <JUNIXDirEntry.h>
#include <JPtrArray.h>
#include "GSimpleFileTreeNode.h"
#include <jTime.h>
#include "SyGColUtils.h"

class JUNIXDirInfo;
class SyGFileTree;
class SyGFileTreeList;
class JError;

class SyGFileTreeNode : public GSimpleFileTreeNode
{
public:

	SyGFileTreeNode(SyGFileTree* 	tree,
		JUNIXDirEntry* 			entry,
		JNamedTreeNode* 		parent = NULL,
		const char* 			name = "BASE",
		const JBoolean 			isBranch = kTrue,
		const JBoolean 			isTemporary = kFalse);

	virtual ~SyGFileTreeNode();
	
	JBoolean IsExecutable() const;
	JBoolean IsWritable() const;
	JBoolean IsReadable() const;
	
	virtual JBoolean OKToChange() const;
	
	JError			GoTo(const JCharacter* path);
	void			TurnOnFilter(const JCharacter* filter);
	void			ShowHidden(const JBoolean show);

	void			ChangeSortByType(GFMColType type);
	
protected:

	virtual void		CreateChild(JUNIXDirEntry* entry, 
									GSimpleFileTreeNode** node,
									const JBoolean isBranch,
									const JBoolean append = kTrue);
	virtual JBoolean 	OKToOpen() const;
	virtual void		PathChanged();
	
private:

	// not allowed

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

};


#endif
